Bug 1548694 - Split the profiler page information tests to prevent intermittent timeout r=julienw
authorNazım Can Altınova <canaltinova@gmail.com>
Fri, 03 May 2019 12:43:55 +0000
changeset 542850 89664bfdb628a012b717ecee5427495f3fea528c
parent 542849 6972687fbe5a50899bc3d90439a6fe71d9bd3bc8
child 542851 235ec94b49162279d6c8101072205abe4e0647f8
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjulienw
bugs1548694
milestone69.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
Bug 1548694 - Split the profiler page information tests to prevent intermittent timeout r=julienw Differential Revision: https://phabricator.services.mozilla.com/D29812
tools/profiler/tests/browser/browser.ini
tools/profiler/tests/browser/browser_test_profile_history_page_info.js
tools/profiler/tests/browser/browser_test_profile_multi_frame_page_info.js
tools/profiler/tests/browser/browser_test_profile_page_info.js
tools/profiler/tests/browser/browser_test_profile_pushstate_page_info.js
tools/profiler/tests/browser/browser_test_profile_replacestate_page_info.js
tools/profiler/tests/browser/browser_test_profile_single_frame_page_info.js
--- a/tools/profiler/tests/browser/browser.ini
+++ b/tools/profiler/tests/browser/browser.ini
@@ -1,10 +1,12 @@
 [DEFAULT]
 support-files =
   head.js
   multi_frame.html
   single_frame.html
   single_frame_pushstate.html
   single_frame_replacestate.html
 
-[browser_test_profile_page_info.js]
-[browser_test_profile_history_page_info.js]
+[browser_test_profile_single_frame_page_info.js]
+[browser_test_profile_multi_frame_page_info.js]
+[browser_test_profile_pushstate_page_info.js]
+[browser_test_profile_replacestate_page_info.js]
new file mode 100644
--- /dev/null
+++ b/tools/profiler/tests/browser/browser_test_profile_multi_frame_page_info.js
@@ -0,0 +1,39 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+add_task(async function test_profile_single_frame_page_info() {
+  if (!AppConstants.MOZ_GECKO_PROFILER) {
+    return;
+  }
+  Assert.ok(!Services.profiler.IsActive());
+  // Clear all pages in case we have some pages registered before.
+  await Services.profiler.ClearAllPages();
+  startProfiler();
+
+  const url = BASE_URL + "single_frame.html";
+  let contentPid;
+  await BrowserTestUtils.withNewTab(url, async function(contentBrowser) {
+    contentPid = await ContentTask.spawn(contentBrowser, null, () => {
+      return Services.appinfo.processID;
+    });
+  });
+
+  const profile = await Services.profiler.getProfileDataAsync();
+  Services.profiler.StopProfiler();
+
+  let pageFound = false;
+  // We need to find the correct content process for that tab.
+  let contentProcess = profile.processes.find(p => p.threads[0].pid == contentPid);
+  for (const page of contentProcess.pages) {
+    if (page.url == url) {
+      Assert.equal(page.url, url);
+      Assert.equal(typeof page.docshellId, "string");
+      Assert.equal(typeof page.historyId, "number");
+      Assert.equal(page.isSubFrame, false);
+      pageFound = true;
+      break;
+    }
+  }
+  Assert.equal(pageFound, true);
+});
rename from tools/profiler/tests/browser/browser_test_profile_history_page_info.js
rename to tools/profiler/tests/browser/browser_test_profile_pushstate_page_info.js
--- a/tools/profiler/tests/browser/browser_test_profile_history_page_info.js
+++ b/tools/profiler/tests/browser/browser_test_profile_pushstate_page_info.js
@@ -1,13 +1,13 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-add_task(async function test_profile_single_frame_pushstate_page_info() {
+add_task(async function test_profile_pushstate_page_info() {
   if (!AppConstants.MOZ_GECKO_PROFILER) {
     return;
   }
   Assert.ok(!Services.profiler.IsActive());
   // Clear all pages in case we have some pages registered before.
   await Services.profiler.ClearAllPages();
   startProfiler();
 
@@ -42,49 +42,8 @@ add_task(async function test_profile_sin
       Assert.equal(typeof page.historyId, "number");
       Assert.equal(page.isSubFrame, false);
       foundPage++;
     }
   }
 
   Assert.equal(foundPage, 2);
 });
-
-add_task(async function test_profile_single_frame_replacestate_page_info() {
-  if (!AppConstants.MOZ_GECKO_PROFILER) {
-    return;
-  }
-  Assert.ok(!Services.profiler.IsActive());
-  // Clear all pages in case we have some pages registered before.
-  await Services.profiler.ClearAllPages();
-  startProfiler();
-
-  const url = BASE_URL + "single_frame_replacestate.html";
-  let contentPid;
-  await BrowserTestUtils.withNewTab(url, async function(contentBrowser) {
-    contentPid = await ContentTask.spawn(contentBrowser, null, () => {
-      return Services.appinfo.processID;
-    });
-  });
-
-  const profile = await Services.profiler.getProfileDataAsync();
-  Services.profiler.StopProfiler();
-
-  let foundPage = 0;
-  // We need to find the correct content process for that tab.
-  let contentProcess = profile.processes.find(p => p.threads[0].pid == contentPid);
-  for (const page of contentProcess.pages) {
-    // Before replaceState
-    if (page.url == url) {
-      Assert.equal(page.url, url);
-      Assert.equal(typeof page.docshellId, "string");
-      Assert.equal(typeof page.historyId, "number");
-      Assert.equal(page.isSubFrame, false);
-      foundPage++;
-    }
-
-    // Shoudn't record the frame on replaceState since it's not changing
-    // DocShell ID or DocShell History ID.
-    Assert.notEqual(page.url, BASE_URL + "single_frame.html");
-  }
-
-  Assert.equal(foundPage, 1);
-});
new file mode 100644
--- /dev/null
+++ b/tools/profiler/tests/browser/browser_test_profile_replacestate_page_info.js
@@ -0,0 +1,44 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+add_task(async function test_profile_replacestate_page_info() {
+  if (!AppConstants.MOZ_GECKO_PROFILER) {
+    return;
+  }
+  Assert.ok(!Services.profiler.IsActive());
+  // Clear all pages in case we have some pages registered before.
+  await Services.profiler.ClearAllPages();
+  startProfiler();
+
+  const url = BASE_URL + "single_frame_replacestate.html";
+  let contentPid;
+  await BrowserTestUtils.withNewTab(url, async function(contentBrowser) {
+    contentPid = await ContentTask.spawn(contentBrowser, null, () => {
+      return Services.appinfo.processID;
+    });
+  });
+
+  const profile = await Services.profiler.getProfileDataAsync();
+  Services.profiler.StopProfiler();
+
+  let foundPage = 0;
+  // We need to find the correct content process for that tab.
+  let contentProcess = profile.processes.find(p => p.threads[0].pid == contentPid);
+  for (const page of contentProcess.pages) {
+    // Before replaceState
+    if (page.url == url) {
+      Assert.equal(page.url, url);
+      Assert.equal(typeof page.docshellId, "string");
+      Assert.equal(typeof page.historyId, "number");
+      Assert.equal(page.isSubFrame, false);
+      foundPage++;
+    }
+
+    // Shoudn't record the frame on replaceState since it's not changing
+    // DocShell ID or DocShell History ID.
+    Assert.notEqual(page.url, BASE_URL + "single_frame.html");
+  }
+
+  Assert.equal(foundPage, 1);
+});
rename from tools/profiler/tests/browser/browser_test_profile_page_info.js
rename to tools/profiler/tests/browser/browser_test_profile_single_frame_page_info.js
--- a/tools/profiler/tests/browser/browser_test_profile_page_info.js
+++ b/tools/profiler/tests/browser/browser_test_profile_single_frame_page_info.js
@@ -1,48 +1,12 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-add_task(async function test_profile_single_frame_page_info() {
-  if (!AppConstants.MOZ_GECKO_PROFILER) {
-    return;
-  }
-  Assert.ok(!Services.profiler.IsActive());
-  // Clear all pages in case we have some pages registered before.
-  await Services.profiler.ClearAllPages();
-  startProfiler();
-
-  const url = BASE_URL + "single_frame.html";
-  let contentPid;
-  await BrowserTestUtils.withNewTab(url, async function(contentBrowser) {
-    contentPid = await ContentTask.spawn(contentBrowser, null, () => {
-      return Services.appinfo.processID;
-    });
-  });
-
-  const profile = await Services.profiler.getProfileDataAsync();
-  Services.profiler.StopProfiler();
-
-  let pageFound = false;
-  // We need to find the correct content process for that tab.
-  let contentProcess = profile.processes.find(p => p.threads[0].pid == contentPid);
-  for (const page of contentProcess.pages) {
-    if (page.url == url) {
-      Assert.equal(page.url, url);
-      Assert.equal(typeof page.docshellId, "string");
-      Assert.equal(typeof page.historyId, "number");
-      Assert.equal(page.isSubFrame, false);
-      pageFound = true;
-      break;
-    }
-  }
-  Assert.equal(pageFound, true);
-});
-
 add_task(async function test_profile_multi_frame_page_info() {
   if (!AppConstants.MOZ_GECKO_PROFILER) {
     return;
   }
   Assert.ok(!Services.profiler.IsActive());
   // Clear all pages in case we have some pages registered before.
   await Services.profiler.ClearAllPages();
   startProfiler();