mirror of
https://github.com/servo/servo.git
synced 2025-10-01 09:09:15 +01:00
Auto merge of #14936 - servo:incumbent-global, r=jdm
Implement the incumbent global. Fixes #10963. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14936) <!-- Reviewable:end -->
This commit is contained in:
commit
463a8bbdb6
7 changed files with 156 additions and 9 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