Bug 1448501 - Remove unsafe CPOWs in DevTools server tests r=jryans
authorOriol Brufau <oriol-bugzilla@hotmail.com>
Fri, 23 Mar 2018 23:44:10 +0100
changeset 466064 a00793cc659e39f65087ecbb9df039c1da0443e1
parent 466063 e811edda21f3bcb3bc564e85f9f91fda8e318a7a
child 466065 8ed8a858c152561a6705bf9faf4c6d517049ed53
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjryans
bugs1448501
milestone61.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 1448501 - Remove unsafe CPOWs in DevTools server tests r=jryans MozReview-Commit-ID: 9uQGoj4LI8h
devtools/server/tests/browser/browser.ini
devtools/server/tests/browser/browser_markers-docloading-01.js
devtools/server/tests/browser/browser_markers-docloading-02.js
devtools/server/tests/browser/browser_markers-docloading-03.js
--- a/devtools/server/tests/browser/browser.ini
+++ b/devtools/server/tests/browser/browser.ini
@@ -59,21 +59,18 @@ skip-if = e10s # Bug 1183605 - devtools/
 [browser_canvasframe_helper_05.js]
 skip-if = e10s # Bug 1183605 - devtools/server/tests/browser/ tests are still disabled in E10S
 [browser_canvasframe_helper_06.js]
 skip-if = e10s # Bug 1183605 - devtools/server/tests/browser/ tests are still disabled in E10S
 [browser_layout_getGrids.js]
 [browser_layout_simple.js]
 [browser_markers-cycle-collection.js]
 [browser_markers-docloading-01.js]
-uses-unsafe-cpows = true
 [browser_markers-docloading-02.js]
-uses-unsafe-cpows = true
 [browser_markers-docloading-03.js]
-uses-unsafe-cpows = true
 [browser_markers-gc.js]
 [browser_markers-minor-gc.js]
 [browser_markers-parse-html.js]
 [browser_markers-styles.js]
 [browser_markers-timestamp.js]
 [browser_navigateEvents.js]
 skip-if = e10s # Bug 1183605 - devtools/server/tests/browser/ tests are still disabled in E10S
 [browser_perf-01.js]
--- a/devtools/server/tests/browser/browser_markers-docloading-01.js
+++ b/devtools/server/tests/browser/browser_markers-docloading-01.js
@@ -6,29 +6,30 @@
  */
 "use strict";
 
 const { TimelineFront } = require("devtools/shared/fronts/timeline");
 const MARKER_NAMES = ["document::DOMContentLoaded", "document::Load"];
 
 add_task(async function() {
   let browser = await addTab(MAIN_DOMAIN + "doc_innerHTML.html");
-  let doc = browser.contentDocumentAsCPOW;
 
   initDebuggerServer();
   let client = new DebuggerClient(DebuggerServer.connectPipe());
   let form = await connectDebuggerClient(client);
   let front = TimelineFront(client, form);
   let rec = await front.start({ withMarkers: true });
 
   front.once("doc-loading", e => {
     ok(false, "Should not be emitting doc-loading events.");
   });
 
-  executeSoon(() => doc.location.reload());
+  ContentTask.spawn(browser, null, function() {
+    content.location.reload();
+  });
 
   await waitForMarkerType(front, MARKER_NAMES, () => true, e => e, "markers");
   await front.stop(rec);
 
   ok(true, "Found the required marker names.");
 
   // Wait some more time to make sure the 'doc-loading' events never get fired.
   await DevToolsUtils.waitForTime(1000);
--- a/devtools/server/tests/browser/browser_markers-docloading-02.js
+++ b/devtools/server/tests/browser/browser_markers-docloading-02.js
@@ -6,27 +6,28 @@
  */
 "use strict";
 
 const { TimelineFront } = require("devtools/shared/fronts/timeline");
 const MARKER_NAMES = ["document::DOMContentLoaded", "document::Load"];
 
 add_task(async function() {
   let browser = await addTab(MAIN_DOMAIN + "doc_innerHTML.html");
-  let doc = browser.contentDocumentAsCPOW;
 
   initDebuggerServer();
   let client = new DebuggerClient(DebuggerServer.connectPipe());
   let form = await connectDebuggerClient(client);
   let front = TimelineFront(client, form);
   let rec = await front.start({ withMarkers: true, withDocLoadingEvents: true });
 
   await new Promise(resolve => {
     front.once("doc-loading", resolve);
-    doc.location.reload();
+    ContentTask.spawn(browser, null, function() {
+      content.location.reload();
+    });
   });
 
   ok(true, "At least one doc-loading event got fired.");
 
   await waitForMarkerType(front, MARKER_NAMES, () => true, e => e, "markers");
   await front.stop(rec);
 
   ok(true, "Found the required marker names.");
--- a/devtools/server/tests/browser/browser_markers-docloading-03.js
+++ b/devtools/server/tests/browser/browser_markers-docloading-03.js
@@ -6,31 +6,32 @@
  */
 "use strict";
 
 const { TimelineFront } = require("devtools/shared/fronts/timeline");
 const MARKER_NAMES = ["document::DOMContentLoaded", "document::Load"];
 
 add_task(async function() {
   let browser = await addTab(MAIN_DOMAIN + "doc_innerHTML.html");
-  let doc = browser.contentDocumentAsCPOW;
 
   initDebuggerServer();
   let client = new DebuggerClient(DebuggerServer.connectPipe());
   let form = await connectDebuggerClient(client);
   let front = TimelineFront(client, form);
   let rec = await front.start({ withDocLoadingEvents: true });
 
   waitForMarkerType(front, MARKER_NAMES, () => true, e => e, "markers").then(e => {
     ok(false, "Should not be emitting doc-loading markers.");
   });
 
   await new Promise(resolve => {
     front.once("doc-loading", resolve);
-    doc.location.reload();
+    ContentTask.spawn(browser, null, function() {
+      content.location.reload();
+    });
   });
 
   ok(true, "At least one doc-loading event got fired.");
 
   await front.stop(rec);
 
   // Wait some more time to make sure the 'doc-loading' markers never get fired.
   await DevToolsUtils.waitForTime(1000);