New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mozbrowsersecuritychange event #9244
Merged
+135
−4
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.
| @@ -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", | ||
jdm
Member
|
||
| ]; | ||
|
|
||
| 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> | ||
ProTip!
Use n and p to navigate between commits in a pull request.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Let's give this a
<title>and update the ini to use that instead ofUntitled.