From 0515563c38d4e69b5b068d05629f72f2f1011ecb Mon Sep 17 00:00:00 2001 From: Michael Layzell Date: Mon, 13 Feb 2017 13:52:31 -0500 Subject: [PATCH] Bug 1339153 - Part 2: Add a test to ensure that view-source pages are not loaded as though they have a Large-Allocation header, r=smaug MozReview-Commit-ID: CDYNC6UDScJ --- dom/tests/browser/helper_largeAllocation.js | 30 +++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/dom/tests/browser/helper_largeAllocation.js b/dom/tests/browser/helper_largeAllocation.js index fc0ac532f7f6..789dc88af44c 100644 --- a/dom/tests/browser/helper_largeAllocation.js +++ b/dom/tests/browser/helper_largeAllocation.js @@ -391,8 +391,34 @@ function* largeAllocSuccessTests() { }); }); - // XXX: Make sure to reset dom.ipc.processCount.webLargeAllocation if adding a - // test after the above test. + // XXX: Important - reset the process count, as it was set to 1 by the + // previous test. + yield SpecialPowers.pushPrefEnv({ + set: [["dom.ipc.processCount.webLargeAllocation", 20]], + }); + + // view-source tabs should not be considered to be in a large-allocation process. + yield BrowserTestUtils.withNewTab("about:blank", function*(aBrowser) { + info("Starting test 8"); + let pid1 = yield getPID(aBrowser); + is(false, yield getInLAProc(aBrowser)); + + // Fail the test if we create a process + let stopExpectNoProcess = expectNoProcess(); + + yield ContentTask.spawn(aBrowser, null, () => { + content.document.location = "view-source:http://example.com"; + }); + + yield BrowserTestUtils.browserLoaded(aBrowser); + + let pid2 = yield getPID(aBrowser); + + is(pid1, pid2, "The PID should not have changed"); + is(false, yield getInLAProc(aBrowser)); + + stopExpectNoProcess(); + }); } function* largeAllocFailTests() {