Implement the incumbent global.

Fixes #10963.
This commit is contained in:
Ms2ger 2017-01-05 16:22:44 +01:00
parent 933b74781b
commit 51df04d93e
7 changed files with 152 additions and 5 deletions

View file

@ -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>

View file

@ -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>