Bug 1318388: Follow-up: Fix test crash in debug builds. a=jcristau
authorKris Maglione <maglione.k@gmail.com>
Mon, 19 Dec 2016 12:07:45 -0800
changeset 353106 3e82bc16778aa475bc537506df9c0ae6c44518da
parent 353105 fced93d4a537712f336bcb47d62edae1a6b70185
child 353107 2677fdd85f9578aa55c0657dc3a78af25f9b992f
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjcristau
bugs1318388
milestone52.0a2
Bug 1318388: Follow-up: Fix test crash in debug builds. a=jcristau MozReview-Commit-ID: 4xuJGe6oNKC
docshell/test/unit/test_setUsePrivateBrowsing.js
--- a/docshell/test/unit/test_setUsePrivateBrowsing.js
+++ b/docshell/test/unit/test_setUsePrivateBrowsing.js
@@ -48,18 +48,18 @@ add_task(function*() {
     Assert.throws(() => { loadContext.usePrivateBrowsing = true; },
                   /NS_ERROR_FAILURE/,
                   "Should not be able to change private browsing state after initial load has started");
 
     oa.privateBrowsingId = 1;
     Assert.throws(() => { docShell.setOriginAttributes(oa); },
                   /NS_ERROR_FAILURE/,
                   "Should not be able to change origin attributes after initial load has started");
-  }
+
+    equal(loadContext.usePrivateBrowsing, false,
+          "Should not be able to change private browsing state after initial load has started");
 
-  equal(loadContext.usePrivateBrowsing, false,
-        "Should not be able to change private browsing state after initial load has started");
-
-  loadContext.usePrivateBrowsing = false;
-  ok(true, "Should be able to set usePrivateBrowsing to its current value even after initial load");
+    loadContext.usePrivateBrowsing = false;
+    ok(true, "Should be able to set usePrivateBrowsing to its current value even after initial load");
+  }
 
   webNav.close();
 });