Commit e6f7a759 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml/tests: Added a test of calls to functions from different frame.

parent 2f9c2186
......@@ -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
];
/*
* 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"
......
<!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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment