mirror of
https://github.com/servo/servo.git
synced 2025-08-12 08:55:32 +01:00
mozbrowsersercuritychange event
This commit is contained in:
parent
fb3fe3d784
commit
63519c3574
13 changed files with 135 additions and 4 deletions
|
@ -5916,6 +5916,12 @@
|
|||
"url": "/_mozilla/mozilla/mozbrowser/mozbrowsericonchange_event.html"
|
||||
}
|
||||
],
|
||||
"mozilla/mozbrowser/mozbrowsersecuritychange_event.html": [
|
||||
{
|
||||
"path": "mozilla/mozbrowser/mozbrowsersecuritychange_event.html",
|
||||
"url": "/_mozilla/mozilla/mozbrowser/mozbrowsersecuritychange_event.html"
|
||||
}
|
||||
],
|
||||
"mozilla/mozbrowser/mozbrowsershowmodalprompt_event.html": [
|
||||
{
|
||||
"path": "mozilla/mozbrowser/mozbrowsershowmodalprompt_event.html",
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
[mozbrowsersecuritychange_event.html]
|
||||
type: testharness
|
||||
[mozbrowsersecuritychange event is dispatched when content security state changes]
|
||||
expected: FAIL
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
<head>
|
||||
<title>mozbrowsersecuritychange event is dispatched when content security state changes</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
||||
async_test(function(t) {
|
||||
|
||||
const HTTP_URL = "http://web-platform.test:8000";
|
||||
const HTTPS_URL = "https://web-platform.test:8443";
|
||||
|
||||
var urls = [ HTTP_URL, HTTPS_URL, HTTP_URL ];
|
||||
var url_index = 0;
|
||||
|
||||
var expectedEvents = [
|
||||
"insecure",
|
||||
"secure",
|
||||
"insecure",
|
||||
];
|
||||
|
||||
var receivedEvents = [];
|
||||
|
||||
var iframe = document.createElement("iframe");
|
||||
iframe.mozbrowser = "true";
|
||||
iframe.src = urls[url_index++];
|
||||
|
||||
iframe.addEventListener("mozbrowsersecuritychange", t.step_func(e => {
|
||||
|
||||
receivedEvents.push(e.detail.state);
|
||||
|
||||
if (receivedEvents.length == expectedEvents.length) {
|
||||
assert_array_equals(receivedEvents, expectedEvents);
|
||||
t.done();
|
||||
} else {
|
||||
iframe.src = urls[url_index++];
|
||||
}
|
||||
}));
|
||||
|
||||
|
||||
document.body.appendChild(iframe);
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
Loading…
Add table
Add a link
Reference in a new issue