Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fb3fe3d
commit 63519c3
Showing
13 changed files
with
135 additions
and
4 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
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
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
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
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
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
5 changes: 5 additions & 0 deletions
5
tests/wpt/mozilla/meta/mozilla/mozbrowser/mozbrowsersecuritychange_event.html.ini
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,5 @@ | ||
[mozbrowsersecuritychange_event.html] | ||
type: testharness | ||
[mozbrowsersecuritychange event is dispatched when content security state changes] | ||
expected: FAIL | ||
|
46 changes: 46 additions & 0 deletions
46
tests/wpt/mozilla/tests/mozilla/mozbrowser/mozbrowsersecuritychange_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,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> |