mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Browser API: implement iframe.reload()
This commit is contained in:
parent
9cccd34bc4
commit
2a86f9d165
6 changed files with 67 additions and 13 deletions
|
@ -5643,6 +5643,12 @@
|
|||
"url": "/_mozilla/mozilla/mozbrowser/mozbrowsericonchange_event.html"
|
||||
}
|
||||
],
|
||||
"mozilla/mozbrowser/reload.html": [
|
||||
{
|
||||
"path": "mozilla/mozbrowser/reload.html",
|
||||
"url": "/_mozilla/mozilla/mozbrowser/reload.html"
|
||||
}
|
||||
],
|
||||
"mozilla/navigator.html": [
|
||||
{
|
||||
"path": "mozilla/navigator.html",
|
||||
|
|
35
tests/wpt/mozilla/tests/mozilla/mozbrowser/reload.html
Normal file
35
tests/wpt/mozilla/tests/mozilla/mozbrowser/reload.html
Normal file
|
@ -0,0 +1,35 @@
|
|||
<head>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
async_test(function(t) {
|
||||
|
||||
const SRC = "data:,foobar";
|
||||
const RELOAD_MAX_COUNT = 5;
|
||||
|
||||
|
||||
var iframe = document.createElement("iframe");
|
||||
iframe.mozbrowser = "true";
|
||||
iframe.src = SRC;
|
||||
|
||||
var reload_count = 0;
|
||||
|
||||
iframe.addEventListener("mozbrowserloadend", t.step_func(e => {
|
||||
reload_count++;
|
||||
assert_equals(SRC, e.target.src);
|
||||
if (reload_count == RELOAD_MAX_COUNT) {
|
||||
t.done();
|
||||
} else {
|
||||
iframe.reload();
|
||||
}
|
||||
}));
|
||||
|
||||
|
||||
document.body.appendChild(iframe);
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
Loading…
Add table
Add a link
Reference in a new issue