mshtml/tests: Added a test of calls to functions from different frame.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
2f9c2186cc
commit
e6f7a759ed
|
@ -104,6 +104,21 @@ function test_head() {
|
|||
next_test();
|
||||
}
|
||||
|
||||
function test_iframe() {
|
||||
document.body.innerHTML = '<iframe src="runscript.html?frame.js"></iframe>'
|
||||
var iframe = document.body.firstChild;
|
||||
|
||||
iframe.onload = guard(function() {
|
||||
var r = iframe.contentWindow.global_object.get_global_value();
|
||||
ok(r === "global value", "get_global_value() returned " + r);
|
||||
|
||||
var f = iframe.contentWindow.global_object.get_global_value;
|
||||
ok(f() === "global value", "f() returned " + f());
|
||||
|
||||
next_test();
|
||||
});
|
||||
}
|
||||
|
||||
function test_getElementsByClassName() {
|
||||
var elems;
|
||||
|
||||
|
@ -178,6 +193,7 @@ var tests = [
|
|||
test_ElementTraversal,
|
||||
test_getElementsByClassName,
|
||||
test_head,
|
||||
test_iframe,
|
||||
test_query_selector,
|
||||
test_compare_position
|
||||
];
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
* Copyright 2017 Jacek Caban for CodeWeavers
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
var global_value = "global value";
|
||||
|
||||
var global_object = {
|
||||
get_global_value: function() {
|
||||
return global_value;
|
||||
}
|
||||
};
|
|
@ -34,6 +34,12 @@ vbtest.html HTML "vbtest.html"
|
|||
/* @makedep: events.html */
|
||||
events.html HTML "events.html"
|
||||
|
||||
/* @makedep: runscript.html */
|
||||
runscript.html HTML "runscript.html"
|
||||
|
||||
/* @makedep: frame.js */
|
||||
frame.js HTML "frame.js"
|
||||
|
||||
/* @makedep: externscr.js */
|
||||
externscr.js HTML "externscr.js"
|
||||
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<script>
|
||||
var q = document.location.search.replace("?", "");
|
||||
if(q) document.write('<s'+'cript src="' + q + '"></s'+'cript>');
|
||||
</script>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue