Auto merge of #8863 - simartin:issue_8352, r=jdm

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

Fixes https://github.com/servo/servo/issues/8352

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8863)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-12-21 02:28:32 +05:30
commit 9a4d82c314
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>