Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Checking the browsing_context before change title, and adding wpt test
- Loading branch information
Showing
4 changed files
with
46 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
tests/wpt/mozilla/tests/mozilla/mozbrowser/mozbrowsertitlechangedeagerly_event.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!doctype html> | ||
<meta charset="utf-8"> | ||
<title>Check if title_changed is too eager (issue #10782)</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<body></body> | ||
<script> | ||
async_test(function(t) { | ||
var iframe = document.createElement("iframe"); | ||
iframe.mozbrowser = "true"; | ||
iframe.src = "mozbrowsertitlechangedeagerly_event_iframe.html"; | ||
iframe.addEventListener("mozbrowsertitlechange", t.step_func(e => { | ||
assert_equals(e.type, "mozbrowsertitlechange"); | ||
assert_not_equals(e.detail, "Bar"); | ||
})); | ||
iframe.addEventListener("load", t.step_func_done()); | ||
document.body.appendChild(iframe); | ||
}); | ||
</script> |
16 changes: 16 additions & 0 deletions
16
tests/wpt/mozilla/tests/mozilla/mozbrowser/mozbrowsertitlechangedeagerly_event_iframe.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<html> | ||
<head> | ||
<title>Foo</title> | ||
<script> | ||
var text = | ||
'<html xmlns="http://www.w3.org/1999/xhtml">' + | ||
' <head>' + | ||
' <title>Bar</title>' + | ||
' </head>' + | ||
'</html>'; | ||
var parser = new DOMParser(); | ||
var doc = parser.parseFromString(text, "text/xml"); | ||
</script> | ||
</head> | ||
<body>Hello world</body> | ||
</html> |