Bug 1336191 - Fix location-protocol-setter-non-broken.html to run correctly, r=annevk
MozReview-Commit-ID: AleeFVj3h9z
--- a/testing/web-platform/tests/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html
+++ b/testing/web-platform/tests/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html
@@ -38,20 +38,21 @@ self.onload = () => {
dataFrame.src = `data:text/html,<script>
onmessage = (e) => {
let result = false;
try {
location.protocol = e.data
} catch(e) {
result = true
}
- setTimeout(() => e.ports[0].postMessage([result, location.protocol]), 100)
+ e.ports[0].postMessage([result, location.protocol])
}
<\/script>`
dataFrame.onload = t.step_func(() => {
+ dataFrame.onload = null;
dataFrame.contentWindow.postMessage(val, "*", [channel.port2])
})
channel.port1.onmessage = t.step_func_done((e) => {
assert_false(e.data[0])
assert_equals(e.data[1], "data:")
})
document.body.appendChild(dataFrame)
}, "Set data URL frame location.protocol to " + val)