Bug 1259329 - Split test up to fix intermittent timeout. r=jmaher, a=test-only
authorRob Wood <rwood@mozilla.com>
Mon, 15 Aug 2016 15:05:24 -0400
changeset 347806 16b511b4776c44c7c5ad36e60b90f0b50d520b8d
parent 347805 4008796e979af0a7ee9e99990cc4ff08023988b0
child 347807 fceb720697c7934ff1b50d4ff3a6a8b3aec736d6
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher, test-only
bugs1259329
milestone50.0a2
Bug 1259329 - Split test up to fix intermittent timeout. r=jmaher, a=test-only MozReview-Commit-ID: 5uDU6ScsDea
browser/components/sessionstore/test/browser.ini
browser/components/sessionstore/test/browser_sessionStorage.js
browser/components/sessionstore/test/browser_sessionStorage_size.js
--- a/browser/components/sessionstore/test/browser.ini
+++ b/browser/components/sessionstore/test/browser.ini
@@ -106,16 +106,17 @@ skip-if = buildapp == 'mulet'
 skip-if = e10s # Bug 1271024
 [browser_replace_load.js]
 [browser_restore_redirect.js]
 [browser_restore_cookies_noOriginAttributes.js]
 [browser_scrollPositions.js]
 [browser_scrollPositionsReaderMode.js]
 [browser_sessionHistory.js]
 [browser_sessionStorage.js]
+[browser_sessionStorage_size.js]
 [browser_swapDocShells.js]
 [browser_switch_remoteness.js]
 run-if = e10s
 [browser_upgrade_backup.js]
 [browser_windowRestore_perwindowpb.js]
 [browser_248970_b_perwindowpb.js]
 # Disabled because of leaks.
 # Re-enabling and rewriting this test is tracked in bug 936919.
--- a/browser/components/sessionstore/test/browser_sessionStorage.js
+++ b/browser/components/sessionstore/test/browser_sessionStorage.js
@@ -178,51 +178,11 @@ add_task(function respect_privacy_level(
   // With privacy_level=0 the duplicated |tab2| should persist all data.
   [{state: {storage}}] = JSON.parse(ss.getClosedTabData(window));
   is(storage["http://mochi.test:8888"].test, OUTER_VALUE,
     "http sessionStorage data has been saved");
   is(storage["https://example.com"].test, INNER_VALUE,
     "https sessionStorage data has been saved");
 });
 
-// Test that we record the size of messages.
-add_task(function* test_telemetry() {
-  Services.telemetry.canRecordExtended = true;
-  let histogram = Services.telemetry.getHistogramById("FX_SESSION_RESTORE_DOM_STORAGE_SIZE_ESTIMATE_CHARS");
-  let snap1 = histogram.snapshot();
-
-  let tab = gBrowser.addTab(URL);
-  let browser = tab.linkedBrowser;
-  yield promiseBrowserLoaded(browser);
-
-  // Flush to make sure chrome received all data.
-  yield TabStateFlusher.flush(browser);
-  let snap2 = histogram.snapshot();
-
-  Assert.ok(snap2.counts[5] > snap1.counts[5]);
-  yield promiseRemoveTab(tab);
-  Services.telemetry.canRecordExtended = false;
-});
-
-// Lower the size limit for DOM Storage content. Check that DOM Storage
-// is not updated, but that other things remain updated.
-add_task(function* test_large_content() {
-  Services.prefs.setIntPref("browser.sessionstore.dom_storage_limit", 5);
-
-  let tab = gBrowser.addTab(URL);
-  let browser = tab.linkedBrowser;
-  yield promiseBrowserLoaded(browser);
-
-  // Flush to make sure chrome received all data.
-  yield TabStateFlusher.flush(browser);
-
-  let state = JSON.parse(ss.getTabState(tab));
-  info(JSON.stringify(state, null, "\t"));
-  Assert.equal(state.storage, null, "We have no storage for the tab");
-  Assert.equal(state.entries[0].title, OUTER_VALUE);
-  yield promiseRemoveTab(tab);
-
-  Services.prefs.clearUserPref("browser.sessionstore.dom_storage_limit");
-});
-
 function purgeDomainData(browser, domain) {
   return sendMessage(browser, "ss-test:purgeDomainData", domain);
 }
new file mode 100644
--- /dev/null
+++ b/browser/components/sessionstore/test/browser_sessionStorage_size.js
@@ -0,0 +1,51 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+const RAND = Math.random();
+const URL = "http://mochi.test:8888/browser/" +
+            "browser/components/sessionstore/test/browser_sessionStorage.html" +
+            "?" + RAND;
+
+const OUTER_VALUE = "outer-value-" + RAND;
+
+// Test that we record the size of messages.
+add_task(function* test_telemetry() {
+  Services.telemetry.canRecordExtended = true;
+  let histogram = Services.telemetry.getHistogramById("FX_SESSION_RESTORE_DOM_STORAGE_SIZE_ESTIMATE_CHARS");
+  let snap1 = histogram.snapshot();
+
+  let tab = gBrowser.addTab(URL);
+  let browser = tab.linkedBrowser;
+  yield promiseBrowserLoaded(browser);
+
+  // Flush to make sure chrome received all data.
+  yield TabStateFlusher.flush(browser);
+  let snap2 = histogram.snapshot();
+
+  Assert.ok(snap2.counts[5] > snap1.counts[5]);
+  yield promiseRemoveTab(tab);
+  Services.telemetry.canRecordExtended = false;
+});
+
+// Lower the size limit for DOM Storage content. Check that DOM Storage
+// is not updated, but that other things remain updated.
+add_task(function* test_large_content() {
+  Services.prefs.setIntPref("browser.sessionstore.dom_storage_limit", 5);
+
+  let tab = gBrowser.addTab(URL);
+  let browser = tab.linkedBrowser;
+  yield promiseBrowserLoaded(browser);
+
+  // Flush to make sure chrome received all data.
+  yield TabStateFlusher.flush(browser);
+
+  let state = JSON.parse(ss.getTabState(tab));
+  info(JSON.stringify(state, null, "\t"));
+  Assert.equal(state.storage, null, "We have no storage for the tab");
+  Assert.equal(state.entries[0].title, OUTER_VALUE);
+  yield promiseRemoveTab(tab);
+
+  Services.prefs.clearUserPref("browser.sessionstore.dom_storage_limit");
+});