Issue #8352: Dispatch mozbrowsershowmodalprompt event for alert().

This commit is contained in:
Simon Martin 2015-12-05 21:49:49 +01:00
parent 2a3a7a73b5
commit 0d910bb934
7 changed files with 58 additions and 5 deletions

View file

@ -5691,6 +5691,12 @@
"url": "/_mozilla/mozilla/mozbrowser/mozbrowsericonchange_event.html"
}
],
"mozilla/mozbrowser/mozbrowsershowmodalprompt_event.html": [
{
"path": "mozilla/mozbrowser/mozbrowsershowmodalprompt_event.html",
"url": "/_mozilla/mozilla/mozbrowser/mozbrowsershowmodalprompt_event.html"
}
],
"mozilla/mozbrowser/reload.html": [
{
"path": "mozilla/mozbrowser/reload.html",

View file

@ -0,0 +1,19 @@
<!doctype html>
<meta charset="utf-8">
<title>Dispatch mozbrowsershowmodalprompt event for alert (issue #8352)</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 = "mozbrowsershowmodalprompt_event_iframe.html";
iframe.addEventListener("mozbrowsershowmodalprompt", t.step_func(e => {
assert_equals(e.detail.promptType, "alert");
assert_equals(e.detail.message, "my alert message");
t.done();
}));
document.body.appendChild(iframe);
});
</script>

View file

@ -0,0 +1,6 @@
<html>
<body></body>
<script>
window.alert("my alert message");
</script>
</html>