Bug 1314057 - Move globalactor and global method override tests. r=loganfsmyth
☠☠ backed out by f5681e1f56e6 ☠ ☠
authorDavid Walsh <dwalsh@mozilla.com>
Mon, 08 Oct 2018 12:08:05 -0500
changeset 440375 241f876d557f679b81c2aa6d73f0ec598cc49545
parent 440374 38890d8fa2542082eafe6e16dfc26b87d42ade94
child 440376 fa0d46e77437a4cb89fe0d6178d8ec7b7d933b23
push id34815
push userrgurzau@mozilla.com
push dateWed, 10 Oct 2018 04:36:49 +0000
treeherdermozilla-central@bf31de5be0dc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersloganfsmyth
bugs1314057
milestone64.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 1314057 - Move globalactor and global method override tests. r=loganfsmyth
devtools/client/debugger/new/test/mochitest/browser.ini
devtools/client/debugger/new/test/mochitest/browser_dbg_global-method-override.js
devtools/client/debugger/new/test/mochitest/examples/doc_global-method-override.html
devtools/client/debugger/test/mochitest/browser.ini
devtools/client/debugger/test/mochitest/browser2.ini
devtools/client/debugger/test/mochitest/browser_dbg_global-method-override.js
devtools/client/debugger/test/mochitest/browser_dbg_globalactor.js
devtools/client/debugger/test/mochitest/doc_global-method-override.html
devtools/client/shared/test/browser.ini
devtools/client/shared/test/browser_dbg_globalactor.js
devtools/client/shared/test/head.js
devtools/client/shared/test/testactors.js
--- a/devtools/client/debugger/new/test/mochitest/browser.ini
+++ b/devtools/client/debugger/new/test/mochitest/browser.ini
@@ -619,16 +619,17 @@ support-files =
   examples/doc-sourcemaps2.html
   examples/doc-sourcemaps3.html
   examples/doc-sourcemap-bogus.html
   examples/doc-sources.html
   examples/doc-strict.html
   examples/doc-pause-points.html
   examples/doc-return-values.html
   examples/doc-wasm-sourcemaps.html
+  examples/doc_global-method-override.html
   examples/asm.js
   examples/async.js
   examples/bogus-map.js
   examples/entry.js
   examples/exceptions.js
   examples/long.js
   examples/math.min.js
   examples/nested/nested-source.js
@@ -681,16 +682,18 @@ skip-if = (verify && !debug && (os == 'l
 skip-if = (os == "win" && ccov) # Bug 1424154
 [browser_dbg-debugger-buttons.js]
 [browser_dbg-editor-gutter.js]
 [browser_dbg-editor-select.js]
 [browser_dbg-editor-highlight.js]
 [browser_dbg-ember-quickstart.js]
 [browser_dbg-expressions.js]
 [browser_dbg-expressions-error.js]
+[browser_dbg_global-method-override.js]
+skip-if = e10s && debug
 [browser_dbg-iframes.js]
 [browser_dbg-inline-cache.js]
 [browser_dbg-keyboard-navigation.js]
 [browser_dbg-keyboard-shortcuts.js]
 skip-if = os == "linux" # bug 1351952
 [browser_dbg-layout-changes.js]
 [browser_dbg-outline.js]
 skip-if = verify
rename from devtools/client/debugger/test/mochitest/browser_dbg_global-method-override.js
rename to devtools/client/debugger/new/test/mochitest/browser_dbg_global-method-override.js
--- a/devtools/client/debugger/test/mochitest/browser_dbg_global-method-override.js
+++ b/devtools/client/debugger/new/test/mochitest/browser_dbg_global-method-override.js
@@ -1,26 +1,18 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Tests that scripts that override properties of the global object, like
- * toString don't break the debugger. The test page used to cause the debugger
+ * toString, don't break the debugger. The test page used to cause the debugger
  * to throw when trying to attach to the thread actor.
  */
 
-const TAB_URL = EXAMPLE_URL + "doc_global-method-override.html";
+"use strict";
 
-function test() {
-  let options = {
-    source: TAB_URL,
-    line: 1
-  };
-  initDebugger(TAB_URL, options).then(([aTab, aPanel]) => {
-    let gDebugger = aPanel.panelWin;
-    ok(gDebugger, "Should have a debugger available.");
-    is(gDebugger.gThreadClient.state, "attached", "Debugger should be attached.");
-
-    closeDebuggerAndFinish(aPanel);
-  });
-}
+add_task(async function() {
+  const dbg = await initDebugger("doc_global-method-override.html");
+  ok(dbg, "Should have a debugger available.");
+  is(dbg.toolbox.threadClient.state, "attached", "Debugger should be attached.");
+});
rename from devtools/client/debugger/test/mochitest/doc_global-method-override.html
rename to devtools/client/debugger/new/test/mochitest/examples/doc_global-method-override.html
--- a/devtools/client/debugger/test/mochitest/browser.ini
+++ b/devtools/client/debugger/test/mochitest/browser.ini
@@ -65,17 +65,16 @@ support-files =
   doc_empty-tab-02.html
   doc_event-listeners-01.html
   doc_event-listeners-02.html
   doc_event-listeners-03.html
   doc_frame-parameters.html
   doc_function-display-name.html
   doc_function-jump.html
   doc_function-search.html
-  doc_global-method-override.html
   doc_iframes.html
   doc_included-script.html
   doc_inline-debugger-statement.html
   doc_inline-script.html
   doc_large-array-buffer.html
   doc_listworkers-tab.html
   doc_map-set.html
   doc_minified.html
@@ -188,20 +187,16 @@ skip-if = e10s && debug
 [browser_dbg_event-listeners-01.js]
 skip-if = e10s && debug
 [browser_dbg_event-listeners-02.js]
 skip-if = e10s && debug
 [browser_dbg_event-listeners-03.js]
 skip-if = e10s && debug
 [browser_dbg_file-reload.js]
 skip-if = e10s && debug
-[browser_dbg_global-method-override.js]
-skip-if = e10s && debug
-[browser_dbg_globalactor.js]
-skip-if = e10s
 [browser_dbg_host-layout.js]
 skip-if = e10s && debug
 [browser_dbg_jump-to-function-definition.js]
 skip-if = e10s && debug
 [browser_dbg_iframes.js]
 skip-if = e10s # TODO
 [browser_dbg_interrupts.js]
 skip-if = e10s && debug
--- a/devtools/client/debugger/test/mochitest/browser2.ini
+++ b/devtools/client/debugger/test/mochitest/browser2.ini
@@ -65,17 +65,16 @@ support-files =
   doc_empty-tab-02.html
   doc_event-listeners-01.html
   doc_event-listeners-02.html
   doc_event-listeners-03.html
   doc_frame-parameters.html
   doc_function-display-name.html
   doc_function-jump.html
   doc_function-search.html
-  doc_global-method-override.html
   doc_iframes.html
   doc_included-script.html
   doc_inline-debugger-statement.html
   doc_inline-script.html
   doc_large-array-buffer.html
   doc_listworkers-tab.html
   doc_map-set.html
   doc_minified.html
--- a/devtools/client/shared/test/browser.ini
+++ b/devtools/client/shared/test/browser.ini
@@ -33,28 +33,31 @@ support-files =
   helper_html_tooltip.js
   helper_inplace_editor.js
   leakhunt.js
   shared-head.js
   shared-redux-head.js
   telemetry-test-helpers.js
   test-actor-registry.js
   test-actor.js
+  testactors.js
   !/devtools/client/responsive.html/test/browser/devices.json
 
 [browser_autocomplete_popup.js]
 [browser_css_angle.js]
 [browser_css_color.js]
 [browser_cubic-bezier-01.js]
 [browser_cubic-bezier-02.js]
 [browser_cubic-bezier-03.js]
 [browser_cubic-bezier-04.js]
 [browser_cubic-bezier-05.js]
 [browser_cubic-bezier-06.js]
 [browser_cubic-bezier-07.js]
+[browser_dbg_globalactor.js]
+skip-if = e10s
 [browser_filter-editor-01.js]
 [browser_filter-editor-02.js]
 [browser_filter-editor-03.js]
 [browser_filter-editor-04.js]
 [browser_filter-editor-05.js]
 [browser_filter-editor-06.js]
 [browser_filter-editor-07.js]
 [browser_filter-editor-08.js]
rename from devtools/client/debugger/test/mochitest/browser_dbg_globalactor.js
rename to devtools/client/shared/test/browser_dbg_globalactor.js
--- a/devtools/client/debugger/test/mochitest/browser_dbg_globalactor.js
+++ b/devtools/client/shared/test/browser_dbg_globalactor.js
@@ -2,17 +2,23 @@
 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 /**
  * Check extension-added global actor API.
  */
 
-const ACTORS_URL = CHROME_URL + "testactors.js";
+"use strict";
+
+var { DebuggerServer } = require("devtools/server/main");
+var { ActorRegistry } = require("devtools/server/actors/utils/actor-registry");
+var { DebuggerClient } = require("devtools/shared/client/debugger-client");
+
+const ACTORS_URL = EXAMPLE_URL + "testactors.js";
 
 add_task(async function() {
   DebuggerServer.init();
   DebuggerServer.registerAllActors();
 
   ActorRegistry.registerModule(ACTORS_URL, {
     prefix: "testOne",
     constructor: "TestActor1",
@@ -38,17 +44,17 @@ add_task(async function() {
   response = await client.request({ to: globalActor, type: "ping" });
   is(response.pong, "pong", "Actor should respond to requests.");
 
   // Make sure that lazily-created actors are created only once.
   let count = 0;
   for (const connID of Object.getOwnPropertyNames(DebuggerServer._connections)) {
     const conn = DebuggerServer._connections[connID];
     const actorPrefix = conn._prefix + "testOne";
-    for (let pool of conn._extraPools) {
+    for (const pool of conn._extraPools) {
       for (const actor of pool.poolChildren()) {
         if (actor.actorID.startsWith(actorPrefix)) {
           count++;
         }
       }
     }
   }
 
--- a/devtools/client/shared/test/head.js
+++ b/devtools/client/shared/test/head.js
@@ -11,16 +11,18 @@
 Services.scriptloader.loadSubScript("chrome://mochitests/content/browser/devtools/client/shared/test/shared-head.js", this);
 
 const {DOMHelpers} = ChromeUtils.import("resource://devtools/client/shared/DOMHelpers.jsm", {});
 const {Hosts} = require("devtools/client/framework/toolbox-hosts");
 
 const TEST_URI_ROOT = "http://example.com/browser/devtools/client/shared/test/";
 const OPTIONS_VIEW_URL = TEST_URI_ROOT + "doc_options-view.xul";
 
+const EXAMPLE_URL = "chrome://mochitests/content/browser/devtools/client/shared/test/";
+
 function catchFail(func) {
   return function() {
     try {
       return func.apply(null, arguments);
     } catch (ex) {
       ok(false, ex);
       console.error(ex);
       finish();
copy from devtools/client/debugger/test/mochitest/testactors.js
copy to devtools/client/shared/test/testactors.js
--- a/devtools/client/debugger/test/mochitest/testactors.js
+++ b/devtools/client/shared/test/testactors.js
@@ -1,16 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 "use strict";
 
-function TestActor1(aConnection, aTab) {
-  this.conn = aConnection;
-  this.tab = aTab;
+function TestActor1(connection, tab) {
+  this.conn = connection;
+  this.tab = tab;
 }
 
 TestActor1.prototype = {
   actorPrefix: "testOne",
 
   grip: function TA1_grip() {
     return { actor: this.actorID,
              test: "TestActor1" };