Bug 1591114 - test_bug260264.html should await SpecialPowers.testPermission. r=smaug, a=test-only
authorRob Wu <rob@robwu.nl>
Thu, 24 Oct 2019 16:42:51 +0000
changeset 559812 6c0dbccdc5e81712a83e0fe56eebc05790f78d93
parent 559811 1b5750705e9a14baf956d9316adc5e656401d031
child 559813 0c43044aedcd3fcc1db81df4743743ec1c4b1610
push id12228
push userryanvm@gmail.com
push dateWed, 30 Oct 2019 15:32:25 +0000
treeherdermozilla-beta@0c43044aedcd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, test-only
bugs1591114, 260264
milestone71.0
Bug 1591114 - test_bug260264.html should await SpecialPowers.testPermission. r=smaug, a=test-only Differential Revision: https://phabricator.services.mozilla.com/D50488
dom/tests/mochitest/bugs/test_bug260264.html
--- a/dom/tests/mochitest/bugs/test_bug260264.html
+++ b/dom/tests/mochitest/bugs/test_bug260264.html
@@ -28,20 +28,20 @@ SimpleTest.requestFlakyTimeout("untriage
 var a = $("link"),
     checkOpened = function() { ok(window.open("http://example.com"), "not properly opened") },
     checkBlocked = function() { ok(!window.open("http://example.com"), "not properly blocked") };
 
 add_task(async function check_sanity() {
   await new Promise(resolve => setTimeout(resolve, 200));
 
   await SpecialPowers.pushPermissions([{'type': 'popup', 'remove': true, 'context': document}]);
-  ok(SpecialPowers.testPermission('popup', UNKNOWN_ACTION, document), 'popup value should have UNKNOWN permission');
+  ok(await SpecialPowers.testPermission('popup', UNKNOWN_ACTION, document), 'popup value should have UNKNOWN permission');
 
   await SpecialPowers.pushPermissions([{'type': 'popup', 'allow': true, 'context': document}]);
-  ok(SpecialPowers.testPermission('popup', ALLOW_ACTION, document), 'popup value should have ALLOW permission');
+  ok(await SpecialPowers.testPermission('popup', ALLOW_ACTION, document), 'popup value should have ALLOW permission');
 
   await SpecialPowers.pushPrefEnv({"set": [["dom.disable_open_during_load", true],
                                      ["dom.popup_allowed_events", "click mouseup"],
                                      ["dom.popup_maximum", 3]]});
 
   // Note: UNKNOWN_ACTION is the same as DENY_ACTION.
   await SpecialPowers.pushPermissions([{'type': 'popup', 'allow': DENY_ACTION, 'context': document}]);
 });