Bug 1578753: Add a test for top-level target switing. r=jdescottes,ochameau
authorDaisuke Akatsuka <daisuke@birchill.co.jp>
Mon, 16 Dec 2019 10:18:07 +0000
changeset 507067 3cff413b1897dbc48924cae9435dde5015f2a68b
parent 507066 2297b54080b13fca7094c25373ecb5a4e5925e87
child 507068 0e1577031addefed6aeaa5df8a724b73edb690a0
push id36922
push userncsoregi@mozilla.com
push dateMon, 16 Dec 2019 17:21:47 +0000
treeherdermozilla-central@27d0d6cc2131 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdescottes, ochameau
bugs1578753
milestone73.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 1578753: Add a test for top-level target switing. r=jdescottes,ochameau Differential Revision: https://phabricator.services.mozilla.com/D56705
devtools/client/styleeditor/test/browser.ini
devtools/client/styleeditor/test/browser_styleeditor_fission_switch_target.js
--- a/devtools/client/styleeditor/test/browser.ini
+++ b/devtools/client/styleeditor/test/browser.ini
@@ -85,16 +85,18 @@ fail-if = fission # Got the expected num
 [browser_styleeditor_bug_851132_middle_click.js]
 [browser_styleeditor_bug_870339.js]
 [browser_styleeditor_bug_1405342_serviceworker_iframes.js]
 [browser_styleeditor_copyurl.js]
 [browser_styleeditor_enabled.js]
 [browser_styleeditor_fetch-from-netmonitor.js]
 fail-if = fission
 [browser_styleeditor_filesave.js]
+[browser_styleeditor_fission_switch_target.js]
+skip-if = true # Bug 1604126
 [browser_styleeditor_highlight-selector.js]
 [browser_styleeditor_import.js]
 [browser_styleeditor_import_rule.js]
 [browser_styleeditor_init.js]
 [browser_styleeditor_inline_friendly_names.js]
 [browser_styleeditor_loading.js]
 [browser_styleeditor_loading_with_containers.js]
 [browser_styleeditor_media_sidebar.js]
new file mode 100644
--- /dev/null
+++ b/devtools/client/styleeditor/test/browser_styleeditor_fission_switch_target.js
@@ -0,0 +1,28 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+// Test switching for the top-level target.
+
+const PARENT_PROCESS_URI = "about:robots";
+const CONTENT_PROCESS_URI = TEST_BASE_HTTPS + "simple.html";
+
+add_task(async function() {
+  await pushPref("devtools.target-switching.enabled", true);
+
+  // We use about:robots, because this page will run in the parent process.
+  // Navigating from about:robots to a regular content page will always trigger a target
+  // switch, with or without fission.
+
+  info("Open a page that runs in the parent process");
+  const { toolbox, ui } = await openStyleEditorForURL(PARENT_PROCESS_URI);
+  is(ui.editors.length, 3, `Three style sheets for ${PARENT_PROCESS_URI}`);
+
+  info("Navigate to a page that runs in the child process");
+  await navigateToAndWaitForStyleSheets(CONTENT_PROCESS_URI, ui);
+  is(ui.editors.length, 2, `Two sheets present for ${CONTENT_PROCESS_URI}`);
+
+  const onToolboxDestroyed = gDevTools.once("toolbox-destroyed");
+  toolbox.closeToolbox();
+  await onToolboxDestroyed;
+});