Bug 1336191 - Fix location-protocol-setter-non-broken.html to run correctly, r=annevk draft
authorJames Graham <james@hoppipolla.co.uk>
Thu, 02 Feb 2017 19:31:59 +0000
changeset 469811 0e08d1d8d73235926fc97ae34bcb458d18a4dd3c
parent 469810 0d50f8e752a14b5fc2f8c79dd01642b4ab10a226
child 544305 d0b58d1ffdf6c59fc63c54d32eb331065899d61c
push id43846
push userbmo:james@hoppipolla.co.uk
push dateThu, 02 Feb 2017 19:32:44 +0000
reviewersannevk
bugs1336191
milestone54.0a1
Bug 1336191 - Fix location-protocol-setter-non-broken.html to run correctly, r=annevk MozReview-Commit-ID: AleeFVj3h9z
testing/web-platform/tests/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html
--- 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)