author | Ehsan Akhgari <ehsan@mozilla.com> |
Tue, 22 Apr 2014 14:31:55 -0400 | |
changeset 179623 | 39041565bfa9a7f5b9e983df9f8e2fb8a3e6a3c4 |
parent 179622 | 0de0cedf6a7dd87c4a76a198243a5280402550b0 |
child 179624 | 84b4cf605262bff4881bc08859a45f7611482fc3 |
push id | 26632 |
push user | kwierso@gmail.com |
push date | Wed, 23 Apr 2014 00:54:42 +0000 |
treeherder | mozilla-central@02515cf4fcfd [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | rbarnes |
bugs | 991600 |
milestone | 31.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
dom/tests/mochitest/beacon/test_beaconContentPolicy.html | file | annotate | diff | comparison | revisions |
--- a/dom/tests/mochitest/beacon/test_beaconContentPolicy.html +++ b/dom/tests/mochitest/beacon/test_beaconContentPolicy.html @@ -20,17 +20,17 @@ https://bugzilla.mozilla.org/show_bug.cg var beaconUrl = "http://mochi.test:8888/tests/dom/tests/mochitest/beacon/beacon-handler.sjs"; const Cc = SpecialPowers.Cc; const Ci = SpecialPowers.Ci; // not enabled by default yet. SimpleTest.waitForExplicitFinish(); -var policy = setupPolicy(); +var policy; SpecialPowers.pushPrefEnv({'set': [["beacon.enabled", true]]}, beginTest); function setupPolicy() { var policyID = SpecialPowers.wrap(SpecialPowers.Components).ID("{b80e19d0-878f-d41b-2654-194714a4115c}"); var policyName = "@mozilla.org/testpolicy;1"; var policy = { // nsISupports implementation @@ -83,15 +83,20 @@ function teardownPolicy() { var componentManager = SpecialPowers.wrap(SpecialPowers.Components).manager.QueryInterface(Ci.nsIComponentRegistrar); componentManager.unregisterFactory(policy.policyID, policy.policy); var categoryManager = Cc["@mozilla.org/categorymanager;1"].getService(Ci.nsICategoryManager); categoryManager.deleteCategoryEntry("content-policy", policy.policyName, false); }, 0); } function beginTest() { - navigator.sendBeacon(beaconUrl, "bacon would have been a better name than beacon"); + policy = setupPolicy(); + // Make sure to hit the event loop here in order to ensure that nsContentPolicy + // has been notified of the newly registered policy. + SimpleTest.executeSoon(function() { + navigator.sendBeacon(beaconUrl, "bacon would have been a better name than beacon"); + }); } </script> </pre> </body> </html>