mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
parent
933b74781b
commit
51df04d93e
7 changed files with 152 additions and 5 deletions
|
@ -5,12 +5,20 @@
|
|||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script>
|
||||
var entry_test = async_test("Entry global");
|
||||
var incumbent_test = async_test("Incumbent global");
|
||||
var loaded = function() {
|
||||
entry_test.step(function() {
|
||||
var entry = document.querySelector("#incumbent").contentWindow.get_entry();
|
||||
assert_equals(entry, window);
|
||||
});
|
||||
entry_test.done();
|
||||
|
||||
incumbent_test.step(function() {
|
||||
var expected_incumbent = document.querySelector("#incumbent").contentWindow;
|
||||
var incumbent = expected_incumbent.get_incumbent();
|
||||
assert_equals(incumbent, expected_incumbent);
|
||||
});
|
||||
incumbent_test.done();
|
||||
}
|
||||
</script>
|
||||
<iframe id="incumbent" src="incumbent.html" onload="loaded()"></iframe>
|
||||
|
|
|
@ -10,4 +10,11 @@ function get_entry() {
|
|||
|
||||
return current.TestBinding.prototype.entryGlobal.call(new relevant.TestBinding());
|
||||
}
|
||||
|
||||
function get_incumbent() {
|
||||
var current = document.querySelector("#current").contentWindow;
|
||||
var relevant = document.querySelector("#relevant").contentWindow;
|
||||
|
||||
return current.TestBinding.prototype.incumbentGlobal.call(new relevant.TestBinding());
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue