Bug 1469075 - Part 4: Add test with secondary toolbox. r=jdescottes

Depends on D5121

Differential Revision: https://phabricator.services.mozilla.com/D5238

--HG--
extra : rebase_source : 45c5e9127ef57fe5945cdf0816017d1a79fd206b
This commit is contained in:
Daisuke Akatsuka 2018-09-07 16:39:55 +09:00
parent bf4797d7e3
commit b9e06e32e5
2 changed files with 36 additions and 0 deletions

View File

@ -127,6 +127,7 @@ run-if = e10s
[browser_toolbox_toolbar_reorder_by_width.js]
[browser_toolbox_toolbar_reorder_with_extension.js]
[browser_toolbox_toolbar_reorder_with_hidden_extension.js]
[browser_toolbox_toolbar_reorder_with_secondary_toolbox.js]
[browser_toolbox_tools_per_toolbox_registration.js]
[browser_toolbox_view_source_01.js]
[browser_toolbox_view_source_02.js]

View File

@ -0,0 +1,35 @@
/* -*- 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/ */
"use strict";
// Test for reordering with secondary toolbox such as Browser Content Toolbox.
// We test whether the ordering preference will not change when the secondary toolbox
// was closed without reordering.
const { gDevToolsBrowser } = require("devtools/client/framework/devtools-browser");
add_task(async function() {
registerCleanupFunction(() => {
Services.prefs.clearUserPref("devtools.toolbox.selectedTool");
});
// Keep initial tabs order preference of devtools so as to compare after re-ordering
// tabs on browser content toolbox.
const initialTabsOrderOnDevTools = Services.prefs.getCharPref("devtools.toolbox.tabsOrder");
info("Prepare the toolbox on browser content toolbox");
await addTab(`${ URL_ROOT }doc_empty-tab-01.html`);
// Select "memory" tool from first, because the webconsole might connect to the content.
Services.prefs.setCharPref("devtools.toolbox.selectedTool", "memory");
const toolbox = await gDevToolsBrowser.openContentProcessToolbox(gBrowser);
info("Check whether the value of devtools.toolbox.tabsOrder was not affected after closed");
const onToolboxDestroyed = toolbox.once("destroyed");
toolbox.win.top.close();
await onToolboxDestroyed;
is(Services.prefs.getCharPref("devtools.toolbox.tabsOrder"), initialTabsOrderOnDevTools,
"The preference of devtools.toolbox.tabsOrder should not be affected");
});