diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /devtools/client/aboutdebugging/test | |
parent | Initial commit. (diff) | |
download | firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/aboutdebugging/test')
132 files changed, 13812 insertions, 0 deletions
diff --git a/devtools/client/aboutdebugging/test/browser/.eslintrc.js b/devtools/client/aboutdebugging/test/browser/.eslintrc.js new file mode 100644 index 0000000000..4ed1ebf667 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/.eslintrc.js @@ -0,0 +1,10 @@ +/* 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/. */ + +"use strict"; + +module.exports = { + // Extend from the shared list of defined globals for mochitests. + extends: "../../../../.eslintrc.mochitests.js", +}; diff --git a/devtools/client/aboutdebugging/test/browser/browser.ini b/devtools/client/aboutdebugging/test/browser/browser.ini new file mode 100644 index 0000000000..1da038eb96 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser.ini @@ -0,0 +1,130 @@ +[DEFAULT] +tags = devtools +subsuite = devtools +prefs = + # showHiddenAddons has different values depending on the build flags, ensure consistent + # test behavior by always setting it to false. + devtools.aboutdebugging.showHiddenAddons=false +support-files = + empty.html + head.js + helper-adb.js + helper-addons.js + helper-collapsibilities.js + helper-mocks.js + helper-real-usb.js + helper-serviceworker.js + helper-telemetry.js + mocks/* + resources/bad-extensions/* + resources/packaged-extension/* + resources/service-workers/* + resources/test-adb-extension/* + resources/test-temporary-extension/* + test-tab-favicons.html + !/devtools/client/shared/test/shared-head.js + !/devtools/client/shared/test/shared-redux-head.js + !/devtools/client/shared/test/telemetry-test-helpers.js + +[browser_aboutdebugging_addons_debug_console.js] +tags = webextensions +[browser_aboutdebugging_addons_debug_debugger.js] +tags = webextensions +[browser_aboutdebugging_addons_debug_inspector.js] +tags = webextensions +[browser_aboutdebugging_addons_debug_nobg.js] +tags = webextensions +[browser_aboutdebugging_addons_debug_popup.js] +skip-if = (verify && debug) || (debug && os == "linux" && bits == 64) # verify: crashes on shutdown, timeouts linux debug Bug 1299001 +tags = webextensions +[browser_aboutdebugging_addons_manifest_url.js] +skip-if = (os == 'linux' && bits == 32) || (os == 'mac' && debug) # ADB start() fails on linux 32, see Bug 1499638, macosx1014 debug due to 1514751 +[browser_aboutdebugging_addons_remote_runtime.js] +[browser_aboutdebugging_addons_temporary_addon_buttons.js] +skip-if = (os == 'win') # On windows the AddonManager locks the XPI file loaded as a temporary extension and we can not test the reload of the extension. +[browser_aboutdebugging_addons_temporary_id_message.js] +[browser_aboutdebugging_addons_temporary_install_error.js] +[browser_aboutdebugging_addons_temporary_install_path.js] +[browser_aboutdebugging_addons_temporary_reload_error.js] +skip-if = (os == 'win') # On windows the AddonManager locks the XPI file loaded as a temporary extension and we can not test the reload of the extension. +[browser_aboutdebugging_addons_warnings.js] +[browser_aboutdebugging_connect_networklocations.js] +[browser_aboutdebugging_connect_toggle_usb_devices.js] +skip-if = (os == 'linux' && bits == 32) # ADB start() fails on linux 32, see Bug 1499638 +[browser_aboutdebugging_connection_prompt_setting.js] +[browser_aboutdebugging_debug-target-pane_collapsibilities_interaction.js] +[browser_aboutdebugging_debug-target-pane_collapsibilities_preference.js] +[browser_aboutdebugging_debug-target-pane_empty.js] +[browser_aboutdebugging_debug-target-pane_usb_runtime.js] +[browser_aboutdebugging_devtools.js] +[browser_aboutdebugging_devtoolstoolbox_contextmenu.js] +[browser_aboutdebugging_devtoolstoolbox_contextmenu_markupview.js] +[browser_aboutdebugging_devtoolstoolbox_focus.js] +[browser_aboutdebugging_devtoolstoolbox_menubar.js] +[browser_aboutdebugging_devtoolstoolbox_navigate_back_forward.js] +[browser_aboutdebugging_devtoolstoolbox_navigate_reload_button.js] +[browser_aboutdebugging_devtoolstoolbox_navigate_to_url.js] +[browser_aboutdebugging_devtoolstoolbox_performance.js] +skip-if = os == 'linux' && e10s && (asan || tsan || debug) # Same skip-if as old perf panel test suite. Bug 1254821 +[browser_aboutdebugging_devtoolstoolbox_reload.js] +skip-if = verify || ccov || (os == 'linux' && debug) #bug 1544828, test loads the toolbox 2 times for each panel, might timeout or OOM +[browser_aboutdebugging_devtoolstoolbox_shortcuts.js] +skip-if = ccov || (os == 'linux' && bits == 64) # Bug 1521349, Bug 1548015, Bug 1544828 +[browser_aboutdebugging_devtoolstoolbox_splitconsole_key.js] +[browser_aboutdebugging_devtoolstoolbox_target_destroyed.js] +skip-if = debug || asan # This test leaks. See bug 1529005 +[browser_aboutdebugging_devtoolstoolbox_tooltip_markupview.js] +[browser_aboutdebugging_fenix_runtime_display.js] +[browser_aboutdebugging_message_close.js] +[browser_aboutdebugging_navigate.js] +[browser_aboutdebugging_persist_connection.js] +[browser_aboutdebugging_process_category.js] +[browser_aboutdebugging_process_main.js] +[browser_aboutdebugging_process_main_local.js] +skip-if = debug +[browser_aboutdebugging_profiler_dialog.js] +[browser_aboutdebugging_real_usb_runtime_page_runtime_info.js] +[browser_aboutdebugging_real_usb_sidebar.js] +[browser_aboutdebugging_routes.js] +[browser_aboutdebugging_runtime_compatibility_warning.js] +[browser_aboutdebugging_runtime_disconnect_remote_runtime.js] +[browser_aboutdebugging_runtime_remote_runtime_buttons.js] +[browser_aboutdebugging_runtime_usbclient_closed.js] +[browser_aboutdebugging_select_network_runtime.js] +[browser_aboutdebugging_select_page_with_serviceworker.js] +[browser_aboutdebugging_serviceworker_fetch_flag.js] +skip-if = debug && (os == "win") || (os == "mac") || (os == "linux" && bits == 64) #Bug 1529824 +[browser_aboutdebugging_serviceworker_not_compatible.js] +[browser_aboutdebugging_serviceworker_push.js] +[browser_aboutdebugging_serviceworker_pushservice_url.js] +[browser_aboutdebugging_serviceworker_runtime-page.js] +[browser_aboutdebugging_serviceworker_start.js] +[browser_aboutdebugging_serviceworker_status.js] +[browser_aboutdebugging_serviceworker_timeout.js] +skip-if = debug || asan # Frequent intermittent failures, Bug 1522800 +[browser_aboutdebugging_serviceworker_unregister.js] +[browser_aboutdebugging_sidebar_connection_state.js] +[browser_aboutdebugging_sidebar_network_runtimes.js] +[browser_aboutdebugging_sidebar_usb_runtime.js] +[browser_aboutdebugging_sidebar_usb_runtime_connect.js] +[browser_aboutdebugging_sidebar_usb_runtime_refresh.js] +[browser_aboutdebugging_sidebar_usb_runtime_select.js] +[browser_aboutdebugging_sidebar_usb_status.js] +[browser_aboutdebugging_sidebar_usb_unavailable_runtime.js] +[browser_aboutdebugging_sidebar_usb_unplugged_device.js] +[browser_aboutdebugging_hidden_addons.js] +[browser_aboutdebugging_tab_favicons.js] +[browser_aboutdebugging_tab_zombietab.js] +[browser_aboutdebugging_telemetry_basic.js] +[browser_aboutdebugging_telemetry_connection_attempt.js] +[browser_aboutdebugging_telemetry_inspect.js] +[browser_aboutdebugging_telemetry_navigate.js] +[browser_aboutdebugging_telemetry_runtime_actions.js] +[browser_aboutdebugging_telemetry_runtime_connected_details.js] +[browser_aboutdebugging_telemetry_runtime_updates.js] +[browser_aboutdebugging_telemetry_runtime_updates_multi.js] +[browser_aboutdebugging_telemetry_runtime_updates_network.js] +[browser_aboutdebugging_thisfirefox.js] +[browser_aboutdebugging_thisfirefox_runtime_info.js] +[browser_aboutdebugging_thisfirefox_worker_inspection.js] +[browser_aboutdebugging_workers_remote_runtime.js] diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_console.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_console.js new file mode 100644 index 0000000000..cc3daa3a7d --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_console.js @@ -0,0 +1,74 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ +"use strict"; + +/* import-globals-from helper-addons.js */ +Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this); + +// There are shutdown issues for which multiple rejections are left uncaught. +// See bug 1018184 for resolving these issues. +const { PromiseTestUtils } = ChromeUtils.import( + "resource://testing-common/PromiseTestUtils.jsm" +); +PromiseTestUtils.allowMatchingRejectionsGlobally(/File closed/); + +// Avoid test timeouts that can occur while waiting for the "addon-console-works" message. +requestLongerTimeout(2); + +const ADDON_ID = "test-devtools-webextension@mozilla.org"; +const ADDON_NAME = "test-devtools-webextension"; + +/** + * This test file ensures that the webextension addon developer toolbox: + * - when the debug button is clicked on a webextension, the opened toolbox + * has a working webconsole with the background page as default target; + */ +add_task(async function testWebExtensionsToolboxWebConsole() { + await enableExtensionDebugging(); + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + await installTemporaryExtensionFromXPI( + { + background: function() { + window.myWebExtensionAddonFunction = function() { + console.log( + "Background page function called", + this.browser.runtime.getManifest() + ); + }; + }, + id: ADDON_ID, + name: ADDON_NAME, + }, + document + ); + + const { devtoolsTab, devtoolsWindow } = await openAboutDevtoolsToolbox( + document, + tab, + window, + ADDON_NAME + ); + const toolbox = getToolbox(devtoolsWindow); + + const webconsole = await toolbox.selectTool("webconsole"); + const { hud } = webconsole; + const onMessage = waitUntil(() => { + return findMessages(hud, "Background page function called").length > 0; + }); + hud.ui.wrapper.dispatchEvaluateExpression("myWebExtensionAddonFunction()"); + await onMessage; + + await closeAboutDevtoolsToolbox(document, devtoolsTab, window); + await removeTemporaryExtension(ADDON_NAME, document); + await removeTab(tab); +}); + +function findMessages(hud, text, selector = ".message") { + const messages = hud.ui.outputNode.querySelectorAll(selector); + const elements = Array.prototype.filter.call(messages, el => + el.textContent.includes(text) + ); + return elements; +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_debugger.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_debugger.js new file mode 100644 index 0000000000..ae85b0f250 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_debugger.js @@ -0,0 +1,65 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ +"use strict"; + +/* import-globals-from helper-addons.js */ +Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this); + +add_task(async () => { + const EXTENSION_NAME = "temporary-web-extension"; + const EXTENSION_ID = "test-devtools@mozilla.org"; + + await enableExtensionDebugging(); + + info( + "The debugger should show the source codes of extension even if " + + "devtools.chrome.enabled and devtools.debugger.remote-enabled are off" + ); + await pushPref("devtools.chrome.enabled", false); + await pushPref("devtools.debugger.remote-enabled", false); + + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + await installTemporaryExtensionFromXPI( + { + background: function() { + window.someRandomMethodName = () => { + // This will not be referred from anywhere. + // However this is necessary to show as the source code in the debugger. + }; + }, + id: EXTENSION_ID, + name: EXTENSION_NAME, + }, + document + ); + + const { devtoolsTab, devtoolsWindow } = await openAboutDevtoolsToolbox( + document, + tab, + window, + EXTENSION_NAME + ); + const toolbox = getToolbox(devtoolsWindow); + await toolbox.selectTool("jsdebugger"); + const { panelWin } = toolbox.getCurrentPanel(); + + info("Check the state of redux"); + ok( + panelWin.dbg.store.getState().threads.isWebExtension, + "isWebExtension flag in threads is true" + ); + + info("Check whether the element displays correctly"); + const sourceList = panelWin.document.querySelector(".sources-list"); + ok(sourceList, "Source list element displays correctly"); + ok( + sourceList.textContent.includes("temporary-web-extension"), + "Extension name displays correctly" + ); + + await closeAboutDevtoolsToolbox(document, devtoolsTab, window); + await removeTemporaryExtension(EXTENSION_NAME, document); + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_inspector.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_inspector.js new file mode 100644 index 0000000000..eb901bc363 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_inspector.js @@ -0,0 +1,70 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ +"use strict"; + +/* import-globals-from helper-addons.js */ +Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this); + +// There are shutdown issues for which multiple rejections are left uncaught. +// See bug 1018184 for resolving these issues. +const { PromiseTestUtils } = ChromeUtils.import( + "resource://testing-common/PromiseTestUtils.jsm" +); +PromiseTestUtils.allowMatchingRejectionsGlobally(/File closed/); + +// Avoid test timeouts that can occur while waiting for the "addon-console-works" message. +requestLongerTimeout(2); + +const ADDON_ID = "test-devtools-webextension@mozilla.org"; +const ADDON_NAME = "test-devtools-webextension"; + +/** + * This test file ensures that the webextension addon developer toolbox: + * - the webextension developer toolbox has a working Inspector panel, with the + * background page as default target; + */ +add_task(async function testWebExtensionsToolboxWebConsole() { + await enableExtensionDebugging(); + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + await installTemporaryExtensionFromXPI( + { + background: function() { + document.body.innerText = "Background Page Body Test Content"; + }, + id: ADDON_ID, + name: ADDON_NAME, + }, + document + ); + + info("Open a toolbox to debug the addon"); + const { devtoolsTab, devtoolsWindow } = await openAboutDevtoolsToolbox( + document, + tab, + window, + ADDON_NAME + ); + const toolbox = getToolbox(devtoolsWindow); + + const inspector = await toolbox.selectTool("inspector"); + const nodeActor = await inspector.walker.querySelector( + inspector.walker.rootNode, + "body" + ); + ok(nodeActor, "Got a nodeActor"); + ok(nodeActor.inlineTextChild, "Got a nodeActor with an inline text child"); + + const actualValue = nodeActor.inlineTextChild._form.nodeValue; + + is( + String(actualValue).trim(), + "Background Page Body Test Content", + "nodeActor has the expected inlineTextChild value" + ); + + await closeAboutDevtoolsToolbox(document, devtoolsTab, window); + await removeTemporaryExtension(ADDON_NAME, document); + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_nobg.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_nobg.js new file mode 100644 index 0000000000..6508031df4 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_nobg.js @@ -0,0 +1,76 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ +"use strict"; + +/* import-globals-from helper-addons.js */ +Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this); + +// There are shutdown issues for which multiple rejections are left uncaught. +// See bug 1018184 for resolving these issues. +const { PromiseTestUtils } = ChromeUtils.import( + "resource://testing-common/PromiseTestUtils.jsm" +); +PromiseTestUtils.allowMatchingRejectionsGlobally(/File closed/); + +const ADDON_NOBG_ID = "test-devtools-webextension-nobg@mozilla.org"; +const ADDON_NOBG_NAME = "test-devtools-webextension-nobg"; + +/** + * This test file ensures that the webextension addon developer toolbox: + * - the webextension developer toolbox is connected to a fallback page when the + * background page is not available (and in the fallback page document body contains + * the expected message, which warns the user that the current page is not a real + * webextension context); + */ +add_task(async function testWebExtensionsToolboxNoBackgroundPage() { + await enableExtensionDebugging(); + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + await installTemporaryExtensionFromXPI( + { + // Do not pass any `background` script. + id: ADDON_NOBG_ID, + name: ADDON_NOBG_NAME, + }, + document + ); + + info("Open a toolbox to debug the addon"); + const { devtoolsTab, devtoolsWindow } = await openAboutDevtoolsToolbox( + document, + tab, + window, + ADDON_NOBG_NAME + ); + const toolbox = getToolbox(devtoolsWindow); + + const targetName = toolbox.target.name; + const isAddonTarget = toolbox.target.isAddon; + ok(isAddonTarget, "Toolbox target is an addon"); + is(targetName, ADDON_NOBG_NAME, "Toolbox has the expected target"); + + const inspector = await toolbox.selectTool("inspector"); + + let nodeActor; + info(`Wait the fallback window to be fully loaded`); + await asyncWaitUntil(async () => { + nodeActor = await inspector.walker.querySelector( + inspector.walker.rootNode, + "h1" + ); + return nodeActor && nodeActor.inlineTextChild; + }); + + info("Got a nodeActor with an inline text child"); + const actualValue = nodeActor.inlineTextChild._form.nodeValue; + is( + actualValue, + "Your addon does not have any document opened yet.", + "nodeActor has the expected inlineTextChild value" + ); + + await closeAboutDevtoolsToolbox(document, devtoolsTab, window); + await removeTemporaryExtension(ADDON_NOBG_NAME, document); + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_popup.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_popup.js new file mode 100644 index 0000000000..0e4b3cd085 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_debug_popup.js @@ -0,0 +1,261 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ +"use strict"; + +/* import-globals-from helper-addons.js */ +Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this); + +// There are shutdown issues for which multiple rejections are left uncaught. +// See bug 1018184 for resolving these issues. +const { PromiseTestUtils } = ChromeUtils.import( + "resource://testing-common/PromiseTestUtils.jsm" +); +PromiseTestUtils.allowMatchingRejectionsGlobally(/File closed/); + +// Avoid test timeouts that can occur while waiting for the "addon-console-works" message. +requestLongerTimeout(2); + +const ADDON_ID = "test-devtools-webextension@mozilla.org"; +const ADDON_NAME = "test-devtools-webextension"; + +/** + * This test file ensures that the webextension addon developer toolbox: + * - has a frame list menu and the noautohide toolbar toggle button, and they + * can be used to switch the current target to the extension popup page. + */ +add_task(async function testWebExtensionsToolboxWebConsole() { + await enableExtensionDebugging(); + + // Bug 1686922: Disable the error count button to avoid intermittent failures. + await pushPref("devtools.command-button-errorcount.enabled", false); + + is( + Services.prefs.getBoolPref("ui.popup.disable_autohide"), + false, + "disable_autohide should be initially false" + ); + + const { + document, + tab, + window: aboutDebuggingWindow, + } = await openAboutDebugging(); + await selectThisFirefoxPage( + document, + aboutDebuggingWindow.AboutDebugging.store + ); + + const extension = await installTestAddon(document); + + const onBackgroundFunctionCalled = waitForExtensionTestMessage( + extension, + "onBackgroundFunctionCalled" + ); + const onPopupPageFunctionCalled = waitForExtensionTestMessage( + extension, + "onPopupPageFunctionCalled" + ); + + info("Open a toolbox to debug the addon"); + const { devtoolsTab, devtoolsWindow } = await openAboutDevtoolsToolbox( + document, + tab, + aboutDebuggingWindow, + ADDON_NAME + ); + const toolbox = getToolbox(devtoolsWindow); + const webconsole = await toolbox.selectTool("webconsole"); + + info("Clicking the menu button to disable autohide"); + await disablePopupAutohide(toolbox); + + info("Check that console messages are evaluated in the background context"); + const consoleWrapper = webconsole.hud.ui.wrapper; + consoleWrapper.dispatchEvaluateExpression("backgroundFunction()"); + await onBackgroundFunctionCalled; + + // Find the browserAction button that will show the webextension popup. + const widgetId = ADDON_ID.toLowerCase().replace(/[^a-z0-9_-]/g, "_"); + const browserActionId = widgetId + "-browser-action"; + const browserActionEl = window.document.getElementById(browserActionId); + ok(browserActionEl, "Got the browserAction button from the browser UI"); + + // Create a promise that will resolve when popup.html appears in the list of + // frames known by the toolbox. + const popupFramePromise = new Promise(resolve => { + const listener = data => { + if (data.frames.some(({ url }) => url && url.endsWith("popup.html"))) { + toolbox.target.off("frame-update", listener); + resolve(); + } + }; + toolbox.target.on("frame-update", listener); + }); + + info("Show the web extension popup"); + browserActionEl.click(); + + info("Wait until popup.html appears in the frames list menu button"); + await popupFramePromise; + + info("Clicking the frame list button"); + const btn = toolbox.doc.getElementById("command-button-frames"); + btn.click(); + + const menuList = toolbox.doc.getElementById("toolbox-frame-menu"); + const frames = Array.from(menuList.querySelectorAll(".command")); + is(frames.length, 2, "Has the expected number of frames"); + + const popupFrameBtn = frames + .filter(frame => { + return frame.querySelector(".label").textContent.endsWith("popup.html"); + }) + .pop(); + + ok(popupFrameBtn, "Extension Popup frame found in the listed frames"); + + info("Click on the extension popup frame and wait for `navigate`"); + const waitForNavigated = toolbox.target.once("navigate"); + popupFrameBtn.click(); + await waitForNavigated; + + info("Execute `popupPageFunction()`"); + consoleWrapper.dispatchEvaluateExpression("popupPageFunction()"); + + const args = await onPopupPageFunctionCalled; + ok(true, "Received console message from the popup page function as expected"); + is(args[0], "onPopupPageFunctionCalled", "Got the expected console message"); + is( + args[1] && args[1].name, + ADDON_NAME, + "Got the expected manifest from WebExtension API" + ); + + await closeAboutDevtoolsToolbox(document, devtoolsTab, aboutDebuggingWindow); + + is( + Services.prefs.getBoolPref("ui.popup.disable_autohide"), + false, + "disable_autohide should be reset to false when the toolbox is closed" + ); + + await removeTemporaryExtension(ADDON_NAME, document); + await removeTab(tab); +}); + +/** + * Helper to wait for a specific message on an Extension instance. + */ +function waitForExtensionTestMessage(extension, expectedMessage) { + return new Promise(done => { + extension.on("test-message", function testLogListener(evt, ...args) { + const [message] = args; + + if (message !== expectedMessage) { + return; + } + + extension.off("test-message", testLogListener); + done(args); + }); + }); +} + +/** + * Install the addon used for this test. + * Returns a Promise that resolve the Extension instance that was just + * installed. + */ +async function installTestAddon(doc) { + // Start watching for the extension on the Extension Management before we + // install it. + const onExtensionReady = waitForExtension(ADDON_NAME); + + // Install the extension. + await installTemporaryExtensionFromXPI( + { + background: function() { + const { browser } = this; + window.backgroundFunction = function() { + browser.test.sendMessage("onBackgroundFunctionCalled"); + }; + }, + extraProperties: { + browser_action: { + default_title: "WebExtension Popup Debugging", + default_popup: "popup.html", + }, + }, + files: { + "popup.html": `<!DOCTYPE html> + <html> + <head> + <meta charset="utf-8"> + <script src="popup.js"></script> + </head> + <body> + Background Page Body Test Content + </body> + </html> + `, + "popup.js": function() { + const { browser } = this; + window.popupPageFunction = function() { + browser.test.sendMessage( + "onPopupPageFunctionCalled", + browser.runtime.getManifest() + ); + }; + }, + }, + id: ADDON_ID, + name: ADDON_NAME, + }, + doc + ); + + // The onExtensionReady promise will resolve the extension instance. + return onExtensionReady; +} + +/** + * Helper to retrieve the Extension instance. + */ +async function waitForExtension(addonName) { + const { Management } = ChromeUtils.import( + "resource://gre/modules/Extension.jsm", + null + ); + + return new Promise(resolve => { + Management.on("startup", function listener(event, extension) { + if (extension.name != addonName) { + return; + } + + Management.off("startup", listener); + resolve(extension); + }); + }); +} + +/** + * Disables the popup autohide feature, which is mandatory to debug webextension + * popups. + */ +function disablePopupAutohide(toolbox) { + return new Promise(resolve => { + toolbox.doc.getElementById("toolbox-meatball-menu-button").click(); + toolbox.doc.addEventListener( + "popupshown", + () => { + const menuItem = toolbox.doc.getElementById( + "toolbox-meatball-menu-noautohide" + ); + menuItem.click(); + resolve(); + }, + { once: true } + ); + }); +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_manifest_url.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_manifest_url.js new file mode 100644 index 0000000000..3f72d37a8a --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_manifest_url.js @@ -0,0 +1,73 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const { + adbAddon, +} = require("devtools/client/shared/remote-debugging/adb/adb-addon"); + +const ABD_ADDON_NAME = "ADB binary provider"; + +/* import-globals-from helper-adb.js */ +Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-adb.js", this); + +// Test that manifest URLs for addon targets show the manifest correctly in a new tab. +// This test reuses the ADB extension to be sure to have a valid manifest URL to open. +add_task(async function() { + await pushPref( + "devtools.remote.adb.extensionURL", + CHROME_URL_ROOT + "resources/test-adb-extension/adb-extension-#OS#.xpi" + ); + await checkAdbNotRunning(); + + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + const usbStatusElement = document.querySelector(".qa-sidebar-usb-status"); + + info("Install ADB"); + adbAddon.install("internal"); + await waitUntil(() => usbStatusElement.textContent.includes("USB enabled")); + await waitForAdbStart(); + + info("Wait until the debug target for ADB appears"); + await waitUntil(() => findDebugTargetByText(ABD_ADDON_NAME, document)); + const adbExtensionItem = findDebugTargetByText(ABD_ADDON_NAME, document); + + const manifestUrlElement = adbExtensionItem.querySelector(".qa-manifest-url"); + ok(manifestUrlElement, "A link to the manifest is displayed"); + + info("Click on the manifest URL and wait for the new tab to open"); + const onTabOpened = once(gBrowser.tabContainer, "TabOpen"); + manifestUrlElement.click(); + const { target } = await onTabOpened; + await BrowserTestUtils.browserLoaded(target.linkedBrowser); + + info("Retrieve the text content of the new tab"); + const textContent = await SpecialPowers.spawn( + target.linkedBrowser, + [], + function() { + return content.wrappedJSObject.document.body.textContent; + } + ); + + const manifestObject = JSON.parse(textContent); + ok(manifestObject, "The displayed content is a valid JSON object"); + is( + manifestObject.name, + ABD_ADDON_NAME, + "Manifest tab shows the expected content" + ); + + info("Close the manifest.json tab"); + await removeTab(target); + + info("Uninstall the adb extension and wait for the message to udpate"); + adbAddon.uninstall(); + await waitUntil(() => usbStatusElement.textContent.includes("USB disabled")); + await stopAdbProcess(); + + await waitForRequestsToSettle(window.AboutDebugging.store); + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_remote_runtime.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_remote_runtime.js new file mode 100644 index 0000000000..a3a3d05920 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_remote_runtime.js @@ -0,0 +1,144 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const NETWORK_RUNTIME_HOST = "localhost:6080"; +const NETWORK_RUNTIME_APP_NAME = "TestNetworkApp"; +const USB_RUNTIME_ID = "test-runtime-id"; +const USB_RUNTIME_DEVICE_NAME = "test device name"; +const USB_RUNTIME_APP_NAME = "TestUsbApp"; + +// Test that addons are displayed and updated for USB runtimes when expected. +add_task(async function() { + const mocks = new Mocks(); + + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + info("Prepare USB client mock"); + const usbClient = mocks.createUSBRuntime(USB_RUNTIME_ID, { + deviceName: USB_RUNTIME_DEVICE_NAME, + name: USB_RUNTIME_APP_NAME, + }); + mocks.emitUSBUpdate(); + + info("Test addons in runtime page for USB client"); + await connectToRuntime(USB_RUNTIME_DEVICE_NAME, document); + await selectRuntime(USB_RUNTIME_DEVICE_NAME, USB_RUNTIME_APP_NAME, document); + await testAddonsOnMockedRemoteClient( + usbClient, + mocks.thisFirefoxClient, + document + ); + + info("Prepare Network client mock"); + const networkClient = mocks.createNetworkRuntime(NETWORK_RUNTIME_HOST, { + name: NETWORK_RUNTIME_APP_NAME, + }); + + info("Test addons in runtime page for Network client"); + await connectToRuntime(NETWORK_RUNTIME_HOST, document); + await selectRuntime(NETWORK_RUNTIME_HOST, NETWORK_RUNTIME_APP_NAME, document); + await testAddonsOnMockedRemoteClient( + networkClient, + mocks.thisFirefoxClient, + document + ); + + await removeTab(tab); +}); + +/** + * Check that addons are visible in the runtime page for a remote client (USB or network). + */ +async function testAddonsOnMockedRemoteClient( + remoteClient, + firefoxClient, + document +) { + const extensionPane = getDebugTargetPane("Extensions", document); + info("Check an empty target pane message is displayed"); + ok( + extensionPane.querySelector(".qa-debug-target-list-empty"), + "Extensions list is empty" + ); + + info("Add an extension to the remote client"); + const addon = { name: "Test extension name", debuggable: true }; + const temporaryAddon = { + name: "Test temporary extension", + debuggable: true, + temporarilyInstalled: true, + }; + remoteClient.listAddons = () => [addon, temporaryAddon]; + remoteClient._eventEmitter.emit("addonListChanged"); + + info("Wait until the extension appears"); + await waitUntil( + () => !extensionPane.querySelector(".qa-debug-target-list-empty") + ); + + const extensionTarget = findDebugTargetByText( + "Test extension name", + document + ); + ok(extensionTarget, "Extension target appeared for the remote runtime"); + + const temporaryExtensionTarget = findDebugTargetByText( + "Test temporary extension", + document + ); + ok( + temporaryExtensionTarget, + "Temporary Extension target appeared for the remote runtime" + ); + + const removeButton = temporaryExtensionTarget.querySelector( + ".qa-temporary-extension-remove-button" + ); + const reloadButton = temporaryExtensionTarget.querySelector( + ".qa-temporary-extension-reload-button" + ); + ok(!removeButton, "No remove button expected for the temporary extension"); + ok(!reloadButton, "No reload button expected for the temporary extension"); + + // The goal here is to check that runtimes addons are only updated when the remote + // runtime is sending addonListChanged events. The reason for this test is because the + // previous implementation was updating the remote runtime extensions list when the + // _local_ AddonManager was updated. + info("Remove the extension from the remote client WITHOUT sending an event"); + remoteClient.listAddons = () => []; + + info("Simulate an addon update on the ThisFirefox client"); + firefoxClient._eventEmitter.emit("addonListChanged"); + + // To avoid wait for a set period of time we trigger another async update, adding a new + // tab. We assume that if the addon update mechanism had started, it would also be done + // when the new tab was processed. + info("Wait until the tab target for 'http://some.random/url.com' appears"); + const testTab = { + retrieveFavicon: () => {}, + outerWindowID: 0, + traits: {}, + url: "http://some.random/url.com", + }; + remoteClient.listTabs = () => [testTab]; + remoteClient._eventEmitter.emit("tabListChanged"); + await waitUntil(() => + findDebugTargetByText("http://some.random/url.com", document) + ); + + ok( + findDebugTargetByText("Test extension name", document), + "The test extension is still visible" + ); + + info( + "Emit `addonListChanged` on remoteClient and wait for the target list to update" + ); + remoteClient._eventEmitter.emit("addonListChanged"); + await waitUntil( + () => !findDebugTargetByText("Test extension name", document) + ); +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_addon_buttons.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_addon_buttons.js new file mode 100644 index 0000000000..9d46452ad8 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_addon_buttons.js @@ -0,0 +1,116 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ +"use strict"; + +/* import-globals-from helper-addons.js */ +Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this); + +// Test that the reload button updates the addon list with the correct metadata. +add_task(async function() { + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + const ORIGINAL_EXTENSION_NAME = "Temporary web extension (original)"; + const UPDATED_EXTENSION_NAME = "Temporary web extension (updated)"; + const EXTENSION_ID = "test-devtools@mozilla.org"; + + const addonFile = await installTemporaryExtensionFromXPI( + { + id: EXTENSION_ID, + name: ORIGINAL_EXTENSION_NAME, + }, + document + ); + + const originalTarget = findDebugTargetByText( + ORIGINAL_EXTENSION_NAME, + document + ); + ok( + !!originalTarget, + "The temporary extension isinstalled with the expected name" + ); + + info("Update the name of the temporary extension in the manifest"); + updateTemporaryXPI( + { id: EXTENSION_ID, name: UPDATED_EXTENSION_NAME }, + addonFile + ); + + info("Click on the reload button for the temporary extension"); + const reloadButton = originalTarget.querySelector( + ".qa-temporary-extension-reload-button" + ); + reloadButton.click(); + + info( + "Wait until the debug target with the original extension name disappears" + ); + await waitUntil( + () => !findDebugTargetByText(ORIGINAL_EXTENSION_NAME, document) + ); + + info("Wait until the debug target with the updated extension name appears"); + await waitUntil(() => + findDebugTargetByText(UPDATED_EXTENSION_NAME, document) + ); + + const updatedTarget = findDebugTargetByText(UPDATED_EXTENSION_NAME, document); + ok(!!updatedTarget, "The temporary extension name has been updated"); + + info("Click on the remove button for the temporary extension"); + const removeButton = updatedTarget.querySelector( + ".qa-temporary-extension-remove-button" + ); + removeButton.click(); + + info( + "Wait until the debug target with the updated extension name disappears" + ); + await waitUntil( + () => !findDebugTargetByText(UPDATED_EXTENSION_NAME, document) + ); + + await removeTab(tab); +}); + +add_task(async function() { + const PACKAGED_EXTENSION_ID = "packaged-extension@tests"; + const PACKAGED_EXTENSION_NAME = "Packaged extension"; + + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + await installRegularExtension( + "resources/packaged-extension/packaged-extension.xpi" + ); + + info("Wait until extension appears in about:debugging"); + await waitUntil(() => + findDebugTargetByText(PACKAGED_EXTENSION_NAME, document) + ); + const target = findDebugTargetByText(PACKAGED_EXTENSION_NAME, document); + + const reloadButton = target.querySelector( + ".qa-temporary-extension-reload-button" + ); + ok( + !reloadButton, + "No reload button displayed for a regularly installed extension" + ); + + const removeButton = target.querySelector( + ".qa-temporary-extension-remove-button" + ); + ok( + !removeButton, + "No remove button displayed for a regularly installed extension" + ); + + await removeExtension( + PACKAGED_EXTENSION_ID, + PACKAGED_EXTENSION_NAME, + document + ); + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_id_message.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_id_message.js new file mode 100644 index 0000000000..cf518a5037 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_id_message.js @@ -0,0 +1,70 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ +"use strict"; + +/* import-globals-from helper-addons.js */ +Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this); + +// Test that temporary extensions show a message about temporary ids, with a learn more +// link. +add_task(async function() { + const EXTENSION_NAME = "Temporary web extension"; + const EXTENSION_ID = "test-devtools@mozilla.org"; + + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + await installTemporaryExtensionFromXPI( + { + id: EXTENSION_ID, + name: EXTENSION_NAME, + }, + document + ); + + info("Wait until a debug target item appears"); + await waitUntil(() => findDebugTargetByText(EXTENSION_NAME, document)); + + const target = findDebugTargetByText(EXTENSION_NAME, document); + + const message = target.querySelector(".qa-temporary-id-message"); + ok(!!message, "Temporary id message is displayed for temporary extensions"); + + const link = target.querySelector(".qa-temporary-id-link"); + ok(!!link, "Temporary id link is displayed for temporary extensions"); + + await removeTemporaryExtension(EXTENSION_NAME, document); + await removeTab(tab); +}); + +// Test that the message and the link are not displayed for a regular extension. +add_task(async function() { + const PACKAGED_EXTENSION_ID = "packaged-extension@tests"; + const PACKAGED_EXTENSION_NAME = "Packaged extension"; + + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + await installRegularExtension( + "resources/packaged-extension/packaged-extension.xpi" + ); + + info("Wait until extension appears in about:debugging"); + await waitUntil(() => + findDebugTargetByText(PACKAGED_EXTENSION_NAME, document) + ); + const target = findDebugTargetByText(PACKAGED_EXTENSION_NAME, document); + + const tmpIdMessage = target.querySelector(".qa-temporary-id-message"); + ok( + !tmpIdMessage, + "No temporary id message is displayed for a regular extension" + ); + + await removeExtension( + PACKAGED_EXTENSION_ID, + PACKAGED_EXTENSION_NAME, + document + ); + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_install_error.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_install_error.js new file mode 100644 index 0000000000..21a30ab3bf --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_install_error.js @@ -0,0 +1,89 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-addons.js */ +Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this); + +/** + * Test that the installation error messages are displayed when installing temporary + * extensions. + */ + +const INVALID_JSON_EXTENSION_PATH = + "resources/bad-extensions/invalid-json/manifest.json"; +const INVALID_PROP_EXTENSION_PATH = + "resources/bad-extensions/invalid-property/manifest.json"; +const EXTENSION_PATH = "resources/test-temporary-extension/manifest.json"; +const EXTENSION_NAME = "test-temporary-extension"; + +// Extension with an invalid JSON manifest will not be parsed. We check the expected +// error message is displayed +add_task(async function testInvalidJsonExtension() { + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + const installError = await installBadExtension( + INVALID_JSON_EXTENSION_PATH, + document + ); + ok( + installError.textContent.includes("JSON.parse: unexpected keyword"), + "The expected installation error is displayed: " + installError.textContent + ); + + info("Install a valid extension to make the message disappear"); + await installTemporaryExtension(EXTENSION_PATH, EXTENSION_NAME, document); + + info("Wait until the error message disappears"); + await waitUntil( + () => !document.querySelector(".qa-tmp-extension-install-error") + ); + + info("Wait for the temporary addon to be displayed as a debug target"); + await waitUntil(() => findDebugTargetByText(EXTENSION_NAME, document)); + + await removeTemporaryExtension(EXTENSION_NAME, document); + + await removeTab(tab); +}); + +// Extension with a valid JSON manifest but containing an invalid property should display +// a detailed error message coming from the Addon Manager. +add_task(async function testInvalidPropertyExtension() { + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + const installError = await installBadExtension( + INVALID_PROP_EXTENSION_PATH, + document + ); + + ok( + installError.textContent.includes("Extension is invalid"), + "The basic installation error is displayed: " + installError.textContent + ); + ok( + installError.textContent.includes( + "Reading manifest: Error processing content_scripts.0.matches" + ), + "The detailed installation error is also displayed: " + + installError.textContent + ); + + await removeTab(tab); +}); + +async function installBadExtension(path, document) { + info("Install a bad extension at path: " + path); + // Do not use installTemporaryAddon here since the install will fail. + prepareMockFilePicker(path); + document.querySelector(".qa-temporary-extension-install-button").click(); + + info("Wait until the install error message appears"); + await waitUntil(() => + document.querySelector(".qa-tmp-extension-install-error") + ); + return document.querySelector(".qa-tmp-extension-install-error"); +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_install_path.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_install_path.js new file mode 100644 index 0000000000..a6f9fde0c1 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_install_path.js @@ -0,0 +1,65 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-addons.js */ +Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this); + +/** + * Test the the path used to install a temporary addon is saved in a preference and reused + * next time the feature is used. + */ + +const EXTENSION_PATH = "resources/test-temporary-extension/manifest.json"; +const EXTENSION_NAME = "test-temporary-extension"; +const LAST_DIR_PREF = "devtools.aboutdebugging.tmpExtDirPath"; + +// Check that the preference is updated when trying to install a temporary extension. +add_task(async function testPreferenceUpdatedAfterInstallingExtension() { + registerCleanupFunction(() => { + Services.prefs.clearUserPref(LAST_DIR_PREF); + }); + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + await installTemporaryExtension(EXTENSION_PATH, EXTENSION_NAME, document); + + info("Check whether the selected dir sets into the pref"); + const lastDirPath = Services.prefs.getCharPref(LAST_DIR_PREF, ""); + const expectedPath = getTestFilePath("resources/test-temporary-extension"); + is(lastDirPath, expectedPath, "The selected dir should set into the pref"); + + await waitUntil(() => findDebugTargetByText(EXTENSION_NAME, document)); + await removeTemporaryExtension(EXTENSION_NAME, document); + await removeTab(tab); +}); + +// Check that the preference is updated when trying to install a temporary extension. +add_task(async function testPreferenceRetrievedWhenInstallingExtension() { + const selectedDir = getTestFilePath("resources/packaged-extension"); + + await pushPref(LAST_DIR_PREF, selectedDir); + + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + const MockFilePicker = SpecialPowers.MockFilePicker; + MockFilePicker.init(window); + const onFilePickerShown = new Promise(resolve => { + MockFilePicker.showCallback = fp => { + resolve(fp); + }; + }); + document.querySelector(".qa-temporary-extension-install-button").click(); + + info("Check whether the shown dir is same as the pref"); + const fp = await onFilePickerShown; + is( + fp.displayDirectory.path, + selectedDir, + "Shown directory sets as same as the pref" + ); + + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_reload_error.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_reload_error.js new file mode 100644 index 0000000000..08a37116bd --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_temporary_reload_error.js @@ -0,0 +1,68 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ +"use strict"; + +/* import-globals-from helper-addons.js */ +Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this); + +// Test that the reload button updates the addon list with the correct metadata. +add_task(async function() { + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + const EXTENSION_ID = "test-devtools@mozilla.org"; + const EXTENSION_NAME = "Temporary web extension"; + + let addonFile = await installTemporaryExtensionFromXPI( + { + id: EXTENSION_ID, + name: EXTENSION_NAME, + }, + document + ); + + const target = findDebugTargetByText(EXTENSION_NAME, document); + ok(!!target, "The temporary extension is installed with the expected name"); + + info("Update the name of the temporary extension in the manifest"); + addonFile = updateTemporaryXPI({ id: EXTENSION_ID }, addonFile); + + info("Click on the reload button for the invalid temporary extension"); + const waitForError = waitForDispatch( + window.AboutDebugging.store, + "TEMPORARY_EXTENSION_RELOAD_FAILURE" + ); + const reloadButton = target.querySelector( + ".qa-temporary-extension-reload-button" + ); + reloadButton.click(); + await waitForError; + ok( + target.querySelector(".qa-temporary-extension-reload-error"), + "The error message of reloading appears" + ); + + info("Click on the reload button for the valid temporary extension"); + const waitForSuccess = waitForDispatch( + window.AboutDebugging.store, + "TEMPORARY_EXTENSION_RELOAD_SUCCESS" + ); + updateTemporaryXPI({ id: EXTENSION_ID, name: EXTENSION_NAME }, addonFile); + reloadButton.click(); + await waitForSuccess; + ok( + !target.querySelector(".qa-temporary-extension-reload-error"), + "The error message of reloading disappears" + ); + + info("Click on the remove button for the temporary extension"); + const removeButton = target.querySelector( + ".qa-temporary-extension-remove-button" + ); + removeButton.click(); + + info("Wait until the debug target with the extension disappears"); + await waitUntil(() => !findDebugTargetByText(EXTENSION_NAME, document)); + + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_warnings.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_warnings.js new file mode 100644 index 0000000000..6f00208cbb --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_addons_warnings.js @@ -0,0 +1,49 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-addons.js */ +Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this); + +// Test that extension warnings are displayed in about:debugging. +add_task(async function() { + const EXTENSION_NAME = "Temporary web extension"; + const EXTENSION_ID = "test-devtools@mozilla.org"; + + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + await pushPref("extensions.webextensions.warnings-as-errors", false); + await installTemporaryExtensionFromXPI( + { + id: EXTENSION_ID, + name: EXTENSION_NAME, + extraProperties: { + // This property is not expected in the manifest and should trigger a warning! + wrongProperty: {}, + }, + }, + document + ); + await SpecialPowers.popPrefEnv(); + + info("Wait until a debug target item appears"); + await waitUntil(() => findDebugTargetByText(EXTENSION_NAME, document)); + const target = findDebugTargetByText(EXTENSION_NAME, document); + + const warningMessage = target.querySelector(".qa-message"); + ok( + !!warningMessage, + "A warning message is displayed for the installed addon" + ); + + const warningText = warningMessage.textContent; + ok( + warningText.includes("wrongProperty"), + "The warning message mentions wrongProperty" + ); + + await removeTemporaryExtension(EXTENSION_NAME, document); + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_connect_networklocations.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_connect_networklocations.js new file mode 100644 index 0000000000..ee4f8e1b7e --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_connect_networklocations.js @@ -0,0 +1,103 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/** + * Test the network locations form of the Connect page. + * Check that a network location can be added and removed. + */ + +const TEST_NETWORK_LOCATION = "localhost:1111"; +const TEST_NETWORK_LOCATION_INVALID = "testnetwork"; + +add_task(async function() { + const { document, tab } = await openAboutDebugging(); + + await selectConnectPage(document); + + let networkLocations = document.querySelectorAll(".qa-network-location"); + is( + networkLocations.length, + 0, + "By default, no network locations are displayed" + ); + + info("Check whether error message should show if the input value is invalid"); + addNetworkLocation(TEST_NETWORK_LOCATION_INVALID, document); + await waitUntil(() => + document.querySelector(".qa-connect-page__network-form__error-message") + ); + + info("Wait until the new network location is visible in the list"); + addNetworkLocation(TEST_NETWORK_LOCATION, document); + await waitUntil( + () => document.querySelectorAll(".qa-network-location").length === 1 + ); + await waitUntil( + () => + !document.querySelector(".qa-connect-page__network-form__error-message") + ); + + networkLocations = document.querySelectorAll(".qa-network-location"); + const networkLocationValue = networkLocations[0].querySelector( + ".qa-network-location-value" + ); + is( + networkLocationValue.textContent, + TEST_NETWORK_LOCATION, + "Added network location has the expected value" + ); + + info( + "Check whether error message should show if the input value was duplicate" + ); + addNetworkLocation(TEST_NETWORK_LOCATION, document); + await waitUntil(() => + document.querySelector(".qa-connect-page__network-form__error-message") + ); + + info("Wait until the new network location is removed from the list"); + removeNetworkLocation(TEST_NETWORK_LOCATION, document); + await waitUntil( + () => document.querySelectorAll(".qa-network-location").length === 0 + ); + + await removeTab(tab); +}); + +function addNetworkLocation(location, document) { + info("Setting a value in the network form input"); + const networkLocationInput = document.querySelector(".qa-network-form-input"); + networkLocationInput.value = ""; + networkLocationInput.focus(); + EventUtils.sendString(location, networkLocationInput.ownerGlobal); + + info("Click on network form submit button"); + const networkLocationSubmitButton = document.querySelector( + ".qa-network-form-submit-button" + ); + networkLocationSubmitButton.click(); +} + +function removeNetworkLocation(location, document) { + const networkLocation = getNetworkLocation(location, document); + ok(networkLocation, "Network location container found."); + + info("Click on the remove button for the provided network location"); + const removeButton = networkLocation.querySelector( + ".qa-network-location-remove-button" + ); + removeButton.click(); +} + +function getNetworkLocation(location, document) { + info("Find the container for network location: " + location); + const networkLocations = document.querySelectorAll(".qa-network-location"); + return [...networkLocations].find(element => { + return ( + element.querySelector(".qa-network-location-value").textContent === + location + ); + }); +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_connect_toggle_usb_devices.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_connect_toggle_usb_devices.js new file mode 100644 index 0000000000..c5666fbccd --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_connect_toggle_usb_devices.js @@ -0,0 +1,83 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-adb.js */ +Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-adb.js", this); + +const { AddonManager } = require("resource://gre/modules/AddonManager.jsm"); + +/** + * Check that USB Devices scanning can be enabled and disabled from the connect page. + */ +add_task(async function() { + await pushPref( + "devtools.remote.adb.extensionURL", + CHROME_URL_ROOT + "resources/test-adb-extension/adb-extension-#OS#.xpi" + ); + await checkAdbNotRunning(); + + const { document, tab } = await openAboutDebugging(); + + await selectConnectPage(document); + + info("Wait until Connect page is displayed"); + await waitUntil(() => document.querySelector(".qa-connect-page")); + + info("Check that by default USB devices are disabled"); + const usbDisabledMessage = document.querySelector( + ".qa-connect-usb-disabled-message" + ); + ok(usbDisabledMessage, "A message about enabling USB devices is rendered"); + + const usbToggleButton = document.querySelector( + ".qa-connect-usb-toggle-button" + ); + ok(usbToggleButton, "The button to toggle USB devices debugging is rendered"); + ok( + usbToggleButton.textContent.includes("Enable"), + "The text of the toggle USB button is correct" + ); + + info("Click on the toggle button"); + usbToggleButton.click(); + + info("Wait until the toggle button text is updated"); + await waitUntil(() => usbToggleButton.textContent.includes("Disable")); + ok( + !document.querySelector(".qa-connect-usb-disabled-message"), + "The message about enabling USB devices is no longer rendered" + ); + + info("Check that the addon was installed with the proper source"); + const adbExtensionId = Services.prefs.getCharPref( + "devtools.remote.adb.extensionID" + ); + const addon = await AddonManager.getAddonByID(adbExtensionId); + Assert.deepEqual( + addon.installTelemetryInfo, + { source: "about:debugging" }, + "Got the expected addon.installTelemetryInfo" + ); + + // Right now we are resuming as soon as "USB enabled" is displayed, but ADB + // might still be starting up. If we move to uninstall directly, the ADB startup will + // fail and we will have an unhandled promise rejection. + // See Bug 1498469. + await waitForAdbStart(); + + info("Click on the toggle button"); + usbToggleButton.click(); + + info("Wait until the toggle button text is updated"); + await waitUntil(() => usbToggleButton.textContent.includes("Enable")); + ok( + document.querySelector(".qa-connect-usb-disabled-message"), + "The message about enabling USB devices is rendered again" + ); + + await stopAdbProcess(); + + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_connection_prompt_setting.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_connection_prompt_setting.js new file mode 100644 index 0000000000..f5634a5d1e --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_connection_prompt_setting.js @@ -0,0 +1,70 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const USB_RUNTIME_ID = "1337id"; +const USB_DEVICE_NAME = "Fancy Phone"; +const USB_APP_NAME = "Lorem ipsum"; + +/** + * Check whether can toggle enable/disable connection prompt setting. + */ +add_task(async function() { + // enable USB devices mocks + const mocks = new Mocks(); + const runtime = mocks.createUSBRuntime(USB_RUNTIME_ID, { + deviceName: USB_DEVICE_NAME, + name: USB_APP_NAME, + }); + + info("Set initial state for test"); + await pushPref("devtools.debugger.prompt-connection", true); + + // open a remote runtime page + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + mocks.emitUSBUpdate(); + await connectToRuntime(USB_DEVICE_NAME, document); + await selectRuntime(USB_DEVICE_NAME, USB_APP_NAME, document); + + info("Check whether connection prompt toggle button exists"); + let connectionPromptToggleButton = document.querySelector( + ".qa-connection-prompt-toggle-button" + ); + ok(connectionPromptToggleButton, "Toggle button existed"); + ok( + connectionPromptToggleButton.textContent.includes("Disable"), + "Toggle button shows 'Disable'" + ); + + info("Click on the toggle button"); + connectionPromptToggleButton = document.querySelector( + ".qa-connection-prompt-toggle-button" + ); + connectionPromptToggleButton.click(); + info("Wait until the toggle button text is updated"); + await waitUntil(() => + connectionPromptToggleButton.textContent.includes("Enable") + ); + info("Check the preference"); + const disabledPref = runtime.getPreference( + "devtools.debugger.prompt-connection" + ); + is(disabledPref, false, "The preference should be updated"); + + info("Click on the toggle button again"); + connectionPromptToggleButton.click(); + info("Wait until the toggle button text is updated"); + await waitUntil(() => + connectionPromptToggleButton.textContent.includes("Disable") + ); + info("Check the preference"); + const enabledPref = runtime.getPreference( + "devtools.debugger.prompt-connection" + ); + is(enabledPref, true, "The preference should be updated"); + + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_debug-target-pane_collapsibilities_interaction.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_debug-target-pane_collapsibilities_interaction.js new file mode 100644 index 0000000000..c2ce475aab --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_debug-target-pane_collapsibilities_interaction.js @@ -0,0 +1,62 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-collapsibilities.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-collapsibilities.js", + this +); + +/** + * Test that collapsibilities of DebugTargetPane on RuntimePage by mouse clicking. + */ + +add_task(async function() { + prepareCollapsibilitiesTest(); + + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + for (const { title } of TARGET_PANES) { + info("Check whether this pane is collapsed after clicking the title"); + await toggleCollapsibility(getDebugTargetPane(title, document)); + assertDebugTargetCollapsed(getDebugTargetPane(title, document), title); + + info("Check whether this pane is expanded after clicking the title again"); + await toggleCollapsibility(getDebugTargetPane(title, document)); + await assertDebugTargetExpanded(getDebugTargetPane(title, document), title); + } + + await removeTab(tab); +}); + +async function assertDebugTargetCollapsed(paneEl, title) { + info("Check debug target is collapsed"); + + // check list height + const targetEl = paneEl.querySelector(".qa-debug-target-pane__collapsable"); + is(targetEl.clientHeight, 0, "Height of list element is zero"); + // check title + const titleEl = paneEl.querySelector(".qa-debug-target-pane-title"); + const expectedTitle = `${title} (${ + targetEl.querySelectorAll(".qa-debug-target-item").length + })`; + is(titleEl.textContent, expectedTitle, "Collapsed title is correct"); +} + +async function assertDebugTargetExpanded(paneEl, title) { + info("Check debug target is expanded"); + + // check list height + const targetEl = paneEl.querySelector(".qa-debug-target-pane__collapsable"); + await waitUntil(() => targetEl.clientHeight > 0); + ok(true, "Height of list element is greater than zero"); + // check title + const titleEl = paneEl.querySelector(".qa-debug-target-pane-title"); + const expectedTitle = `${title} (${ + targetEl.querySelectorAll(".qa-debug-target-item").length + })`; + is(titleEl.textContent, expectedTitle, "Expanded title is correct"); +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_debug-target-pane_collapsibilities_preference.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_debug-target-pane_collapsibilities_preference.js new file mode 100644 index 0000000000..736f4468d0 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_debug-target-pane_collapsibilities_preference.js @@ -0,0 +1,40 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-collapsibilities.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-collapsibilities.js", + this +); + +/** + * Test for preference of DebugTargetPane collapsibilities. + */ + +add_task(async function() { + prepareCollapsibilitiesTest(); + + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + info("Collapse all pane"); + for (const { title } of TARGET_PANES) { + const debugTargetPaneEl = getDebugTargetPane(title, document); + await toggleCollapsibility(debugTargetPaneEl); + } + + info("Check preference of collapsibility after closing about:debugging page"); + await removeTab(tab); + // Wait until unmount. + await waitUntil(() => document.querySelector(".app") === null); + + for (const { pref } of TARGET_PANES) { + is( + Services.prefs.getBoolPref(pref), + true, + `${pref} preference should be true` + ); + } +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_debug-target-pane_empty.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_debug-target-pane_empty.js new file mode 100644 index 0000000000..d9305c243b --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_debug-target-pane_empty.js @@ -0,0 +1,83 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-addons.js */ +Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this); +/* import-globals-from helper-collapsibilities.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-collapsibilities.js", + this +); + +/** + * Test that an "empty" message is displayed when there are no debug targets in a debug + * target pane. + */ + +const EXTENSION_PATH = "resources/test-temporary-extension/manifest.json"; +const EXTENSION_NAME = "test-temporary-extension"; + +add_task(async function() { + prepareCollapsibilitiesTest(); + + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + info("Check that the temporary extensions pane is empty"); + const temporaryExtensionPane = getDebugTargetPane( + "Temporary Extensions", + document + ); + ok( + !temporaryExtensionPane.querySelector(".qa-debug-target-item"), + "Temporary Extensions pane contains no debug target" + ); + + info("Check an empty target pane message is displayed"); + ok( + temporaryExtensionPane.querySelector(".qa-debug-target-list-empty"), + "An empty target list message is displayed" + ); + + info("Install a temporary extension"); + await installTemporaryExtension(EXTENSION_PATH, EXTENSION_NAME, document); + + info("Wait until a debug target item appears"); + await waitUntil(() => + temporaryExtensionPane.querySelector(".qa-debug-target-item") + ); + + info("Check the empty target pane message is no longer displayed"); + ok( + !temporaryExtensionPane.querySelector(".qa-debug-target-list-empty"), + "The empty target list message is no longer displayed" + ); + + const temporaryExtensionItem = temporaryExtensionPane.querySelector( + ".qa-debug-target-item" + ); + ok( + temporaryExtensionItem, + "Temporary Extensions pane now shows debug target" + ); + + info("Remove the temporary extension"); + temporaryExtensionItem + .querySelector(".qa-temporary-extension-remove-button") + .click(); + + info("Wait until the debug target item disappears"); + await waitUntil( + () => !temporaryExtensionPane.querySelector(".qa-debug-target-item") + ); + + info("Check the empty target pane message is displayed again"); + ok( + temporaryExtensionPane.querySelector(".qa-debug-target-list-empty"), + "An empty target list message is displayed again" + ); + + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_debug-target-pane_usb_runtime.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_debug-target-pane_usb_runtime.js new file mode 100644 index 0000000000..2de3a649ce --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_debug-target-pane_usb_runtime.js @@ -0,0 +1,72 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-collapsibilities.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-collapsibilities.js", + this +); + +const RUNTIME_ID = "test-runtime-id"; +const RUNTIME_DEVICE_NAME = "test device name"; +const RUNTIME_APP_NAME = "TestApp"; + +// Test that the expected supported categories are displayed for USB runtimes. +add_task(async function() { + const mocks = new Mocks(); + await checkTargetPanes({ enableLocalTabs: false }, mocks); + + info( + "Check that enableLocalTabs has no impact on the categories displayed for remote" + + " runtimes." + ); + await checkTargetPanes({ enableLocalTabs: true }, mocks); +}); + +async function checkTargetPanes({ enableLocalTabs }, mocks) { + const { document, tab, window } = await openAboutDebugging({ + enableLocalTabs, + }); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + mocks.createUSBRuntime(RUNTIME_ID, { + deviceName: RUNTIME_DEVICE_NAME, + name: RUNTIME_APP_NAME, + }); + mocks.emitUSBUpdate(); + + await connectToRuntime(RUNTIME_DEVICE_NAME, document); + await selectRuntime(RUNTIME_DEVICE_NAME, RUNTIME_APP_NAME, document); + + const SUPPORTED_TARGET_PANES = [ + "Temporary Extensions", + "Extensions", + "Other Workers", + "Shared Workers", + "Service Workers", + "Tabs", + ]; + + for (const { title } of TARGET_PANES) { + const debugTargetPaneEl = getDebugTargetPane(title, document); + if (SUPPORTED_TARGET_PANES.includes(title)) { + ok(debugTargetPaneEl, `Supported target pane [${title}] is displayed`); + } else { + ok(!debugTargetPaneEl, `Unsupported target pane [${title}] is hidden`); + } + } + + const installButton = document.querySelector( + ".qa-temporary-extension-install-button" + ); + ok(!installButton, "Temporary Extensions install button is hidden"); + + info("Remove USB runtime"); + mocks.removeUSBRuntime(RUNTIME_ID); + mocks.emitUSBUpdate(); + await waitUntilUsbDeviceIsUnplugged(RUNTIME_DEVICE_NAME, document); + + await removeTab(tab); +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtools.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtools.js new file mode 100644 index 0000000000..5eb4a46324 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtools.js @@ -0,0 +1,51 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-collapsibilities.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-collapsibilities.js", + this +); + +/** + * Check that DevTools are not closed when leaving This Firefox runtime page. + */ + +add_task(async function() { + info("Force all debug target panes to be expanded"); + prepareCollapsibilitiesTest(); + + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + const connectSidebarItem = findSidebarItemByText("Setup", document); + const connectLink = connectSidebarItem.querySelector(".qa-sidebar-link"); + ok(connectSidebarItem, "Found the Connect sidebar item"); + + info("Open devtools on the current about:debugging tab"); + const toolbox = await openToolboxForTab(tab, "inspector"); + const inspector = toolbox.getPanel("inspector"); + + info("DevTools starts workers, wait for requests to settle"); + const store = window.AboutDebugging.store; + await waitForRequestsToSettle(store); + + info("Click on the Connect item in the sidebar"); + connectLink.click(); + await waitForDispatch(store, "UNWATCH_RUNTIME_SUCCESS"); + + info("Wait until Connect page is displayed"); + await waitUntil(() => document.querySelector(".qa-connect-page")); + + const markupViewElement = inspector.panelDoc.getElementById("markup-box"); + ok(markupViewElement, "Inspector is still rendered"); + + // We explicitely destroy the toolbox in order to ensure waiting for its full destruction + // and avoid leak / pending requests + info("Destroy the opened toolbox"); + await toolbox.destroy(); + + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_contextmenu.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_contextmenu.js new file mode 100644 index 0000000000..9c423661f7 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_contextmenu.js @@ -0,0 +1,102 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-collapsibilities.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-collapsibilities.js", + this +); + +/** + * Test context menu on about:devtools-toolbox page. + */ +add_task(async function() { + info("Force all debug target panes to be expanded"); + prepareCollapsibilitiesTest(); + + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + const { devtoolsBrowser, devtoolsTab } = await openAboutDevtoolsToolbox( + document, + tab, + window + ); + + info("Check whether the menu item which opens devtools is disabled"); + const rootDocument = devtoolsTab.ownerDocument; + await assertContextMenu( + rootDocument, + devtoolsBrowser, + ".debug-target-info", + false + ); + + info("Force to select about:debugging page"); + await updateSelectedTab(gBrowser, tab, window.AboutDebugging.store); + + info("Check whether the menu item which opens devtools is enabled"); + await assertContextMenu(rootDocument, devtoolsBrowser, "#mount", true); + + await closeAboutDevtoolsToolbox(document, devtoolsTab, window); + await removeTab(tab); +}); + +async function assertContextMenu( + rootDocument, + browser, + targetSelector, + shouldBeEnabled +) { + if (shouldBeEnabled) { + await assertContextMenuEnabled(rootDocument, browser, targetSelector); + } else { + await assertContextMenuDisabled(rootDocument, browser, targetSelector); + } +} + +async function assertContextMenuDisabled( + rootDocument, + browser, + targetSelector +) { + const contextMenu = rootDocument.getElementById("contentAreaContextMenu"); + let isPopupShown = false; + const listener = () => { + isPopupShown = true; + }; + contextMenu.addEventListener("popupshown", listener); + BrowserTestUtils.synthesizeMouseAtCenter( + targetSelector, + { type: "contextmenu" }, + browser + ); + await wait(1000); + ok(!isPopupShown, `Context menu should not be shown`); + contextMenu.removeEventListener("popupshown", listener); +} + +async function assertContextMenuEnabled(rootDocument, browser, targetSelector) { + // Show content context menu. + const contextMenu = rootDocument.getElementById("contentAreaContextMenu"); + const popupShownPromise = BrowserTestUtils.waitForEvent( + contextMenu, + "popupshown" + ); + BrowserTestUtils.synthesizeMouseAtCenter( + targetSelector, + { type: "contextmenu" }, + browser + ); + await popupShownPromise; + ok(true, `Context menu should be shown`); + + // Hide content context menu. + const popupHiddenPromise = BrowserTestUtils.waitForEvent( + contextMenu, + "popuphidden" + ); + contextMenu.hidePopup(); + await popupHiddenPromise; +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_contextmenu_markupview.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_contextmenu_markupview.js new file mode 100644 index 0000000000..881d4df119 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_contextmenu_markupview.js @@ -0,0 +1,45 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-collapsibilities.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-collapsibilities.js", + this +); + +/** + * Test context menu of markup view on about:devtools-toolbox page. + */ +add_task(async function() { + info("Force all debug target panes to be expanded"); + prepareCollapsibilitiesTest(); + + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + const { devtoolsTab, devtoolsWindow } = await openAboutDevtoolsToolbox( + document, + tab, + window + ); + + info("Select inspector tool"); + const toolbox = getToolbox(devtoolsWindow); + await toolbox.selectTool("inspector"); + + info("Show context menu of markup view"); + const markupDocument = toolbox.getPanel("inspector").markup.doc; + EventUtils.synthesizeMouseAtCenter( + markupDocument.body, + { type: "contextmenu" }, + markupDocument.ownerGlobal + ); + + info("Check whether proper context menu of markup view will be shown"); + await waitUntil(() => toolbox.topDoc.querySelector("#node-menu-edithtml")); + ok(true, "Context menu of markup view should be shown"); + + await closeAboutDevtoolsToolbox(document, devtoolsTab, window); + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_focus.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_focus.js new file mode 100644 index 0000000000..bcbc7e23a3 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_focus.js @@ -0,0 +1,122 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-collapsibilities.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-collapsibilities.js", + this +); + +/** + * Test whether the focus transfers to a tab which is already inspected . + */ +add_task(async function() { + info("Force all debug target panes to be expanded"); + prepareCollapsibilitiesTest(); + + info( + "Select 'performance' panel as the initial tool since the tool does not listen " + + "any changes of the document without user action" + ); + await pushPref("devtools.toolbox.selectedTool", "performance"); + + const { document, tab, window } = await openAboutDebugging(); + const { store } = window.AboutDebugging; + await selectThisFirefoxPage(document, store); + + const inspectionTarget = "about:debugging"; + info(`Open ${inspectionTarget} as inspection target`); + await waitUntil(() => findDebugTargetByText(inspectionTarget, document)); + info(`Inspect ${inspectionTarget} page in about:devtools-toolbox`); + const { devtoolsTab, devtoolsWindow } = await openAboutDevtoolsToolbox( + document, + tab, + window, + inspectionTarget + ); + + info( + "Check the tab state after clicking inspect button " + + "when another tab was selected" + ); + await updateSelectedTab(gBrowser, tab, store); + clickInspectButton(inspectionTarget, document); + const devtoolsURL = devtoolsWindow.location.href; + assertDevtoolsToolboxTabState(devtoolsURL); + + info( + "Check the tab state after clicking inspect button " + + "when the toolbox tab is in another window" + ); + const newNavigator = gBrowser.replaceTabWithWindow(devtoolsTab); + await waitUntil( + () => + newNavigator.gBrowser && + newNavigator.gBrowser.selectedTab.linkedBrowser.contentWindow.location + .href === devtoolsURL + ); + + info( + "Create a tab in the window and select the tab " + + "so that the about:devtools-toolbox tab loses focus" + ); + const newTestTab = newNavigator.gBrowser.addTab( + "data:text/html,<title>TEST_TAB</title>", + { + triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(), + } + ); + await waitUntil(() => findDebugTargetByText("TEST_TAB", document)); + + await updateSelectedTab(newNavigator.gBrowser, newTestTab, store); + + let onTabsSuccess = waitForDispatch(store, "REQUEST_TABS_SUCCESS"); + clickInspectButton(inspectionTarget, document); + assertDevtoolsToolboxTabState(devtoolsURL); + await onTabsSuccess; + + info("Close new navigator and wait until the debug target disappears"); + onTabsSuccess = waitForDispatch(store, "REQUEST_TABS_SUCCESS"); + const onToolboxDestroyed = gDevTools.once("toolbox-destroyed"); + newNavigator.close(); + await onToolboxDestroyed; + await onTabsSuccess; + + await waitUntil(() => !findDebugTargetByText("Toolbox - ", document)); + + info("Remove test tab"); + await removeTab(tab); +}); + +function clickInspectButton(inspectionTarget, doc) { + const target = findDebugTargetByText(inspectionTarget, doc); + const button = target.querySelector(".qa-debug-target-inspect-button"); + button.click(); +} + +// Check that only one tab is currently opened for the provided URL. +// Also check that this tab and the tab's window are focused. +function assertDevtoolsToolboxTabState(devtoolsURL) { + const existingTabs = []; + + for (const navigator of Services.wm.getEnumerator("navigator:browser")) { + for (const browser of navigator.gBrowser.browsers) { + if ( + browser.contentWindow && + browser.contentWindow.location.href === devtoolsURL + ) { + const tab = navigator.gBrowser.getTabForBrowser(browser); + existingTabs.push(tab); + } + } + } + + is(existingTabs.length, 1, `Only one tab is opened for ${devtoolsURL}`); + const tab = existingTabs[0]; + const navigator = tab.ownerGlobal; + is(navigator.gBrowser.selectedTab, tab, "The tab is selected"); + const focusedNavigator = Services.wm.getMostRecentWindow("navigator:browser"); + is(navigator, focusedNavigator, "The navigator is focused"); +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_menubar.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_menubar.js new file mode 100644 index 0000000000..47f052230b --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_menubar.js @@ -0,0 +1,82 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-collapsibilities.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-collapsibilities.js", + this +); + +/** + * Test the status of menu items when open about:devtools-toolbox. + */ +add_task(async function() { + info("Force all debug target panes to be expanded"); + prepareCollapsibilitiesTest(); + + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + const { devtoolsTab, devtoolsWindow } = await openAboutDevtoolsToolbox( + document, + tab, + window + ); + + info("Check whether the menu items are disabled"); + const rootDocument = devtoolsTab.ownerDocument; + await assertMenusItems(rootDocument, false); + + info("Select the inspector"); + const toolbox = getToolbox(devtoolsWindow); + await toolbox.selectTool("inspector"); + + info("Click on the console item"); + const onConsoleLoaded = toolbox.once("webconsole-ready"); + const webconsoleMenuItem = rootDocument.getElementById("menuitem_webconsole"); + webconsoleMenuItem.click(); + + info("Wait until about:devtools-toolbox switches to the console"); + await onConsoleLoaded; + + info("Force to select about:debugging page"); + await updateSelectedTab(gBrowser, tab, window.AboutDebugging.store); + + info("Check whether the menu items are enabled"); + await assertMenusItems(rootDocument, true); + + await closeAboutDevtoolsToolbox(document, devtoolsTab, window); + await removeTab(tab); +}); + +async function assertMenusItems(rootDocument, shouldBeEnabled) { + info("Wait for the Toggle Tools menu-item hidden attribute to change"); + const menuItem = rootDocument.getElementById("menu_devToolbox"); + await waitUntil(() => menuItem.hidden === !shouldBeEnabled); + + info( + "Check that the state of the Toggle Tools menu-item depends on the page" + ); + assertMenuItem(rootDocument, "menu_devToolbox", shouldBeEnabled); + + info( + "Check that the tools menu-items are always enabled regardless of the page" + ); + for (const toolDefinition of gDevTools.getToolDefinitionArray()) { + if (!toolDefinition.inMenu) { + continue; + } + + assertMenuItem(rootDocument, "menuitem_" + toolDefinition.id, true); + } +} + +function assertMenuItem(rootDocument, menuItemId, shouldBeEnabled) { + const menuItem = rootDocument.getElementById(menuItemId); + is( + menuItem.hidden, + !shouldBeEnabled, + `"hidden" attribute of menu item(${menuItemId}) should be correct` + ); +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_navigate_back_forward.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_navigate_back_forward.js new file mode 100644 index 0000000000..25244f8cb3 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_navigate_back_forward.js @@ -0,0 +1,54 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const ORIGINAL_URL = "about:home"; +const OTHER_URL = "about:blank"; + +async function waitForUrl(url, toolbox, browserTab, win) { + return Promise.all([ + waitUntil( + () => + toolbox.target.url === url && + browserTab.linkedBrowser.currentURI.spec === url + ), + toolbox.target.once("navigate"), + toolbox.target.client.waitForRequestsToSettle(), + waitForRequestsToSettle(win.AboutDebugging.store), + ]); +} + +// Test that ensures the remote page can go forward and back via UI buttons +add_task(async function() { + const browserTab = await addTab(ORIGINAL_URL); + + const { document, tab, window } = await openAboutDebugging(); + + // go to This Firefox and inspect the new tab + info("Inspecting a new tab in This Firefox"); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + const devToolsToolbox = await openAboutDevtoolsToolbox( + document, + tab, + window, + ORIGINAL_URL + ); + const { devtoolsDocument, devtoolsWindow } = devToolsToolbox; + const toolbox = getToolbox(devtoolsWindow); + + info("Navigating to another URL"); + const urlInput = devtoolsDocument.querySelector(".devtools-textinput"); + await synthesizeUrlKeyInput(devToolsToolbox, urlInput, OTHER_URL); + await waitForUrl(OTHER_URL, toolbox, browserTab, window); + + info("Clicking back button"); + devtoolsDocument.querySelector(".qa-back-button").click(); + await waitForUrl(ORIGINAL_URL, toolbox, browserTab, window); + + info("Clicking the forward button"); + devtoolsDocument.querySelector(".qa-forward-button").click(); + await waitForUrl(OTHER_URL, toolbox, browserTab, window); + + ok(true, "Clicking back and forward works!"); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_navigate_reload_button.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_navigate_reload_button.js new file mode 100644 index 0000000000..f34ad5c272 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_navigate_reload_button.js @@ -0,0 +1,37 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +function clickReload(devtoolsDocument) { + devtoolsDocument.querySelector(".qa-reload-button").click(); +} + +// Test that ensures the remote page is reloaded when the button is clicked +add_task(async function() { + await addTab("about:home"); + + const { document, tab, window } = await openAboutDebugging(); + + // go to This Firefox and inspect the new tab + info("Inspecting a new tab in This Firefox"); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + const { devtoolsDocument, devtoolsWindow } = await openAboutDevtoolsToolbox( + document, + tab, + window, + "about:home" + ); + + info("Clicking reload button and waiting for requests to complete"); + const toolbox = getToolbox(devtoolsWindow); + const refreshes = Promise.all([ + toolbox.target.once("navigate"), + toolbox.target.client.waitForRequestsToSettle(), + waitForRequestsToSettle(window.AboutDebugging.store), + ]); + clickReload(devtoolsDocument); + await refreshes; + + ok(true, "Clicked refresh; both page and devtools reloaded"); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_navigate_to_url.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_navigate_to_url.js new file mode 100644 index 0000000000..dad0ef9d8f --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_navigate_to_url.js @@ -0,0 +1,52 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const NEW_TAB_TITLE = "PAGE 2"; +const TAB_URL = "data:text/html,<title>PAGE</title>"; +const NEW_TAB_URL = `data:text/html,<title>${NEW_TAB_TITLE}</title>`; + +/** + * This test file ensures that the URL input for DebugTargetInfo navigates the target to + * the specified URL. + */ +add_task(async function() { + const { document, tab, window } = await openAboutDebugging(); + + info("Open a new background tab."); + const debug_tab = await addTab(TAB_URL, { background: true }); + + await selectThisFirefoxPage(document, window.AboutDebugging.store); + const devToolsToolbox = await openAboutDevtoolsToolbox( + document, + tab, + window, + "PAGE" + ); + const { devtoolsDocument, devtoolsTab, devtoolsWindow } = devToolsToolbox; + + const urlInput = devtoolsDocument.querySelector(".devtools-textinput"); + await synthesizeUrlKeyInput(devToolsToolbox, urlInput, NEW_TAB_URL); + + info("Test that the debug target navigated to the specified URL."); + const toolbox = getToolbox(devtoolsWindow); + await waitUntil( + () => + toolbox.target.url === NEW_TAB_URL && + debug_tab.linkedBrowser.currentURI.spec === NEW_TAB_URL + ); + ok(true, "Target navigated."); + ok(toolbox.target.title.includes(NEW_TAB_TITLE), "Target's title updated."); + is(urlInput.value, NEW_TAB_URL, "Input url updated."); + + await closeAboutDevtoolsToolbox(document, devtoolsTab, window); + + info("Remove the background tab"); + await removeTab(debug_tab); + await waitUntil(() => !findDebugTargetByText("NEW_TAB_TITLE", document)); + await waitForRequestsToSettle(window.AboutDebugging.store); + + info("Remove the about:debugging tab."); + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_performance.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_performance.js new file mode 100644 index 0000000000..35ad18661d --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_performance.js @@ -0,0 +1,63 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// This test can take a long time to run on debug builds. +requestLongerTimeout(2); + +/* import-globals-from helper-collapsibilities.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-collapsibilities.js", + this +); + +/** + * Check that graphs used by the old performance panel are correctly displayed. + */ +add_task(async function() { + info("Force all debug target panes to be expanded"); + prepareCollapsibilitiesTest(); + + info("Force old performance panel"); + await pushPref("devtools.performance.new-panel-enabled", false); + + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + const { devtoolsTab, devtoolsWindow } = await openAboutDevtoolsToolbox( + document, + tab, + window + ); + + info("Select performance panel"); + const toolbox = getToolbox(devtoolsWindow); + await toolbox.selectTool("performance"); + + // Retrieve shared helpers for the old performance panel. + const { + startRecording, + stopRecording, + } = require("devtools/client/performance/test/helpers/actions"); + const performancePanel = toolbox.getCurrentPanel(); + await startRecording(performancePanel); + + const { + idleWait, + } = require("devtools/client/performance/test/helpers/wait-utils"); + await idleWait(100); + + info("Stop recording"); + await stopRecording(performancePanel); + + info("Select the call tree"); + const { EVENTS, DetailsView, JsCallTreeView } = performancePanel.panelWin; + const rendered = once(JsCallTreeView, EVENTS.UI_JS_CALL_TREE_RENDERED); + await DetailsView.selectView("js-calltree"); + + info("Wait for the call tree to be rendered"); + await rendered; + + await closeAboutDevtoolsToolbox(document, devtoolsTab, window); + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_reload.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_reload.js new file mode 100644 index 0000000000..13dbf17934 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_reload.js @@ -0,0 +1,75 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// Test can run for a long time on debug platforms. +requestLongerTimeout(5); + +/* import-globals-from helper-collapsibilities.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-collapsibilities.js", + this +); + +const TOOLS = [ + "inspector", + "webconsole", + "jsdebugger", + "styleeditor", + "performance", + "memory", + "netmonitor", + "storage", + "accessibility", +]; + +/** + * Test whether about:devtools-toolbox display correctly after reloading. + */ +add_task(async function() { + info("Force all debug target panes to be expanded"); + prepareCollapsibilitiesTest(); + + for (const toolId of TOOLS) { + await testReloadAboutDevToolsToolbox(toolId); + } +}); + +async function testReloadAboutDevToolsToolbox(toolId) { + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + const { + devtoolsBrowser, + devtoolsTab, + devtoolsWindow, + } = await openAboutDevtoolsToolbox(document, tab, window); + + info(`Select tool: ${toolId}`); + const toolbox = getToolbox(devtoolsWindow); + await toolbox.selectTool(toolId); + + info("Wait for requests to settle before reloading"); + await toolbox.target.client.waitForRequestsToSettle(); + + info("Reload about:devtools-toolbox page"); + devtoolsBrowser.reload(); + await gDevTools.once("toolbox-ready"); + ok(true, "Toolbox is re-created again"); + + // Check that about:devtools-toolbox is still selected tab. See Bug 1570692. + is( + devtoolsBrowser, + gBrowser.selectedBrowser, + "about:devtools-toolbox is still selected" + ); + + info("Check whether about:devtools-toolbox page displays correctly"); + ok( + devtoolsBrowser.contentDocument.querySelector(".debug-target-info"), + "about:devtools-toolbox page displays correctly" + ); + + await closeAboutDevtoolsToolbox(document, devtoolsTab, window); + await removeTab(tab); +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_shortcuts.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_shortcuts.js new file mode 100644 index 0000000000..5ac7cf0394 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_shortcuts.js @@ -0,0 +1,109 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-collapsibilities.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-collapsibilities.js", + this +); + +/** + * Test shortcut keys on about:devtools-toolbox page. + */ +add_task(async function() { + info("Force all debug target panes to be expanded"); + prepareCollapsibilitiesTest(); + + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + const { + devtoolsBrowser, + devtoolsTab, + devtoolsWindow, + } = await openAboutDevtoolsToolbox(document, tab, window); + + info("Check whether the shortcut keys which opens devtools is disabled"); + await assertShortcutKeys(devtoolsBrowser, false); + + info("Switch to the inspector programmatically"); + const toolbox = getToolbox(devtoolsWindow); + await toolbox.selectTool("inspector"); + + info( + "Use the Webconsole keyboard shortcut and wait for the panel to be selected" + ); + const onToolReady = toolbox.once("webconsole-ready"); + EventUtils.synthesizeKey( + "K", + { + accelKey: true, + shiftKey: !navigator.userAgent.match(/Mac/), + altKey: navigator.userAgent.match(/Mac/), + }, + devtoolsWindow + ); + await onToolReady; + + info("Force to select about:debugging page"); + await updateSelectedTab(gBrowser, tab, window.AboutDebugging.store); + + info("Check whether the shortcut keys which opens devtools is enabled"); + await assertShortcutKeys(tab.linkedBrowser, true); + + await closeAboutDevtoolsToolbox(document, devtoolsTab, window); + await removeTab(tab); +}); + +async function assertShortcutKeys(browser, shouldBeEnabled) { + await assertShortcutKey(browser.contentWindow, "VK_F12", {}, shouldBeEnabled); + await assertShortcutKey( + browser.contentWindow, + "I", + { + accelKey: true, + shiftKey: !navigator.userAgent.match(/Mac/), + altKey: navigator.userAgent.match(/Mac/), + }, + shouldBeEnabled + ); +} + +async function assertShortcutKey(win, key, modifiers, shouldBeEnabled) { + info(`Assert shortcut key [${key}]`); + + if (shouldBeEnabled) { + await assertShortcutKeyEnabled(win, key, modifiers); + } else { + await assertShortcutKeyDisabled(win, key, modifiers); + } +} + +async function assertShortcutKeyDisabled(win, key, modifiers) { + let isReadyCalled = false; + const toolboxListener = () => { + isReadyCalled = true; + }; + gDevTools.on("toolbox-ready", toolboxListener); + + EventUtils.synthesizeKey(key, modifiers, win); + await wait(1000); + ok(!isReadyCalled, `Devtools should not be opened by ${key}`); + + gDevTools.off("toolbox-ready", toolboxListener); +} + +async function assertShortcutKeyEnabled(win, key, modifiers) { + // Open devtools + const onToolboxReady = gDevTools.once("toolbox-ready"); + EventUtils.synthesizeKey(key, modifiers, win); + await onToolboxReady; + ok(true, `Devtools should be opened by ${key}`); + + // Close devtools + const onToolboxDestroyed = gDevTools.once("toolbox-destroyed"); + EventUtils.synthesizeKey(key, modifiers, win); + await onToolboxDestroyed; + ok(true, `Devtopls should be closed by ${key}`); +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_splitconsole_key.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_splitconsole_key.js new file mode 100644 index 0000000000..e70b95379f --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_splitconsole_key.js @@ -0,0 +1,44 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-collapsibilities.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-collapsibilities.js", + this +); + +/** + * Test that the split console key shortcut works on about:devtools-toolbox. + */ +add_task(async function() { + info("Force all debug target panes to be expanded"); + prepareCollapsibilitiesTest(); + + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + const { devtoolsTab, devtoolsWindow } = await openAboutDevtoolsToolbox( + document, + tab, + window + ); + + // Select any tool that is not the Webconsole, since we will assert the split-console. + info("Select inspector tool"); + const toolbox = getToolbox(devtoolsWindow); + await toolbox.selectTool("inspector"); + + info("Press Escape and wait for the split console to be opened"); + EventUtils.synthesizeKey("VK_ESCAPE", {}, devtoolsWindow); + await waitUntil(() => toolbox.isSplitConsoleFocused()); + ok(true, "Split console is opened and focused"); + + info("Press Escape again and wait for the split console to be closed"); + EventUtils.synthesizeKey("VK_ESCAPE", {}, devtoolsWindow); + await waitUntil(() => !toolbox.isSplitConsoleFocused()); + ok(true, "Split console is closed and no longer focused"); + + await closeAboutDevtoolsToolbox(document, devtoolsTab, window); + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_target_destroyed.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_target_destroyed.js new file mode 100644 index 0000000000..428bbe0718 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_target_destroyed.js @@ -0,0 +1,39 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// Test that the expected supported categories are displayed for USB runtimes. +add_task(async function() { + const targetTab = await addTab("about:home"); + + const { document, tab, window } = await openAboutDebugging(); + + // go to This Firefox and inspect the new tab + info("Inspecting a new tab in This Firefox"); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + const { + devtoolsDocument, + devtoolsTab, + devtoolsWindow, + } = await openAboutDevtoolsToolbox(document, tab, window, "about:home"); + const targetUrl = devtoolsDocument.querySelector(".devtools-textinput"); + ok( + targetUrl.value.includes("about:home"), + "about:devtools-toolbox is open for the target" + ); + + // close the inspected tab and check that error page is shown + info("removing the inspected tab"); + await removeTab(targetTab); + await waitUntil(() => + devtoolsWindow.document.querySelector(".qa-error-page") + ); + + info("closing the toolbox"); + await removeTab(devtoolsTab); + await waitUntil(() => !findDebugTargetByText("Toolbox -", document)); + + info("removing about:debugging tab"); + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_tooltip_markupview.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_tooltip_markupview.js new file mode 100644 index 0000000000..07e021a349 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_devtoolstoolbox_tooltip_markupview.js @@ -0,0 +1,105 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// Test can run for a long time on asan or debug platforms. +requestLongerTimeout(3); + +/* import-globals-from helper-collapsibilities.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-collapsibilities.js", + this +); + +/** + * Test tooltip of markup view on about:devtools-toolbox page. + */ +add_task(async function() { + info("Force all debug target panes to be expanded"); + prepareCollapsibilitiesTest(); + + info("Turn on devtools.chrome.enabled to show event badges"); + await pushPref("devtools.chrome.enabled", true); + + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + const { + devtoolsDocument, + devtoolsTab, + devtoolsWindow, + } = await openAboutDevtoolsToolbox(document, tab, window); + + info("Select inspector tool"); + const toolbox = getToolbox(devtoolsWindow); + await toolbox.selectTool("inspector"); + + const inspector = toolbox.getPanel("inspector"); + const markupDocument = inspector.markup.doc; + const eventBadge = markupDocument.querySelector( + ".inspector-badge.interactive" + ); + + info( + "Check tooltip visibility after clicking on an element in the markup view" + ); + await checkTooltipVisibility(inspector, eventBadge, markupDocument.body); + + info( + "Check tooltip visibility after clicking on an element in the DevTools document" + ); + await checkTooltipVisibility( + inspector, + eventBadge, + devtoolsDocument.querySelector(".debug-target-info") + ); + + info( + "Check tooltip visibility after clicking on an element in the root document" + ); + const rootDocument = devtoolsWindow.windowRoot.ownerGlobal.document; + await checkTooltipVisibility( + inspector, + eventBadge, + rootDocument.querySelector("#titlebar") + ); + + await closeAboutDevtoolsToolbox(document, devtoolsTab, window); + await removeTab(tab); +}); + +async function checkTooltipVisibility( + inspector, + elementForShowing, + elementForHiding +) { + info("Show event tooltip"); + elementForShowing.click(); + const tooltip = inspector.markup.eventDetailsTooltip; + await tooltip.once("shown"); + is( + tooltip.container.classList.contains("tooltip-visible"), + true, + "The tooltip should be shown" + ); + + info("Hide event tooltip"); + EventUtils.synthesizeMouse( + elementForHiding, + 1, + 1, + {}, + elementForHiding.ownerGlobal + ); + await tooltip.once("hidden"); + is( + tooltip.container.classList.contains("tooltip-visible"), + false, + "Tooltip should be hidden" + ); + + if (inspector._updateProgress) { + info("Need to wait for the inspector to update"); + await inspector.once("inspector-updated"); + } +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_fenix_runtime_display.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_fenix_runtime_display.js new file mode 100644 index 0000000000..ae922d8b9d --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_fenix_runtime_display.js @@ -0,0 +1,141 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const RUNTIME_ID = "1337id"; +const DEVICE_NAME = "Fancy Phone"; +const SERVER_RUNTIME_NAME = "Mozilla Firefox"; +const ADB_RUNTIME_NAME = "Firefox Preview"; +const SERVER_VERSION = "v7.3.31"; +const ADB_VERSION = "v1.3.37"; + +const FENIX_RELEASE_ICON_SRC = + "chrome://devtools/skin/images/aboutdebugging-fenix.svg"; +const FENIX_NIGHTLY_ICON_SRC = + "chrome://devtools/skin/images/aboutdebugging-fenix-nightly.svg"; + +/** + * Check that Fenix runtime information is correctly displayed in about:debugging. + */ +add_task(async function() { + const mocks = new Mocks(); + mocks.createUSBRuntime(RUNTIME_ID, { + deviceName: DEVICE_NAME, + isFenix: true, + name: SERVER_RUNTIME_NAME, + shortName: ADB_RUNTIME_NAME, + versionName: ADB_VERSION, + version: SERVER_VERSION, + }); + + // open a remote runtime page + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + mocks.emitUSBUpdate(); + await connectToRuntime(DEVICE_NAME, document); + await selectRuntime(DEVICE_NAME, ADB_RUNTIME_NAME, document); + + info("Check that the runtime information is displayed as expected"); + const runtimeInfo = document.querySelector(".qa-runtime-name"); + ok(runtimeInfo, "Runtime info for the Fenix runtime is displayed"); + const runtimeInfoText = runtimeInfo.textContent; + + ok(runtimeInfoText.includes(ADB_RUNTIME_NAME), "Name is the ADB name"); + ok( + !runtimeInfoText.includes(SERVER_RUNTIME_NAME), + "Name does not include the server name" + ); + + ok(runtimeInfoText.includes(ADB_VERSION), "Version contains the ADB version"); + ok( + !runtimeInfoText.includes(SERVER_VERSION), + "Version does not contain the server version" + ); + + const runtimeIcon = document.querySelector(".qa-runtime-icon"); + is( + runtimeIcon.src, + FENIX_RELEASE_ICON_SRC, + "The runtime icon is the Fenix icon" + ); + + info("Remove USB runtime"); + mocks.removeUSBRuntime(RUNTIME_ID); + mocks.emitUSBUpdate(); + await waitUntilUsbDeviceIsUnplugged(DEVICE_NAME, document); + + await removeTab(tab); +}); + +/** + * Check that Fenix runtime information is correctly displayed in about:devtools-toolbox. + */ +add_task(async function() { + // We use a real local client combined with a mocked USB runtime to be able to open + // about:devtools-toolbox on a real target. + const clientWrapper = await createLocalClientWrapper(); + + const mocks = new Mocks(); + mocks.createUSBRuntime(RUNTIME_ID, { + channel: "nightly", + clientWrapper: clientWrapper, + deviceName: DEVICE_NAME, + isFenix: true, + name: SERVER_RUNTIME_NAME, + shortName: ADB_RUNTIME_NAME, + versionName: ADB_VERSION, + version: SERVER_VERSION, + }); + + // open a remote runtime page + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + mocks.emitUSBUpdate(); + info("Select the runtime page for the USB runtime"); + const onRequestSuccess = waitForRequestsSuccess(window.AboutDebugging.store); + await connectToRuntime(DEVICE_NAME, document); + await selectRuntime(DEVICE_NAME, ADB_RUNTIME_NAME, document); + info( + "Wait for requests to finish the USB runtime is backed by a real local client" + ); + await onRequestSuccess; + + info("Wait for the about:debugging target to be available"); + await waitUntil(() => findDebugTargetByText("about:debugging", document)); + const { devtoolsDocument, devtoolsTab } = await openAboutDevtoolsToolbox( + document, + tab, + window + ); + + const runtimeInfo = devtoolsDocument.querySelector(".qa-runtime-info"); + const runtimeInfoText = runtimeInfo.textContent; + ok( + runtimeInfoText.includes(ADB_RUNTIME_NAME), + "Name is the ADB runtime name" + ); + ok(runtimeInfoText.includes(ADB_VERSION), "Version is the ADB version"); + + const runtimeIcon = devtoolsDocument.querySelector(".qa-runtime-icon"); + is( + runtimeIcon.src, + FENIX_NIGHTLY_ICON_SRC, + "The runtime icon is the Fenix icon" + ); + + info("Wait for all pending requests to settle on the DevToolsClient"); + await clientWrapper.client.waitForRequestsToSettle(); + + await closeAboutDevtoolsToolbox(document, devtoolsTab, window); + + info("Remove USB runtime"); + mocks.removeUSBRuntime(RUNTIME_ID); + mocks.emitUSBUpdate(); + await waitUntilUsbDeviceIsUnplugged(DEVICE_NAME, document); + + await removeTab(tab); + await clientWrapper.close(); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_hidden_addons.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_hidden_addons.js new file mode 100644 index 0000000000..5f1811d563 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_hidden_addons.js @@ -0,0 +1,106 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// Test that system and hidden addons are only displayed when the showSystemAddons +// preferences is true. + +const SYSTEM_ADDON = createAddonData({ + id: "system", + name: "System Addon", + isSystem: true, + hidden: true, +}); +const HIDDEN_ADDON = createAddonData({ + id: "hidden", + name: "Hidden Addon", + isSystem: false, + hidden: true, +}); +const NORMAL_ADDON = createAddonData({ + id: "normal", + name: "Normal Addon", + isSystem: false, + hidden: false, +}); + +add_task(async function testShowSystemAddonsTrue() { + info("Test with showHiddenAddons set to true"); + await testAddonsDisplay(true); + + info("Test with showHiddenAddons set to false"); + await testAddonsDisplay(false); +}); + +async function testAddonsDisplay(showHidden) { + const thisFirefoxClient = setupThisFirefoxMock(); + thisFirefoxClient.listAddons = () => [ + SYSTEM_ADDON, + HIDDEN_ADDON, + NORMAL_ADDON, + ]; + + info("Set showHiddenAddons to " + showHidden); + await pushPref("devtools.aboutdebugging.showHiddenAddons", showHidden); + + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + const hasSystemAddon = !!findDebugTargetByText("System Addon", document); + const hasHiddenAddon = !!findDebugTargetByText("Hidden Addon", document); + const hasInstalledAddon = !!findDebugTargetByText("Normal Addon", document); + is( + hasSystemAddon, + showHidden, + "System addon display is correct when showHiddenAddons is " + showHidden + ); + is( + hasHiddenAddon, + showHidden, + "Hidden addon display is correct when showHiddenAddons is " + showHidden + ); + ok(hasInstalledAddon, "Installed addon is always displayed"); + + await removeTab(tab); +} + +// Create a basic mock for this-firefox client, and setup a runtime-client-factory mock +// to return our mock client when needed. +function setupThisFirefoxMock() { + const runtimeClientFactoryMock = createRuntimeClientFactoryMock(); + const thisFirefoxClient = createThisFirefoxClientMock(); + runtimeClientFactoryMock.createClientForRuntime = runtime => { + const { + RUNTIMES, + } = require("devtools/client/aboutdebugging/src/constants"); + if (runtime.id === RUNTIMES.THIS_FIREFOX) { + return thisFirefoxClient; + } + throw new Error("Unexpected runtime id " + runtime.id); + }; + + info("Enable mocks"); + enableRuntimeClientFactoryMock(runtimeClientFactoryMock); + registerCleanupFunction(() => { + disableRuntimeClientFactoryMock(); + }); + + return thisFirefoxClient; +} + +// Create basic addon data as the DevToolsClient would return it (debuggable and non +// temporary). +function createAddonData({ id, name, isSystem, hidden }) { + return { + actor: `actorid-${id}`, + hidden, + iconURL: `moz-extension://${id}/icon-url.png`, + id, + manifestURL: `moz-extension://${id}/manifest-url.json`, + name, + isSystem, + temporarilyInstalled: false, + debuggable: true, + }; +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_message_close.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_message_close.js new file mode 100644 index 0000000000..34a854d111 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_message_close.js @@ -0,0 +1,82 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-addons.js */ +Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-addons.js", this); + +const EXTENSION_NAME = "Temporary web extension"; +const EXTENSION_ID = "test-devtools@mozilla.org"; + +// Test that Message component can be closed with the X button +add_task(async function() { + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + info("Check that the message can be closed with icon"); + let warningMessage = await installExtensionWithWarning(document); + await testCloseMessageWithIcon(warningMessage, document); + await removeTemporaryExtension(EXTENSION_NAME, document); + + info("Check that the message can be closed with the button around the icon"); + warningMessage = await installExtensionWithWarning(document); + await testCloseMessageWithButton(warningMessage, document); + await removeTemporaryExtension(EXTENSION_NAME, document); + + await removeTab(tab); +}); + +async function testCloseMessageWithIcon(warningMessage, doc) { + const closeIcon = warningMessage.querySelector( + ".qa-message-button-close-icon" + ); + ok(!!closeIcon, "The warning message has a close icon"); + + info("Closing the message and waiting for it to disappear"); + closeIcon.click(); + + const target = findDebugTargetByText(EXTENSION_NAME, doc); + await waitUntil(() => target.querySelector(".qa-message") === null); +} + +async function testCloseMessageWithButton(warningMessage, doc) { + const closeButton = warningMessage.querySelector( + ".qa-message-button-close-button" + ); + ok(!!closeButton, "The warning message has a close button"); + + info("Click on the button and wait for the message to disappear"); + EventUtils.synthesizeMouse(closeButton, 1, 1, {}, doc.defaultView); + + const target = findDebugTargetByText(EXTENSION_NAME, doc); + await waitUntil(() => target.querySelector(".qa-message") === null); +} + +async function installExtensionWithWarning(doc) { + await pushPref("extensions.webextensions.warnings-as-errors", false); + await installTemporaryExtensionFromXPI( + { + id: EXTENSION_ID, + name: EXTENSION_NAME, + extraProperties: { + // This property is not expected in the manifest and should trigger a warning! + wrongProperty: {}, + }, + }, + doc + ); + await SpecialPowers.popPrefEnv(); + + info("Wait until a debug target item appears"); + await waitUntil(() => findDebugTargetByText(EXTENSION_NAME, doc)); + + const target = findDebugTargetByText(EXTENSION_NAME, doc); + const warningMessage = target.querySelector(".qa-message"); + ok( + !!warningMessage, + "A warning message is displayed for the installed addon" + ); + + return warningMessage; +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_navigate.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_navigate.js new file mode 100644 index 0000000000..2aab4c6999 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_navigate.js @@ -0,0 +1,113 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-collapsibilities.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-collapsibilities.js", + this +); + +/** + * Check that navigating from This Firefox to Connect and back to This Firefox works and + * does not leak. + */ + +const TAB_URL_1 = "data:text/html,<title>TAB1</title>"; +const TAB_URL_2 = "data:text/html,<title>TAB2</title>"; + +add_task(async function() { + info("Force all debug target panes to be expanded"); + prepareCollapsibilitiesTest(); + + const { document, tab, window } = await openAboutDebugging(); + const AboutDebugging = window.AboutDebugging; + await selectThisFirefoxPage(document, AboutDebugging.store); + + const connectSidebarItem = findSidebarItemByText("Setup", document); + const connectLink = connectSidebarItem.querySelector(".qa-sidebar-link"); + ok(connectSidebarItem, "Found the Connect sidebar item"); + + const thisFirefoxString = getThisFirefoxString(window); + const thisFirefoxSidebarItem = findSidebarItemByText( + thisFirefoxString, + document + ); + const thisFirefoxLink = thisFirefoxSidebarItem.querySelector( + ".qa-sidebar-link" + ); + ok(thisFirefoxSidebarItem, "Found the ThisFirefox sidebar item"); + ok( + isSidebarItemSelected(thisFirefoxSidebarItem), + "ThisFirefox sidebar item is selected by default" + ); + + info("Open a new background tab TAB1"); + const backgroundTab1 = await addTab(TAB_URL_1, { background: true }); + + info("Wait for the tab to appear in the debug targets with the correct name"); + await waitUntil(() => findDebugTargetByText("TAB1", document)); + + await waitForRequestsToSettle(AboutDebugging.store); + info("Click on the Connect item in the sidebar"); + connectLink.click(); + + info("Wait until Connect page is displayed"); + await waitUntil(() => document.querySelector(".qa-connect-page")); + // we need to wait here because the sidebar isn't updated after mounting the page + info("Wait until Connect sidebar item is selected"); + await waitUntil(() => isSidebarItemSelected(connectSidebarItem)); + ok( + !document.querySelector(".qa-runtime-page"), + "Runtime page no longer rendered" + ); + + info("Open a new tab which should be listed when we go back to This Firefox"); + const backgroundTab2 = await addTab(TAB_URL_2, { background: true }); + + info("Click on the ThisFirefox item in the sidebar"); + const requestsSuccess = waitForRequestsSuccess(AboutDebugging.store); + thisFirefoxLink.click(); + + info("Wait for all target requests to complete"); + await requestsSuccess; + + info("Wait until ThisFirefox page is displayed"); + await waitUntil(() => document.querySelector(".qa-runtime-page")); + ok( + isSidebarItemSelected(thisFirefoxSidebarItem), + "ThisFirefox sidebar item is selected again" + ); + ok( + !document.querySelector(".qa-connect-page"), + "Connect page no longer rendered" + ); + + info("TAB2 should already be displayed in the debug targets"); + await waitUntil(() => findDebugTargetByText("TAB2", document)); + + info("Remove first background tab"); + await removeTab(backgroundTab1); + + info( + "Check TAB1 disappears, meaning ThisFirefox client is correctly connected" + ); + await waitUntil(() => !findDebugTargetByText("TAB1", document)); + + info("Remove second background tab"); + await removeTab(backgroundTab2); + + info( + "Check TAB2 disappears, meaning ThisFirefox client is correctly connected" + ); + await waitUntil(() => !findDebugTargetByText("TAB2", document)); + + await waitForRequestsToSettle(AboutDebugging.store); + + await removeTab(tab); +}); + +function isSidebarItemSelected(item) { + return item.classList.contains("qa-sidebar-item-selected"); +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_persist_connection.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_persist_connection.js new file mode 100644 index 0000000000..66b7cd7dfc --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_persist_connection.js @@ -0,0 +1,91 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const NETWORK_RUNTIME_HOST = "localhost:6080"; +const NETWORK_RUNTIME_APP_NAME = "TestNetworkApp"; +const USB_RUNTIME_ID = "test-runtime-id"; +const USB_DEVICE_NAME = "test device name"; +const USB_APP_NAME = "TestApp"; + +// Test that remote runtime connections are persisted across about:debugging reloads. +add_task(async function() { + const mocks = new Mocks(); + + info("Test with a USB runtime"); + const usbClient = mocks.createUSBRuntime(USB_RUNTIME_ID, { + name: USB_APP_NAME, + deviceName: USB_DEVICE_NAME, + }); + + await testRemoteClientPersistConnection(mocks, { + client: usbClient, + id: USB_RUNTIME_ID, + runtimeName: USB_APP_NAME, + sidebarName: USB_DEVICE_NAME, + type: "usb", + }); + + info("Test with a network runtime"); + const networkClient = mocks.createNetworkRuntime(NETWORK_RUNTIME_HOST, { + name: NETWORK_RUNTIME_APP_NAME, + }); + + await testRemoteClientPersistConnection(mocks, { + client: networkClient, + id: NETWORK_RUNTIME_HOST, + runtimeName: NETWORK_RUNTIME_APP_NAME, + sidebarName: NETWORK_RUNTIME_HOST, + type: "network", + }); +}); + +async function testRemoteClientPersistConnection( + mocks, + { client, id, runtimeName, sidebarName, type } +) { + info("Open about:debugging and connect to the test runtime"); + let { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + await connectToRuntime(sidebarName, document); + await selectRuntime(sidebarName, runtimeName, document); + + info("Reload about:debugging"); + document = await reloadAboutDebugging(tab); + + info("Wait until the remote runtime appears as connected"); + await waitUntil(() => { + const sidebarItem = findSidebarItemByText(sidebarName, document); + return sidebarItem && !sidebarItem.querySelector(".qa-connect-button"); + }); + + info("Wait until the remote runtime page is selected"); + await waitUntil(() => { + const runtimeInfo = document.querySelector(".qa-runtime-name"); + return runtimeInfo && runtimeInfo.textContent.includes(runtimeName); + }); + + // Remove the runtime without emitting an update. + // This is what happens today when we simply close Firefox for Android. + info("Remove the runtime from the list of remote runtimes"); + mocks.removeRuntime(id); + + info( + "Emit 'closed' on the client and wait for the sidebar item to disappear" + ); + client._eventEmitter.emit("closed"); + if (type === "usb") { + await waitUntilUsbDeviceIsUnplugged(sidebarName, document); + } else { + await waitUntil( + () => + !findSidebarItemByText(sidebarName, document) && + !findSidebarItemByText(runtimeName, document) + ); + } + + info("Remove the tab"); + await removeTab(tab); +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_process_category.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_process_category.js new file mode 100644 index 0000000000..f86aea32fa --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_process_category.js @@ -0,0 +1,53 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const CATEGORY_NAME = "Processes"; +const RUNTIME_ID = "test-runtime-id"; +const RUNTIME_DEVICE_NAME = "test device name"; +const RUNTIME_APP_NAME = "TestApp"; + +// Test whether process category exists by the runtime type. +add_task(async function() { + await pushPref("devtools.aboutdebugging.process-debugging", true); + + const mocks = new Mocks(); + + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + const usbRuntime = mocks.createUSBRuntime(RUNTIME_ID, { + deviceName: RUNTIME_DEVICE_NAME, + name: RUNTIME_APP_NAME, + }); + usbRuntime.getMainProcess = () => { + return { + getTarget: () => { + return { actorID: 0 }; + }, + }; + }; + mocks.emitUSBUpdate(); + + info("Check the process category existence for this firefox"); + ok( + !getDebugTargetPane(CATEGORY_NAME, document), + "Process category should not display for this firefox" + ); + + info("Check the process category existence for USB runtime"); + await connectToRuntime(RUNTIME_DEVICE_NAME, document); + await selectRuntime(RUNTIME_DEVICE_NAME, RUNTIME_APP_NAME, document); + ok( + getDebugTargetPane(CATEGORY_NAME, document), + "Process category should display for USB runtime" + ); + + info("Remove USB runtime"); + mocks.removeUSBRuntime(RUNTIME_ID); + mocks.emitUSBUpdate(); + await waitUntilUsbDeviceIsUnplugged(RUNTIME_DEVICE_NAME, document); + + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_process_main.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_process_main.js new file mode 100644 index 0000000000..29220f2f57 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_process_main.js @@ -0,0 +1,97 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-collapsibilities.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-collapsibilities.js", + this +); + +const MAIN_PROCESS_NAME = "Main Process"; +const MAIN_PROCESS_DESCRIPTION = "Main Process for the target browser"; +const MULTIPROCESS_TOOLBOX_NAME = "Multiprocess Toolbox"; +const MULTIPROCESS_TOOLBOX_DESCRIPTION = + "Main Process and Content Processes for the target browser"; + +const RUNTIME_ID = "test-runtime-id"; +const RUNTIME_DEVICE_NAME = "test device name"; +const RUNTIME_APP_NAME = "TestApp"; + +// Test for main process. +add_task(async function() { + info("Test the regular main process target"); + await pushPref("devtools.browsertoolbox.fission", false); + await testMainProcessTarget(MAIN_PROCESS_NAME, MAIN_PROCESS_DESCRIPTION); + + info("Test the main process target with devtools.browsertoolbox.fission"); + await pushPref("devtools.browsertoolbox.fission", true); + await testMainProcessTarget( + MULTIPROCESS_TOOLBOX_NAME, + MULTIPROCESS_TOOLBOX_DESCRIPTION + ); +}); + +async function testMainProcessTarget(name, description) { + await pushPref("devtools.aboutdebugging.process-debugging", true); + const mocks = new Mocks(); + + const { document, tab, window } = await openAboutDebugging(); + + const usbRuntime = mocks.createUSBRuntime(RUNTIME_ID, { + deviceName: RUNTIME_DEVICE_NAME, + name: RUNTIME_APP_NAME, + }); + + // Note: about:debugging assumes that the main process has the id 0 and will + // rely on it to create the about:devtools-toolbox URL. + // Only check that about:debugging doesn't create a target unnecessarily. + usbRuntime.getMainProcess = () => { + return { + getTarget: () => { + ok(false, "about:debugging should not create the main process target"); + }, + }; + }; + mocks.emitUSBUpdate(); + + info("Select USB runtime"); + await connectToRuntime(RUNTIME_DEVICE_NAME, document); + await selectRuntime(RUNTIME_DEVICE_NAME, RUNTIME_APP_NAME, document); + + info("Check debug target item of the main process"); + await waitUntil(() => findDebugTargetByText(name, document)); + const mainProcessItem = findDebugTargetByText(name, document); + ok(mainProcessItem, "Debug target item of the main process should display"); + ok( + mainProcessItem.textContent.includes(description), + "Debug target item of the main process should contains the description" + ); + + info("Inspect main process"); + const { devtoolsTab, devtoolsWindow } = await openAboutDevtoolsToolbox( + document, + tab, + window, + name, + false + ); + + const url = new window.URL(devtoolsWindow.location.href); + const processID = url.searchParams.get("id"); + is(processID, "0", "Correct process id"); + const remoteID = url.searchParams.get("remoteId"); + is(remoteID, `${RUNTIME_ID}-usb`, "Correct remote runtime id"); + + info("Remove USB runtime"); + mocks.removeUSBRuntime(RUNTIME_ID); + mocks.emitUSBUpdate(); + await waitUntilUsbDeviceIsUnplugged(RUNTIME_DEVICE_NAME, document); + + // Note that we can't use `closeAboutDevtoolsToolbox` because the toolbox init + // is expected to fail, and we are redirected to the error page. + await removeTab(devtoolsTab); + await waitUntil(() => !findDebugTargetByText("Toolbox - ", document)); + await removeTab(tab); +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_process_main_local.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_process_main_local.js new file mode 100644 index 0000000000..74e143ed6b --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_process_main_local.js @@ -0,0 +1,44 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-collapsibilities.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-collapsibilities.js", + this +); + +// Test for main process against This Firefox. +// +// The main added value for this test is to check that listing processes +// and opening a toolbox targeting a process works, even though debugging +// the main process of This Firefox is not really supported. +add_task(async function() { + await pushPref("devtools.aboutdebugging.process-debugging", true); + await pushPref("devtools.aboutdebugging.test-local-process-debugging", true); + // Disable Multiprocess Browser Toolbox for now as it introduces exceptions + await pushPref("devtools.browsertoolbox.fission", false); + + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + info("Check debug target item of the main process"); + const mainProcessItem = findDebugTargetByText("Main Process", document); + ok(mainProcessItem, "Debug target item of the main process should display"); + ok( + mainProcessItem.textContent.includes("Main Process for the target browser"), + "Debug target item of the main process should contains the description" + ); + + info("Inspect main process and wait for DevTools to open"); + const { devtoolsTab } = await openAboutDevtoolsToolbox( + document, + tab, + window, + "Main Process" + ); + + await closeAboutDevtoolsToolbox(document, devtoolsTab, window); + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_profiler_dialog.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_profiler_dialog.js new file mode 100644 index 0000000000..e679a19f4a --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_profiler_dialog.js @@ -0,0 +1,70 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/** + * Test opening and closing the profiler dialog. + */ +add_task(async function() { + // enable USB devices mocks + const mocks = new Mocks(); + const usbClient = mocks.createUSBRuntime("1337id", { + deviceName: "Fancy Phone", + name: "Lorem ipsum", + }); + + const { document, tab, window } = await openAboutDebugging(); + + mocks.emitUSBUpdate(); + await connectToRuntime("Fancy Phone", document); + await selectRuntime("Fancy Phone", "Lorem ipsum", document); + + info("Open the profiler dialog"); + await openProfilerDialog(usbClient, document); + assertDialogVisible(document); + + info("Click on the close button and wait until the dialog disappears"); + const closeDialogButton = document.querySelector(".qa-profiler-dialog-close"); + closeDialogButton.click(); + await waitUntil(() => !document.querySelector(".qa-profiler-dialog")); + assertDialogHidden(document); + + info("Open the profiler dialog again"); + await openProfilerDialog(usbClient, document); + assertDialogVisible(document); + + info("Click on the mask element and wait until the dialog disappears"); + const mask = document.querySelector(".qa-profiler-dialog-mask"); + EventUtils.synthesizeMouse(mask, 5, 5, {}, window); + await waitUntil(() => !document.querySelector(".qa-profiler-dialog")); + assertDialogHidden(document); + + info("Open the profiler dialog again"); + await openProfilerDialog(usbClient, document); + assertDialogVisible(document); + + info("Navigate to this-firefox and wait until the dialog disappears"); + document.location.hash = "#/runtime/this-firefox"; + await waitUntil(() => !document.querySelector(".qa-profiler-dialog")); + assertDialogHidden(document); + + info("Select the remote runtime again, check the dialog is still hidden"); + await selectRuntime("Fancy Phone", "Lorem ipsum", document); + assertDialogHidden(document); + + await removeTab(tab); +}); + +function assertDialogVisible(doc) { + ok(doc.querySelector(".qa-profiler-dialog"), "Dialog is displayed"); + ok(doc.querySelector(".qa-profiler-dialog-mask"), "Dialog mask is displayed"); +} + +function assertDialogHidden(doc) { + ok(!document.querySelector(".qa-profiler-dialog"), "Dialog is removed"); + ok( + !document.querySelector(".qa-profiler-dialog-mask"), + "Dialog mask is removed" + ); +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_real_usb_runtime_page_runtime_info.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_real_usb_runtime_page_runtime_info.js new file mode 100644 index 0000000000..a69bbe3d88 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_real_usb_runtime_page_runtime_info.js @@ -0,0 +1,62 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-real-usb.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-real-usb.js", + this +); + +// Test that runtime info of USB runtime appears on main pane. +// Documentation for real usb tests in /documentation/TESTS_REAL_DEVICES.md +add_task(async function() { + if (!isAvailable()) { + ok(true, "Real usb runtime test is not available"); + return; + } + + const { document, tab } = await openAboutDebuggingWithADB(); + + const expectedRuntime = await getExpectedRuntime(); + const { runtimeDetails, sidebarInfo } = expectedRuntime; + + info("Connect a USB runtime"); + await Promise.race([ + connectToRuntime(sidebarInfo.deviceName, document), + /* eslint-disable mozilla/no-arbitrary-setTimeout */ + new Promise(resolve => + setTimeout(() => { + ok( + false, + "Failed to connect, did you disable the connection prompt for this runtime?" + ); + resolve(); + }, 5000) + ), + /* eslint-enable mozilla/no-arbitrary-setTimeout */ + ]); + + info("Select a USB runtime"); + await selectRuntime( + sidebarInfo.deviceName, + runtimeDetails.info.name, + document + ); + + info("Check that runtime info is properly displayed"); + const runtimeInfo = document.querySelector(".qa-runtime-name"); + ok(runtimeInfo, "Runtime info is displayed"); + const runtimeInfoText = runtimeInfo.textContent; + ok( + runtimeInfoText.includes(runtimeDetails.info.name), + "Runtime info shows the correct runtime name: " + runtimeInfoText + ); + ok( + runtimeInfoText.includes(runtimeDetails.info.version), + "Runtime info shows the correct version number: " + runtimeInfoText + ); + + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_real_usb_sidebar.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_real_usb_sidebar.js new file mode 100644 index 0000000000..be0253be0c --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_real_usb_sidebar.js @@ -0,0 +1,34 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-real-usb.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-real-usb.js", + this +); + +// Test that USB runtimes appear from the sidebar. +// Documentation for real usb tests in /documentation/TESTS_REAL_DEVICES.md +add_task(async function() { + if (!isAvailable()) { + ok(true, "Real usb runtime test is not available"); + return; + } + + const { document, tab } = await openAboutDebuggingWithADB(); + + for (const { sidebarInfo } of await getExpectedRuntimeAll()) { + const { deviceName, shortName } = sidebarInfo; + await waitUntil(() => findSidebarItemByText(deviceName, document)); + const usbRuntimeSidebarItem = findSidebarItemByText(deviceName, document); + ok( + usbRuntimeSidebarItem.textContent.includes(shortName), + "The device name and short name of the usb runtime are visible in sidebar item " + + `[${usbRuntimeSidebarItem.textContent}]` + ); + } + + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_routes.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_routes.js new file mode 100644 index 0000000000..0858edd33a --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_routes.js @@ -0,0 +1,114 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/** + * Test that the initial route is /setup + */ +add_task(async function() { + info("Check root route redirects to setup page"); + const { document, tab } = await openAboutDebugging(); + is(document.location.hash, "#/setup"); + + await removeTab(tab); +}); + +/** + * Test that the routes in about:debugging show the proper views and document.title + */ +add_task(async function() { + // enable USB devices mocks + const mocks = new Mocks(); + + const { document, tab } = await openAboutDebugging(); + + info("Check 'This Firefox' route"); + document.location.hash = "#/runtime/this-firefox"; + await waitUntil(() => document.querySelector(".qa-runtime-page")); + const infoLabel = document.querySelector(".qa-runtime-name").textContent; + // NOTE: when using USB Mocks, we see only "Firefox" as the device name + ok(infoLabel.includes("Firefox"), "Runtime is displayed as Firefox"); + ok(!infoLabel.includes(" on "), "Runtime is not associated to any device"); + is( + document.title, + "Debugging - Runtime / this-firefox", + "Checking title for 'runtime' page" + ); + + info("Check 'Setup' page"); + document.location.hash = "#/setup"; + await waitUntil(() => document.querySelector(".qa-connect-page")); + ok(true, "Setup page has been shown"); + is(document.title, "Debugging - Setup", "Checking title for 'setup' page"); + + info("Check 'USB device runtime' page"); + // connect to a mocked USB runtime + mocks.createUSBRuntime("1337id", { + deviceName: "Fancy Phone", + name: "Lorem ipsum", + }); + mocks.emitUSBUpdate(); + await connectToRuntime("Fancy Phone", document); + // navigate to it via URL + document.location.hash = "#/runtime/1337id"; + await waitUntil(() => document.querySelector(".qa-runtime-page")); + const runtimeLabel = document.querySelector(".qa-runtime-name").textContent; + is( + document.title, + "Debugging - Runtime / 1337id", + "Checking title for 'runtime' page with USB device" + ); + ok( + runtimeLabel.includes("Lorem ipsum"), + "Runtime is displayed with the mocked name" + ); + + await removeTab(tab); +}); + +/** + * Test that an invalid route redirects to / (currently This Firefox page) + */ +add_task(async function() { + info("Check an invalid route redirects to root"); + const { document, tab } = await openAboutDebugging(); + + info("Waiting for a non setup page to load"); + document.location.hash = "#/runtime/this-firefox"; + await waitUntil(() => document.querySelector(".qa-runtime-page")); + + info("Update hash & wait for a redirect to root (connect page)"); + document.location.hash = "#/lorem-ipsum"; + await waitUntil(() => document.querySelector(".qa-connect-page")); + is(document.title, "Debugging - Setup", "Checking title for 'setup' page"); + is(document.location.hash, "#/setup", "Redirected to root"); + + await removeTab(tab); +}); + +/** + * Test that routes from old about:debugging redirect to this Firefox. + */ +add_task(async function testOldAboutDebuggingRoutes() { + info("Check that routes from old about:debugging redirect to this Firefox"); + const { document, tab } = await openAboutDebugging(); + + const routes = ["addons", "tabs", "workers"]; + for (const route of routes) { + info("Move to setup page before testing the route"); + document.location.hash = "#/setup"; + await waitUntil(() => document.querySelector(".qa-connect-page")); + + info(`Check that navigating to ${route} redirects to This Firefox`); + document.location.hash = route; + await waitUntil(() => document.querySelector(".qa-runtime-page")); + is( + document.location.hash, + "#/runtime/this-firefox", + `${route} was redirected to This Firefox` + ); + } + + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_compatibility_warning.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_compatibility_warning.js new file mode 100644 index 0000000000..05a2672290 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_compatibility_warning.js @@ -0,0 +1,94 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const COMPATIBLE_RUNTIME = "Compatible Runtime"; +const COMPATIBLE_DEVICE = "Compatible Device"; +const OLD_RUNTIME = "Old Runtime"; +const OLD_DEVICE = "Old Device"; +const FENNEC_68_RUNTIME = "Bad Runtime Fennec 68"; +const FENNEC_68_DEVICE = "Bad Device Fennec 68"; +const RECENT_RUNTIME = "Recent Runtime"; +const RECENT_DEVICE = "Recent Device"; + +add_task(async function() { + const { + COMPATIBILITY_STATUS, + } = require("devtools/client/shared/remote-debugging/version-checker"); + const { + COMPATIBLE, + TOO_OLD, + TOO_OLD_FENNEC, + TOO_RECENT, + } = COMPATIBILITY_STATUS; + + info("Create several mocked runtimes, with different compatibility reports"); + const mocks = new Mocks(); + createRuntimeWithReport( + mocks, + COMPATIBLE_RUNTIME, + COMPATIBLE_DEVICE, + COMPATIBLE + ); + createRuntimeWithReport(mocks, OLD_RUNTIME, OLD_DEVICE, TOO_OLD); + createRuntimeWithReport(mocks, RECENT_RUNTIME, RECENT_DEVICE, TOO_RECENT); + createRuntimeWithReport( + mocks, + FENNEC_68_RUNTIME, + FENNEC_68_DEVICE, + TOO_OLD_FENNEC + ); + + const { document, tab } = await openAboutDebugging(); + mocks.emitUSBUpdate(); + + info("Connect to all runtimes"); + await connectToRuntime(COMPATIBLE_DEVICE, document); + await connectToRuntime(OLD_DEVICE, document); + await connectToRuntime(RECENT_DEVICE, document); + await connectToRuntime(FENNEC_68_DEVICE, document); + + info("Select the compatible runtime and check that no warning is displayed"); + await selectRuntime(COMPATIBLE_DEVICE, COMPATIBLE_RUNTIME, document); + ok( + !document.querySelector(".qa-compatibility-warning"), + "Compatibility warning is not displayed" + ); + + info( + "Select the old runtime and check that the too-old warning is displayed" + ); + await selectRuntime(OLD_DEVICE, OLD_RUNTIME, document); + ok( + document.querySelector(".qa-compatibility-warning-too-old"), + "Expected compatibility warning is displayed (too-old)" + ); + + info( + "Select the recent runtime and check that the too-recent warning is displayed" + ); + await selectRuntime(RECENT_DEVICE, RECENT_RUNTIME, document); + ok( + document.querySelector(".qa-compatibility-warning-too-recent"), + "Expected compatibility warning is displayed (too-recent)" + ); + + info( + "Select the Fennec 68 runtime and check that the correct warning is displayed" + ); + await selectRuntime(FENNEC_68_DEVICE, FENNEC_68_RUNTIME, document); + ok(document.querySelector(".qa-compatibility-warning-too-old-fennec")); + + await removeTab(tab); +}); + +function createRuntimeWithReport(mocks, name, deviceName, status) { + const runtimeId = [name, deviceName].join("-"); + const compatibleUsbClient = mocks.createUSBRuntime(runtimeId, { + deviceName, + name, + }); + const report = { status }; + compatibleUsbClient.checkVersionCompatibility = () => report; +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_disconnect_remote_runtime.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_disconnect_remote_runtime.js new file mode 100644 index 0000000000..d9c545d966 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_disconnect_remote_runtime.js @@ -0,0 +1,65 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const USB_RUNTIME_ID = "1337id"; +const USB_DEVICE_NAME = "Fancy Phone"; +const USB_APP_NAME = "Lorem ipsum"; + +const DEFAULT_PAGE = "#/runtime/this-firefox"; + +/** + * Check if the disconnect button disconnects the remote runtime + * and redirects to the default page. + */ +add_task(async function() { + // Create a real local client and use it as the remote USB client for this + // test. + const clientWrapper = await createLocalClientWrapper(); + + // enable USB devices mocks + const mocks = new Mocks(); + mocks.createUSBRuntime(USB_RUNTIME_ID, { + clientWrapper, + deviceName: USB_DEVICE_NAME, + name: USB_APP_NAME, + }); + + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + mocks.emitUSBUpdate(); + + const onRequestSuccess = waitForRequestsSuccess(window.AboutDebugging.store); + await connectToRuntime(USB_DEVICE_NAME, document); + await selectRuntime(USB_DEVICE_NAME, USB_APP_NAME, document); + await onRequestSuccess; + + const disconnectRemoteRuntimeButton = document.querySelector( + ".qa-runtime-info__action" + ); + + info("Check whether disconnect remote runtime button exists"); + ok(!!disconnectRemoteRuntimeButton, "Runtime contains the disconnect button"); + + info("Click on the disconnect button"); + disconnectRemoteRuntimeButton.click(); + + info("Wait until the runtime is disconnected"); + await waitUntil(() => document.querySelector(".qa-connect-button")); + + is( + document.location.hash, + DEFAULT_PAGE, + "Redirection to the default page (this-firefox)" + ); + + info("Wait until the Runtime name is displayed"); + await waitUntil(() => { + const runtimeInfo = document.querySelector(".qa-runtime-name"); + return runtimeInfo && runtimeInfo.textContent.includes("Firefox"); + }); + + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_remote_runtime_buttons.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_remote_runtime_buttons.js new file mode 100644 index 0000000000..831b34a514 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_remote_runtime_buttons.js @@ -0,0 +1,56 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const USB_RUNTIME_ID = "1337id"; +const USB_DEVICE_NAME = "Fancy Phone"; +const USB_APP_NAME = "Lorem ipsum"; + +/** + * Test that remote runtimes show action buttons that are hidden for 'This Firefox'. + */ +add_task(async function() { + // enable USB devices mocks + const mocks = new Mocks(); + mocks.createUSBRuntime(USB_RUNTIME_ID, { + deviceName: USB_DEVICE_NAME, + name: USB_APP_NAME, + }); + + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + info("Checking This Firefox"); + ok( + !document.querySelector(".qa-connection-prompt-toggle-button"), + "This Firefox does not contain the connection prompt button" + ); + ok( + !document.querySelector(".qa-profile-runtime-button"), + "This Firefox does not contain the profile runtime button" + ); + ok( + !document.querySelector(".qa-runtime-info__action"), + "This Firefox does not contain the disconnect button" + ); + + info("Checking a USB runtime"); + mocks.emitUSBUpdate(); + await connectToRuntime(USB_DEVICE_NAME, document); + await selectRuntime(USB_DEVICE_NAME, USB_APP_NAME, document); + ok( + !!document.querySelector(".qa-connection-prompt-toggle-button"), + "Runtime contains the connection prompt button" + ); + ok( + !!document.querySelector(".qa-profile-runtime-button"), + "Remote runtime contains the profile runtime button" + ); + ok( + !!document.querySelector(".qa-runtime-info__action"), + "Runtime contains the disconnect button" + ); + + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_usbclient_closed.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_usbclient_closed.js new file mode 100644 index 0000000000..9e9715a46b --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_runtime_usbclient_closed.js @@ -0,0 +1,109 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const NETWORK_RUNTIME_HOST = "localhost:6080"; +const NETWORK_RUNTIME_APP_NAME = "TestNetworkApp"; +const USB_RUNTIME_ID = "test-runtime-id"; +const USB_DEVICE_NAME = "test device name"; +const USB_APP_NAME = "TestApp"; + +// Test that about:debugging navigates back to the default page when a USB device is +// unplugged. +add_task(async function testUsbDeviceUnplugged() { + const mocks = new Mocks(); + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + mocks.createUSBRuntime(USB_RUNTIME_ID, { + deviceName: USB_DEVICE_NAME, + name: USB_APP_NAME, + }); + mocks.emitUSBUpdate(); + + info("Connect to and select the USB device"); + await connectToRuntime(USB_DEVICE_NAME, document); + await selectRuntime(USB_DEVICE_NAME, USB_APP_NAME, document); + + info("Simulate a device unplugged"); + mocks.removeUSBRuntime(USB_RUNTIME_ID); + mocks.emitUSBUpdate(); + await waitUntilUsbDeviceIsUnplugged(USB_DEVICE_NAME, document); + + is( + document.location.hash, + `#/runtime/this-firefox`, + "Redirection to the default page (this-firefox)" + ); + + await removeTab(tab); +}); + +// Test that about:debugging navigates back to the default page when the server for the +// current USB runtime is closed. +add_task(async function testUsbClientDisconnected() { + const mocks = new Mocks(); + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + const usbClient = mocks.createUSBRuntime(USB_RUNTIME_ID, { + deviceName: USB_DEVICE_NAME, + name: USB_APP_NAME, + }); + mocks.emitUSBUpdate(); + + info("Connect to and select the USB device"); + await connectToRuntime(USB_DEVICE_NAME, document); + await selectRuntime(USB_DEVICE_NAME, USB_APP_NAME, document); + + info("Simulate a client disconnection"); + usbClient.isClosed = () => true; + usbClient._eventEmitter.emit("closed"); + + info("Wait until the connect button for this runtime appears"); + await waitUntil(() => { + const item = findSidebarItemByText(USB_DEVICE_NAME, document); + return item && item.querySelector(".qa-connect-button"); + }); + + is( + document.location.hash, + `#/runtime/this-firefox`, + "Redirection to the default page (this-firefox)" + ); + await removeTab(tab); +}); + +// Test that about:debugging navigates back to the default page when the server for the +// current network runtime is closed. +add_task(async function testNetworkClientDisconnected() { + const mocks = new Mocks(); + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + const networkClient = mocks.createNetworkRuntime(NETWORK_RUNTIME_HOST, { + name: NETWORK_RUNTIME_APP_NAME, + }); + + info("Connect to and select the network runtime"); + await connectToRuntime(NETWORK_RUNTIME_HOST, document); + await selectRuntime(NETWORK_RUNTIME_HOST, NETWORK_RUNTIME_APP_NAME, document); + + info("Simulate a client disconnection"); + networkClient.isClosed = () => true; + networkClient._eventEmitter.emit("closed"); + + info("Wait until the connect button for this runtime appears"); + await waitUntil(() => { + const item = findSidebarItemByText(NETWORK_RUNTIME_HOST, document); + return item && item.querySelector(".qa-connect-button"); + }); + + is( + document.location.hash, + `#/runtime/this-firefox`, + "Redirection to the default page (this-firefox)" + ); + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_select_network_runtime.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_select_network_runtime.js new file mode 100644 index 0000000000..8b16bc7555 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_select_network_runtime.js @@ -0,0 +1,52 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const NETWORK_RUNTIME_HOST = "localhost:6080"; +const NETWORK_RUNTIME_APP_NAME = "TestNetworkApp"; +const NETWORK_RUNTIME_CHANNEL = "SomeChannel"; +const NETWORK_RUNTIME_VERSION = "12.3"; + +// Test that network runtimes can be selected. +add_task(async function() { + const mocks = new Mocks(); + + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + info("Prepare Network client mock"); + const networkClient = mocks.createNetworkRuntime(NETWORK_RUNTIME_HOST, { + name: NETWORK_RUNTIME_APP_NAME, + }); + networkClient.getDeviceDescription = () => { + return { + name: NETWORK_RUNTIME_APP_NAME, + channel: NETWORK_RUNTIME_CHANNEL, + version: NETWORK_RUNTIME_VERSION, + }; + }; + + info("Test addons in runtime page for Network client"); + await connectToRuntime(NETWORK_RUNTIME_HOST, document); + await selectRuntime(NETWORK_RUNTIME_HOST, NETWORK_RUNTIME_APP_NAME, document); + + info("Check that the network runtime mock is properly displayed"); + const thisFirefoxRuntimeInfo = document.querySelector(".qa-runtime-name"); + ok( + thisFirefoxRuntimeInfo, + "Runtime info for this-firefox runtime is displayed" + ); + const runtimeInfoText = thisFirefoxRuntimeInfo.textContent; + + ok( + runtimeInfoText.includes(NETWORK_RUNTIME_APP_NAME), + "network runtime info shows the correct runtime name: " + runtimeInfoText + ); + ok( + runtimeInfoText.includes(NETWORK_RUNTIME_VERSION), + "network runtime info shows the correct version number: " + runtimeInfoText + ); + + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_select_page_with_serviceworker.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_select_page_with_serviceworker.js new file mode 100644 index 0000000000..2606301919 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_select_page_with_serviceworker.js @@ -0,0 +1,79 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const NETWORK_RUNTIME_HOST = "localhost:6080"; +const NETWORK_RUNTIME_APP_NAME = "TestNetworkApp"; +const WORKER_NAME = "testserviceworker"; + +// Test that navigating from: +// - a remote runtime page that contains a service worker +// to: +// - this firefox +// does not crash. See Bug 1519088. +add_task(async function() { + const mocks = new Mocks(); + + const { document, tab, window } = await openAboutDebugging({ + enableWorkerUpdates: true, + }); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + info("Prepare Network client mock"); + const networkClient = mocks.createNetworkRuntime(NETWORK_RUNTIME_HOST, { + name: NETWORK_RUNTIME_APP_NAME, + }); + + info("Connect and select the network runtime"); + await connectToRuntime(NETWORK_RUNTIME_HOST, document); + await selectRuntime(NETWORK_RUNTIME_HOST, NETWORK_RUNTIME_APP_NAME, document); + + info(`Add a service worker to the network client`); + const workers = { + otherWorkers: [], + serviceWorkers: [ + { + name: WORKER_NAME, + workerDescriptorFront: { actorID: WORKER_NAME }, + }, + ], + sharedWorkers: [], + }; + networkClient.listWorkers = () => workers; + networkClient._eventEmitter.emit("workersUpdated"); + + info("Wait until the service worker is displayed"); + await waitUntil(() => findDebugTargetByText(WORKER_NAME, document)); + + info("Go to This Firefox again"); + const thisFirefoxString = getThisFirefoxString(window); + const thisFirefoxSidebarItem = findSidebarItemByText( + thisFirefoxString, + document + ); + const thisFirefoxLink = thisFirefoxSidebarItem.querySelector( + ".qa-sidebar-link" + ); + info("Click on the ThisFirefox item in the sidebar"); + const requestsSuccess = waitForRequestsSuccess(window.AboutDebugging.store); + thisFirefoxLink.click(); + + info("Wait for all target requests to complete"); + await requestsSuccess; + + info("Check that the runtime info is rendered for This Firefox"); + const thisFirefoxRuntimeInfo = document.querySelector(".qa-runtime-name"); + ok( + thisFirefoxRuntimeInfo, + "Runtime info for this-firefox runtime is displayed" + ); + + const text = thisFirefoxRuntimeInfo.textContent; + ok( + text.includes("Firefox") && text.includes("63.0"), + "this-firefox runtime info shows the correct values" + ); + + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_fetch_flag.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_fetch_flag.js new file mode 100644 index 0000000000..f9b07e477b --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_fetch_flag.js @@ -0,0 +1,68 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-serviceworker.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-serviceworker.js", + this +); + +const FETCH_SW_JS = URL_ROOT + "resources/service-workers/fetch-sw.js"; +const FETCH_SW_HTML = URL_ROOT + "resources/service-workers/fetch-sw.html"; + +const EMPTY_SW_JS = URL_ROOT + "resources/service-workers/empty-sw.js"; +const EMPTY_SW_HTML = URL_ROOT + "resources/service-workers/empty-sw.html"; + +/** + * Test that the appropriate fetch flag is displayed for service workers. + */ +add_task(async function() { + await enableServiceWorkerDebugging(); + const { document, tab, window } = await openAboutDebugging({ + enableWorkerUpdates: true, + }); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + info("Test fetch status for a service worker listening to fetch events"); + await testServiceWorkerFetchStatus( + document, + FETCH_SW_HTML, + FETCH_SW_JS, + true + ); + + info("Test fetch status for a service worker not listening to fetch events"); + await testServiceWorkerFetchStatus( + document, + EMPTY_SW_HTML, + EMPTY_SW_JS, + false + ); + + await removeTab(tab); +}); + +async function testServiceWorkerFetchStatus(doc, url, workerUrl, isListening) { + // Open a tab that registers a fetch service worker. + const swTab = await addTab(url); + + info("Wait until the service worker appears and is running"); + const targetElement = await waitForServiceWorkerRunning(workerUrl, doc); + + const expectedClassName = isListening + ? ".qa-worker-fetch-listening" + : ".qa-worker-fetch-not-listening"; + const fetchStatus = targetElement.querySelector(expectedClassName); + ok(!!fetchStatus, "Found the expected fetch status: " + expectedClassName); + + info("Unregister the service worker"); + await unregisterServiceWorker(swTab); + + info("Wait until the service worker disappears from about:debugging"); + await waitUntil(() => !findDebugTargetByText(workerUrl, doc)); + + info("Remove the service worker tab"); + await removeTab(swTab); +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_not_compatible.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_not_compatible.js new file mode 100644 index 0000000000..c490e66707 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_not_compatible.js @@ -0,0 +1,130 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// This test started running during a GC and timing out on coverage platforms. +// See Bug 1526153. +requestLongerTimeout(2); + +const TEST_DATA = [ + { + serviceWorkersEnabled: true, + privateBrowsingEnabled: false, + expectedMessage: false, + }, + { + serviceWorkersEnabled: false, + privateBrowsingEnabled: false, + expectedMessage: true, + }, + { + serviceWorkersEnabled: true, + privateBrowsingEnabled: true, + expectedMessage: true, + }, + { + serviceWorkersEnabled: false, + privateBrowsingEnabled: true, + expectedMessage: true, + }, +]; + +/** + * Check that the warning message for service workers is displayed if permanent private + * browsing is enabled or/and if service workers are disabled. + */ +add_task(async function testLocalRuntime() { + for (const testData of TEST_DATA) { + const { + serviceWorkersEnabled, + privateBrowsingEnabled, + expectedMessage, + } = testData; + + info( + `Test warning message on this-firefox ` + + `with serviceWorkersEnabled: ${serviceWorkersEnabled} ` + + `and with privateBrowsingEnabled: ${privateBrowsingEnabled}` + ); + + await pushPref("dom.serviceWorkers.enabled", serviceWorkersEnabled); + await pushPref("browser.privatebrowsing.autostart", privateBrowsingEnabled); + + const { document, tab, window } = await openAboutDebugging({ + // Even though this is a service worker test, we are not adding/removing + // workers here. Since the test is really fast it can create intermittent + // failures due to pending requests to update the worker list + // We are updating the worker list whenever the list of processes changes + // and this can happen very frequently, and it's hard to control from + // DevTools. + // Set enableWorkerUpdates to false to avoid intermittent failures. + enableWorkerUpdates: false, + }); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + assertWarningMessage(document, expectedMessage); + await removeTab(tab); + } +}); + +add_task(async function testRemoteRuntime() { + const { + remoteClientManager, + } = require("devtools/client/shared/remote-debugging/remote-client-manager"); + + // enable USB devices mocks + const mocks = new Mocks(); + const client = mocks.createUSBRuntime("1337id", { + deviceName: "Fancy Phone", + name: "Lorem ipsum", + }); + + for (const testData of TEST_DATA) { + const { + serviceWorkersEnabled, + privateBrowsingEnabled, + expectedMessage, + } = testData; + + info( + `Test warning message on mocked USB runtime ` + + `with serviceWorkersEnabled: ${serviceWorkersEnabled} ` + + `and with privateBrowsingEnabled: ${privateBrowsingEnabled}` + ); + + client.setPreference("dom.serviceWorkers.enabled", serviceWorkersEnabled); + client.setPreference( + "browser.privatebrowsing.autostart", + privateBrowsingEnabled + ); + + const { document, tab, window } = await openAboutDebugging({ + enableWorkerUpdates: false, + }); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + info("Checking a USB runtime"); + mocks.emitUSBUpdate(); + await connectToRuntime("Fancy Phone", document); + await selectRuntime("Fancy Phone", "Lorem ipsum", document); + + assertWarningMessage(document, expectedMessage); + + // We remove all clients in order to be able to simply connect to the runtime at + // every iteration of the loop without checking of the runtime is already connected. + info("Remove all remote clients"); + await remoteClientManager.removeAllClients(); + + await removeTab(tab); + } +}); + +function assertWarningMessage(doc, expectedMessage) { + const hasMessage = !!doc.querySelector(".qa-service-workers-warning"); + ok( + hasMessage === expectedMessage, + expectedMessage + ? "Warning message is displayed" + : "Warning message is not displayed" + ); +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_push.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_push.js new file mode 100644 index 0000000000..01fae3d1f6 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_push.js @@ -0,0 +1,57 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-serviceworker.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-serviceworker.js", + this +); + +const SERVICE_WORKER = URL_ROOT + "resources/service-workers/push-sw.js"; +const TAB_URL = URL_ROOT + "resources/service-workers/push-sw.html"; + +// Test that clicking on the Push button next to a Service Worker works as intended. +// It should trigger a "push" notification in the worker. +add_task(async function() { + await enableServiceWorkerDebugging(); + const { document, tab, window } = await openAboutDebugging({ + enableWorkerUpdates: true, + }); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + // Open a tab that registers a push service worker. + const swTab = await addTab(TAB_URL); + + info( + "Wait for the service worker to claim the test window before proceeding." + ); + await onServiceWorkerMessage(swTab, "sw-claimed"); + + info("Wait until the service worker appears and is running"); + const targetElement = await waitForServiceWorkerRunning( + SERVICE_WORKER, + document + ); + + // Retrieve the Push button for the worker. + const pushButton = targetElement.querySelector(".qa-push-button"); + ok(pushButton, "Found its push button"); + + info("Click on the Push button and wait for the push notification"); + const onPushNotification = onServiceWorkerMessage(swTab, "sw-pushed"); + pushButton.click(); + await onPushNotification; + + info("Unregister the service worker"); + await unregisterServiceWorker(swTab); + + info("Wait until the service worker disappears from about:debugging"); + await waitUntil(() => !findDebugTargetByText(SERVICE_WORKER, document)); + + info("Remove the service worker tab"); + await removeTab(swTab); + + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_pushservice_url.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_pushservice_url.js new file mode 100644 index 0000000000..18c6ce720e --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_pushservice_url.js @@ -0,0 +1,114 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-serviceworker.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-serviceworker.js", + this +); + +const SERVICE_WORKER = URL_ROOT + "resources/service-workers/push-sw.js"; +const TAB_URL = URL_ROOT + "resources/service-workers/push-sw.html"; + +const FAKE_ENDPOINT = "https://fake/endpoint"; + +// Test that the push service url is displayed for service workers subscribed to a push +// service. +add_task(async function() { + await enableServiceWorkerDebugging(); + + info("Mock the push service"); + mockPushService(FAKE_ENDPOINT); + + const { document, tab, window } = await openAboutDebugging({ + enableWorkerUpdates: true, + }); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + // Open a tab that registers a push service worker. + const swTab = await addTab(TAB_URL); + + info( + "Wait for the service worker to claim the test window before proceeding." + ); + await onServiceWorkerMessage(swTab, "sw-claimed"); + + info("Wait until the service worker appears and is running"); + const targetElement = await waitForServiceWorkerRunning( + SERVICE_WORKER, + document + ); + + info("Subscribe from the push service"); + SpecialPowers.spawn(swTab.linkedBrowser, [], () => { + content.wrappedJSObject.subscribeToPush(); + }); + + info("Wait until the push service appears"); + await waitUntil(() => + targetElement.querySelector(".qa-worker-push-service-value") + ); + const pushUrl = targetElement.querySelector(".qa-worker-push-service-value"); + + ok(!!pushUrl, "Push URL is displayed for the serviceworker"); + is(pushUrl.textContent, FAKE_ENDPOINT, "Push URL shows the expected content"); + + info("Unsubscribe from the push service"); + SpecialPowers.spawn(swTab.linkedBrowser, [], () => { + content.wrappedJSObject.unsubscribeToPush(); + }); + + info("Wait until the push service disappears"); + await waitUntil( + () => !targetElement.querySelector(".qa-worker-push-service-value") + ); + + info("Unregister the service worker"); + await unregisterServiceWorker(swTab); + + info("Wait until the service worker disappears from about:debugging"); + await waitUntil(() => !findDebugTargetByText(SERVICE_WORKER, document)); + + info("Remove the service worker tab"); + await removeTab(swTab); + + await removeTab(tab); +}); + +function mockPushService(endpoint) { + const PushService = Cc["@mozilla.org/push/Service;1"].getService( + Ci.nsIPushService + ).wrappedJSObject; + + PushService.service = { + _registrations: new Map(), + _notify(scope) { + Services.obs.notifyObservers( + null, + PushService.subscriptionModifiedTopic, + scope + ); + }, + init() {}, + register(pageRecord) { + const registration = { + endpoint, + }; + this._registrations.set(pageRecord.scope, registration); + this._notify(pageRecord.scope); + return Promise.resolve(registration); + }, + registration(pageRecord) { + return Promise.resolve(this._registrations.get(pageRecord.scope)); + }, + unregister(pageRecord) { + const deleted = this._registrations.delete(pageRecord.scope); + if (deleted) { + this._notify(pageRecord.scope); + } + return Promise.resolve(deleted); + }, + }; +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_runtime-page.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_runtime-page.js new file mode 100644 index 0000000000..000fd50b24 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_runtime-page.js @@ -0,0 +1,70 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-serviceworker.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-serviceworker.js", + this +); +/* import-globals-from helper-collapsibilities.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-collapsibilities.js", + this +); + +const SW_TAB_URL = URL_ROOT + "resources/service-workers/push-sw.html"; +const SW_URL = URL_ROOT + "resources/service-workers/push-sw.js"; + +/** + * Test that service workers appear and dissapear from the runtime page when they + * are registered / unregistered. + */ +add_task(async function() { + prepareCollapsibilitiesTest(); + await enableServiceWorkerDebugging(); + const { document, tab, window } = await openAboutDebugging({ + enableWorkerUpdates: true, + }); + const store = window.AboutDebugging.store; + + await selectThisFirefoxPage(document, store); + + // check that SW list is empty + info("Check that the SW pane is empty"); + let swPane = getDebugTargetPane("Service Workers", document); + ok(!swPane.querySelector(".qa-debug-target-item"), "SW list is empty"); + + // open a tab and register service worker + info("Register a service worker"); + const swTab = await addTab(SW_TAB_URL); + + // check that service worker is rendered + info("Wait until the service worker appears and is running"); + await waitForServiceWorkerRunning(SW_URL, document); + + swPane = getDebugTargetPane("Service Workers", document); + ok( + swPane.querySelectorAll(".qa-debug-target-item").length === 1, + "Service worker list has one element" + ); + ok( + swPane.querySelector(".qa-debug-target-item").textContent.includes(SW_URL), + "Service worker list is the one we registered" + ); + + // unregister the service worker + info("Unregister service worker"); + await unregisterServiceWorker(swTab); + // check that service worker is not rendered anymore + info("Wait for service worker to disappear"); + await waitUntil(() => { + swPane = getDebugTargetPane("Service Workers", document); + return swPane.querySelectorAll(".qa-debug-target-item").length === 0; + }); + + info("Remove tabs"); + await removeTab(swTab); + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_start.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_start.js new file mode 100644 index 0000000000..d6f0e95c94 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_start.js @@ -0,0 +1,71 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-serviceworker.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-serviceworker.js", + this +); + +const SW_TAB_URL = URL_ROOT + "resources/service-workers/empty-sw.html"; +const SW_URL = URL_ROOT + "resources/service-workers/empty-sw.js"; + +/** + * Test that service workers can be started using about:debugging. + */ +add_task(async function() { + await enableServiceWorkerDebugging(); + + // Setting a low idle_timeout and idle_extended_timeout will allow the service worker + // to reach the STOPPED state quickly, which will allow us to test the start button. + // The default value is 30000 milliseconds. + info("Set a low service worker idle timeout"); + await pushPref("dom.serviceWorkers.idle_timeout", 1000); + await pushPref("dom.serviceWorkers.idle_extended_timeout", 1000); + + const { document, tab, window } = await openAboutDebugging({ + enableWorkerUpdates: true, + }); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + // Open a tab that registers a basic service worker. + const swTab = await addTab(SW_TAB_URL); + + // Wait for the registration to make sure service worker has been started, and that we + // are not just reading STOPPED as the initial state. + await waitForRegistration(swTab); + + info("Wait until the service worker stops"); + const targetElement = await waitForServiceWorkerStopped(SW_URL, document); + + // Retrieve the Start button for the worker. + const startButton = targetElement.querySelector(".qa-start-button"); + ok(startButton, "Found its start button"); + + info( + "Click on the start button and wait for the service worker to be running" + ); + const onServiceWorkerRunning = waitForServiceWorkerRunning(SW_URL, document); + startButton.click(); + const updatedTarget = await onServiceWorkerRunning; + + // Check that the buttons are displayed as expected. + const hasInspectButton = updatedTarget.querySelector( + ".qa-debug-target-inspect-button" + ); + const hasStartButton = updatedTarget.querySelector(".qa-start-button"); + ok(hasInspectButton, "Service worker has an inspect button"); + ok(!hasStartButton, "Service worker does not have a start button"); + + info("Unregister service worker"); + await unregisterServiceWorker(swTab); + + info("Wait until the service worker disappears from about:debugging"); + await waitUntil(() => !findDebugTargetByText(SW_URL, document)); + + info("Remove tabs"); + await removeTab(swTab); + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_status.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_status.js new file mode 100644 index 0000000000..f09eea8b61 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_status.js @@ -0,0 +1,103 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-serviceworker.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-serviceworker.js", + this +); + +const SW_TAB_URL = URL_ROOT + "resources/service-workers/controlled-sw.html"; +const SW_URL = URL_ROOT + "resources/service-workers/controlled-sw.js"; + +/** + * Test that the service worker has the status "registering" when the service worker is + * not installed yet. Other states (stopped, running) are covered by the existing tests. + */ +add_task(async function() { + await enableServiceWorkerDebugging(); + + const { document, tab, window } = await openAboutDebugging({ + enableWorkerUpdates: true, + }); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + info("Open tab with a service worker that never leaves `registering` status"); + const swTab = await addTab(SW_TAB_URL); + + // Wait for the registration to make sure service worker has been started, and that we + // are not just reading STOPPED as the initial state. + await waitForRegistration(swTab); + + info("Wait until the service worker is in registering status"); + await waitForServiceWorkerRegistering(SW_URL, document); + + // Check that the buttons are displayed as expected. + checkButtons( + { inspect: true, push: false, start: false, unregister: false }, + SW_URL, + document + ); + + info("Install the service worker"); + SpecialPowers.spawn(swTab.linkedBrowser, [], () => + content.wrappedJSObject.installServiceWorker() + ); + + info("Wait until the service worker is running"); + await waitForServiceWorkerRunning(SW_URL, document); + + checkButtons( + { inspect: true, push: true, start: false, unregister: true }, + SW_URL, + document + ); + + info("Unregister service worker"); + await unregisterServiceWorker(swTab); + + info("Wait until the service worker disappears from about:debugging"); + await waitUntil(() => !findDebugTargetByText(SW_URL, document)); + + info("Remove tabs"); + await removeTab(swTab); + await removeTab(tab); +}); + +function checkButtons( + { inspect, push, start, unregister }, + workerText, + document +) { + const targetElement = findDebugTargetByText(SW_URL, document); + + const inspectButton = targetElement.querySelector( + ".qa-debug-target-inspect-button" + ); + const pushButton = targetElement.querySelector(".qa-push-button"); + const startButton = targetElement.querySelector(".qa-start-button"); + const unregisterButton = targetElement.querySelector(".qa-unregister-button"); + + is( + !!inspectButton, + inspect, + "Inspect button should be " + (inspect ? "visible" : "hidden") + ); + is( + !!pushButton, + push, + "Push button should be " + (push ? "visible" : "hidden") + ); + is( + !!startButton, + start, + "Start button should be " + (start ? "visible" : "hidden") + ); + is( + !!unregisterButton, + unregister, + "Unregister button should be " + (unregister ? "visible" : "hidden") + ); +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_timeout.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_timeout.js new file mode 100644 index 0000000000..64cfb3ff28 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_timeout.js @@ -0,0 +1,104 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// This test will be idle for a long period to give a chance to the service worker to +// timeout. +requestLongerTimeout(3); + +/* import-globals-from helper-serviceworker.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-serviceworker.js", + this +); + +const SW_TAB_URL = URL_ROOT + "resources/service-workers/empty-sw.html"; +const SW_URL = URL_ROOT + "resources/service-workers/empty-sw.js"; +const SW_TIMEOUT = 4000; + +/** + * Test that service workers will _not_ timeout and be stopped when a toolbox is attached + * to them. Feature implemented in Bug 1228382. + */ +add_task(async function() { + await enableServiceWorkerDebugging(); + + // Setting a low idle_timeout and idle_extended_timeout will allow the service worker + // to reach the STOPPED state quickly, which will allow us to test the start button. + // The default value is 30000 milliseconds. + info("Set a low service worker idle timeout"); + await pushPref("dom.serviceWorkers.idle_timeout", SW_TIMEOUT); + await pushPref("dom.serviceWorkers.idle_extended_timeout", SW_TIMEOUT); + + const { document, tab, window } = await openAboutDebugging({ + enableWorkerUpdates: true, + }); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + // Open a tab that registers a basic service worker. + const swTab = await addTab(SW_TAB_URL); + + // Wait for the registration to make sure service worker has been started, and that we + // are not just reading STOPPED as the initial state. + await waitForRegistration(swTab); + + info("Wait until the service worker stops"); + await waitForServiceWorkerStopped(SW_URL, document); + + info( + "Click on the start button and wait for the service worker to be running" + ); + const onServiceWorkerRunning = waitForServiceWorkerRunning(SW_URL, document); + const startButton = getStartButton(SW_URL, document); + startButton.click(); + await onServiceWorkerRunning; + + const inspectButton = getInspectButton(SW_URL, document); + ok(!!inspectButton, "Service worker target has an inspect button"); + + info("Click on inspect and wait for the toolbox to open"); + const onToolboxReady = gDevTools.once("toolbox-ready"); + inspectButton.click(); + await onToolboxReady; + + // Wait for more 5 times the service worker timeout to check that the toolbox prevents + // the worker from being destroyed. + await wait(SW_TIMEOUT * 5); + + // Check that the service worker is still running, even after waiting 5 times the + // service worker timeout. + const hasInspectButton = !!getInspectButton(SW_URL, document); + ok(hasInspectButton, "Service worker target still has an inspect button"); + + info("Destroy the toolbox"); + const devtoolsTab = gBrowser.selectedTab; + await closeAboutDevtoolsToolbox(document, devtoolsTab, window); + + // After stopping the toolbox, the service worker instance should be released and the + // service worker registration should be displayed as stopped again. + info("Wait until the service worker stops after closing the toolbox"); + await waitForServiceWorkerStopped(SW_URL, document); + + info("Unregister service worker"); + await unregisterServiceWorker(swTab); + + info("Wait until the service worker disappears from about:debugging"); + await waitUntil(() => !findDebugTargetByText(SW_URL, document)); + + info("Remove tabs"); + await removeTab(swTab); + await removeTab(tab); +}); + +function getStartButton(workerText, doc) { + const target = findDebugTargetByText(workerText, doc); + return target ? target.querySelector(".qa-start-button") : null; +} + +function getInspectButton(workerText, doc) { + const target = findDebugTargetByText(workerText, doc); + return target + ? target.querySelector(".qa-debug-target-inspect-button") + : null; +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_unregister.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_unregister.js new file mode 100644 index 0000000000..df0151d57c --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_serviceworker_unregister.js @@ -0,0 +1,48 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-serviceworker.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-serviceworker.js", + this +); + +const SW_TAB_URL = URL_ROOT + "resources/service-workers/empty-sw.html"; +const SW_URL = URL_ROOT + "resources/service-workers/empty-sw.js"; + +/** + * Test that service workers can be started using about:debugging. + */ +add_task(async function() { + await enableServiceWorkerDebugging(); + + const { document, tab, window } = await openAboutDebugging({ + enableWorkerUpdates: true, + }); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + // Open a tab that registers a basic service worker. + const swTab = await addTab(SW_TAB_URL); + + info("Wait until the service worker appears and is running"); + const targetElement = await waitForServiceWorkerRunning(SW_URL, document); + + // Retrieve the Start button for the worker. + const unregisterButton = targetElement.querySelector(".qa-unregister-button"); + ok(unregisterButton, "Found its unregister button"); + + info( + "Click on the unregister button and wait for the service worker to disappear" + ); + unregisterButton.click(); + await waitUntil(() => !findDebugTargetByText(SW_URL, document)); + + const hasServiceWorkerTarget = !!findDebugTargetByText(SW_URL, document); + ok(!hasServiceWorkerTarget, "Service worker was successfully unregistered"); + + info("Remove tabs"); + await removeTab(swTab); + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_connection_state.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_connection_state.js new file mode 100644 index 0000000000..e07b9822b8 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_connection_state.js @@ -0,0 +1,194 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const RUNTIME_ID = "test-runtime-id"; +const RUNTIME_NAME = "test runtime name"; +const RUNTIME_DEVICE_NAME = "test device name"; +const RUNTIME_SHORT_NAME = "test short name"; + +const CONNECTION_TIMING_OUT_DELAY = 1000; +const CONNECTION_CANCEL_DELAY = 2000; + +// Test following connection state tests. +// * Connect button label and state will change during connecting. +// * Show error message if connection failed. +// * Show warninng if connection has been taken time. +add_task(async function() { + await setupPreferences(); + + const mocks = new Mocks(); + + const { document, tab } = await openAboutDebugging(); + + mocks.createUSBRuntime(RUNTIME_ID, { + name: RUNTIME_NAME, + deviceName: RUNTIME_DEVICE_NAME, + shortName: RUNTIME_SHORT_NAME, + }); + mocks.emitUSBUpdate(); + + info("Wait until the USB sidebar item appears"); + await waitUntil(() => findSidebarItemByText(RUNTIME_DEVICE_NAME, document)); + const usbRuntimeSidebarItem = findSidebarItemByText( + RUNTIME_DEVICE_NAME, + document + ); + const connectButton = usbRuntimeSidebarItem.querySelector( + ".qa-connect-button" + ); + + info("Simulate to happen connection error"); + mocks.runtimeClientFactoryMock.createClientForRuntime = async runtime => { + throw new Error("Dummy connection error"); + }; + + info( + "Check whether the error message displayed after clicking connect button" + ); + connectButton.click(); + await waitUntil(() => document.querySelector(".qa-connection-error")); + ok(true, "Error message displays when connection failed"); + + info("Simulate to wait for the connection prompt on remote runtime"); + let resumeConnection; + const resumeConnectionPromise = new Promise(r => { + resumeConnection = r; + }); + mocks.runtimeClientFactoryMock.createClientForRuntime = async runtime => { + await resumeConnectionPromise; + return mocks._clients[runtime.type][runtime.id]; + }; + + info("Click on the connect button and wait until it disappears"); + connectButton.click(); + info("Check whether a warning of connection not responding displays"); + await waitUntil(() => + document.querySelector(".qa-connection-not-responding") + ); + ok( + document.querySelector(".qa-connection-not-responding"), + "A warning of connection not responding displays" + ); + ok(connectButton.disabled, "Connect button is disabled"); + ok( + connectButton.textContent.startsWith("Connecting"), + "Label of the connect button changes" + ); + ok( + !document.querySelector(".qa-connection-error"), + "Error message disappears" + ); + + info( + "Unblock the connection and check the message and connect button disappear" + ); + resumeConnection(); + await waitUntil( + () => !usbRuntimeSidebarItem.querySelector(".qa-connect-button") + ); + ok(!document.querySelector(".qa-connection-error"), "Error disappears"); + ok( + !document.querySelector(".qa-connection-not-responding"), + "Warning disappears" + ); + + info("Remove a USB runtime"); + mocks.removeUSBRuntime(RUNTIME_ID); + mocks.emitUSBUpdate(); + await waitUntilUsbDeviceIsUnplugged(RUNTIME_DEVICE_NAME, document); + + await removeTab(tab); +}); + +// Test whether the status of all will be reverted after a certain period of time during +// waiting connection. +add_task(async function() { + await setupPreferences(); + + const mocks = new Mocks(); + + const { document, tab } = await openAboutDebugging(); + + mocks.createUSBRuntime(RUNTIME_ID, { + name: RUNTIME_NAME, + deviceName: RUNTIME_DEVICE_NAME, + shortName: RUNTIME_SHORT_NAME, + }); + mocks.emitUSBUpdate(); + + info("Wait until the USB sidebar item appears"); + await waitUntil(() => findSidebarItemByText(RUNTIME_DEVICE_NAME, document)); + const usbRuntimeSidebarItem = findSidebarItemByText( + RUNTIME_DEVICE_NAME, + document + ); + const connectButton = usbRuntimeSidebarItem.querySelector( + ".qa-connect-button" + ); + + let resumeConnection; + const resumeConnectionPromise = new Promise(r => { + resumeConnection = r; + }); + mocks.runtimeClientFactoryMock.createClientForRuntime = async runtime => { + await resumeConnectionPromise; + return mocks._clients[runtime.type][runtime.id]; + }; + + info("Click on the connect button and wait until it disappears"); + connectButton.click(); + await waitUntil(() => + document.querySelector(".qa-connection-not-responding") + ); + info("Check whether the all status will be reverted"); + await waitUntil( + () => !document.querySelector(".qa-connection-not-responding") + ); + ok( + document.querySelector(".qa-connection-timeout"), + "Connection timeout message displays" + ); + ok(!connectButton.disabled, "Connect button is enabled"); + is( + connectButton.textContent, + "Connect", + "Label of the connect button reverted" + ); + ok( + !document.querySelector(".qa-connection-error"), + "Error message disappears" + ); + + info("Check whether the timeout message disappears"); + resumeConnection(); + await waitUntil(() => !document.querySelector(".qa-connection-timeout")); + + info("Remove a USB runtime"); + mocks.removeUSBRuntime(RUNTIME_ID); + mocks.emitUSBUpdate(); + + info("Wait until the USB sidebar item disappears"); + await waitUntilUsbDeviceIsUnplugged(RUNTIME_DEVICE_NAME, document); + + await removeTab(tab); +}); + +async function setupPreferences() { + if (SpecialPowers.isDebugBuild) { + // On debug builds, reducing the timings might lead to skip the "warning" + // state and will block the test execution. + // Do not change the timings in debug builds. + return; + } + + await pushPref( + "devtools.aboutdebugging.test-connection-timing-out-delay", + CONNECTION_TIMING_OUT_DELAY + ); + await pushPref( + "devtools.aboutdebugging.test-connection-cancel-delay", + CONNECTION_CANCEL_DELAY + ); +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_network_runtimes.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_network_runtimes.js new file mode 100644 index 0000000000..be3d17bec2 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_network_runtimes.js @@ -0,0 +1,43 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const networkLocationsModule = require("devtools/client/aboutdebugging/src/modules/network-locations.js"); + +/** + * Test the sidebar is updated correctly when network runtimes are added/removed. + */ + +add_task(async function() { + registerCleanupFunction(() => { + Services.prefs.clearUserPref("devtools.aboutdebugging.network-locations"); + }); + + const { document, tab } = await openAboutDebugging(); + + const noDevicesElement = document.querySelector(".qa-sidebar-no-devices"); + ok(noDevicesElement, "Sidebar shows the 'no devices' element"); + + info("Add a network location"); + networkLocationsModule.addNetworkLocation("localhost:6080"); + + info("Wait for 'no devices' element to disappear"); + waitUntil(() => !document.querySelector(".qa-sidebar-no-devices")); + ok( + findSidebarItemByText("localhost:6080", document), + "Found a sidebar item for localhost:6080" + ); + + info("Remove the network location"); + networkLocationsModule.removeNetworkLocation("localhost:6080"); + + info("Wait for 'no devices' element to reappear"); + waitUntil(() => document.querySelector(".qa-sidebar-no-devices")); + ok( + !findSidebarItemByText("localhost:6080", document), + "Sidebar item for localhost:6080 removed" + ); + + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_runtime.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_runtime.js new file mode 100644 index 0000000000..57ac244b97 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_runtime.js @@ -0,0 +1,38 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const RUNTIME_ID = "RUNTIME_ID"; +const RUNTIME_DEVICE_NAME = "RUNTIME_DEVICE_NAME"; +const RUNTIME_SHORT_NAME = "testshort"; + +// Test that USB runtimes appear and disappear from the sidebar. +add_task(async function() { + const mocks = new Mocks(); + + const { document, tab } = await openAboutDebugging(); + + mocks.createUSBRuntime(RUNTIME_ID, { + deviceName: RUNTIME_DEVICE_NAME, + shortName: RUNTIME_SHORT_NAME, + }); + mocks.emitUSBUpdate(); + + info("Wait until the USB sidebar item appears"); + await waitUntil(() => findSidebarItemByText(RUNTIME_DEVICE_NAME, document)); + const usbRuntimeSidebarItem = findSidebarItemByText( + RUNTIME_DEVICE_NAME, + document + ); + ok( + usbRuntimeSidebarItem.textContent.includes(RUNTIME_SHORT_NAME), + "The short name of the usb runtime is visible" + ); + + mocks.removeUSBRuntime(RUNTIME_ID); + mocks.emitUSBUpdate(); + await waitUntilUsbDeviceIsUnplugged(RUNTIME_DEVICE_NAME, document); + + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_runtime_connect.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_runtime_connect.js new file mode 100644 index 0000000000..e78afd69f8 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_runtime_connect.js @@ -0,0 +1,55 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const RUNTIME_ID = "test-runtime-id"; +const RUNTIME_NAME = "test runtime name"; +const RUNTIME_DEVICE_NAME = "test device name"; +const RUNTIME_SHORT_NAME = "test short name"; + +// Test that USB runtimes appear and disappear from the sidebar, +// as well as their connect button. +// Also checks whether the label of item is updated after connecting. +add_task(async function() { + const mocks = new Mocks(); + + const { document, tab } = await openAboutDebugging(); + + mocks.createUSBRuntime(RUNTIME_ID, { + name: RUNTIME_NAME, + deviceName: RUNTIME_DEVICE_NAME, + shortName: RUNTIME_SHORT_NAME, + }); + mocks.emitUSBUpdate(); + + info("Wait until the USB sidebar item appears"); + await waitUntil(() => findSidebarItemByText(RUNTIME_DEVICE_NAME, document)); + const usbRuntimeSidebarItem = findSidebarItemByText( + RUNTIME_DEVICE_NAME, + document + ); + const connectButton = usbRuntimeSidebarItem.querySelector( + ".qa-connect-button" + ); + ok(connectButton, "Connect button is displayed for the USB runtime"); + + info("Click on the connect button and wait until it disappears"); + connectButton.click(); + await waitUntil( + () => !usbRuntimeSidebarItem.querySelector(".qa-connect-button") + ); + + info("Check whether the label of item is updated after connecting"); + ok( + usbRuntimeSidebarItem.textContent.includes(RUNTIME_NAME), + "Label of item updated" + ); + + info("Remove all USB runtimes"); + mocks.removeUSBRuntime(RUNTIME_ID); + mocks.emitUSBUpdate(); + await waitUntilUsbDeviceIsUnplugged(RUNTIME_DEVICE_NAME, document); + + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_runtime_refresh.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_runtime_refresh.js new file mode 100644 index 0000000000..6d88116e2f --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_runtime_refresh.js @@ -0,0 +1,50 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const RUNTIME_ID = "test-runtime-id"; +const RUNTIME_DEVICE_NAME = "test device name"; +const RUNTIME_APP_NAME = "TestApp"; + +const OTHER_RUNTIME_ID = "other-runtime-id"; +const OTHER_RUNTIME_APP_NAME = "OtherApp"; + +// Test that USB runtimes are not disconnected on refresh. +add_task(async function() { + const mocks = new Mocks(); + + const { document, tab } = await openAboutDebugging(); + + info("Create a first runtime and connect to it"); + mocks.createUSBRuntime(RUNTIME_ID, { + deviceName: RUNTIME_DEVICE_NAME, + name: RUNTIME_APP_NAME, + }); + mocks.emitUSBUpdate(); + + await connectToRuntime(RUNTIME_DEVICE_NAME, document); + await selectRuntime(RUNTIME_DEVICE_NAME, RUNTIME_APP_NAME, document); + + info("Create a second runtime and click on Refresh Devices"); + mocks.createUSBRuntime(OTHER_RUNTIME_ID, { + deviceName: OTHER_RUNTIME_APP_NAME, + }); + + // adb.updateRuntimes should ultimately fire the "runtime-list-updated" event. + mocks.adbMock.adb.updateRuntimes = () => mocks.emitUSBUpdate(); + document.querySelector(".qa-refresh-devices-button").click(); + + info(`Wait until the sidebar item for ${OTHER_RUNTIME_APP_NAME} appears`); + await waitUntil(() => + findSidebarItemByText(OTHER_RUNTIME_APP_NAME, document) + ); + + const sidebarItem = findSidebarItemByText(RUNTIME_DEVICE_NAME, document); + ok( + !sidebarItem.querySelector(".qa-connect-button"), + "Original USB runtime is still connected" + ); + + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_runtime_select.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_runtime_select.js new file mode 100644 index 0000000000..a88af3d8b9 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_runtime_select.js @@ -0,0 +1,44 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const RUNTIME_DEVICE_ID = "1234"; +const RUNTIME_DEVICE_NAME = "A device"; + +// Test that we can select a runtime in the sidebar +add_task(async function() { + const mocks = new Mocks(); + + const { document, tab } = await openAboutDebugging(); + + mocks.createUSBRuntime(RUNTIME_DEVICE_ID, { + deviceName: RUNTIME_DEVICE_NAME, + }); + mocks.emitUSBUpdate(); + + info("Wait until the USB sidebar item appears"); + await waitUntil(() => findSidebarItemByText(RUNTIME_DEVICE_NAME, document)); + const sidebarItem = findSidebarItemByText(RUNTIME_DEVICE_NAME, document); + const connectButton = sidebarItem.querySelector(".qa-connect-button"); + ok(connectButton, "Connect button is displayed for the USB runtime"); + + info( + "Click on the connect button and wait until the sidebar displays a link" + ); + connectButton.click(); + await waitUntil(() => + findSidebarItemLinkByText(RUNTIME_DEVICE_NAME, document) + ); + + info("Click on the runtime link"); + const link = findSidebarItemLinkByText(RUNTIME_DEVICE_NAME, document); + link.click(); + is( + document.location.hash, + `#/runtime/${RUNTIME_DEVICE_ID}`, + "Redirection to runtime page" + ); + + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_status.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_status.js new file mode 100644 index 0000000000..3d02e7a866 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_status.js @@ -0,0 +1,50 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const { + adbAddon, +} = require("devtools/client/shared/remote-debugging/adb/adb-addon"); + +/** + * This test asserts that the sidebar shows a message describing the status of the USB + * devices scanning. + */ +add_task(async function() { + const mocks = new Mocks(); + + await pushPref( + "devtools.remote.adb.extensionURL", + CHROME_URL_ROOT + "resources/test-adb-extension/adb-extension-#OS#.xpi" + ); + const { document, tab } = await openAboutDebugging(); + + const usbStatusElement = document.querySelector(".qa-sidebar-usb-status"); + ok(usbStatusElement, "Sidebar shows the USB status element"); + ok( + usbStatusElement.textContent.includes("USB disabled"), + "USB status element has 'disabled' content" + ); + + info("Install the adb extension and wait for the message to udpate"); + // Use "internal" as the install source to avoid triggering telemetry. + adbAddon.install("internal"); + // When using mocks, we manually control the .start() call + await mocks.adbProcessMock.adbProcess.start(); + + info("Wait till the USB status element has 'enabled' content"); + await waitUntil(() => { + const el = document.querySelector(".qa-sidebar-usb-status"); + return el.textContent.includes("USB enabled"); + }); + + info("Uninstall the adb extension and wait for USB status element to update"); + adbAddon.uninstall(); + await waitUntil(() => { + const el = document.querySelector(".qa-sidebar-usb-status"); + return el.textContent.includes("USB disabled"); + }); + + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_unavailable_runtime.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_unavailable_runtime.js new file mode 100644 index 0000000000..4ec5c03a02 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_unavailable_runtime.js @@ -0,0 +1,66 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const RUNTIME_NAME = "Firefox 123"; +const DEVICE_NAME = "DEVICE_NAME"; +const DEVICE_ID = "DEVICE_ID"; +const RUNTIME_ID = "RUNTIME_ID"; + +// Test that unavailable runtimes: +// - are displayed without a connect button. +// - cannot be selected +// - display a specific text ("Waiting for runtime") instead of the runtime name +add_task(async function() { + const mocks = new Mocks(); + const { document, tab } = await openAboutDebugging(); + + info("Create a device without a corresponding runtime"); + mocks.addDevice(DEVICE_ID, DEVICE_NAME); + mocks.emitUSBUpdate(); + + info("Wait until the USB sidebar item appears"); + await waitUntil(() => findSidebarItemByText(DEVICE_NAME, document)); + + const usbRuntimeSidebarItem = findSidebarItemByText(DEVICE_NAME, document); + + ok( + usbRuntimeSidebarItem.querySelector(".qa-runtime-item-waiting-for-browser"), + "Sidebar item shows as `Waiting for browser`" + ); + + const hasConnectButton = usbRuntimeSidebarItem.querySelector( + ".qa-connect-button" + ); + ok(!hasConnectButton, "Connect button is not displayed"); + + const hasLink = usbRuntimeSidebarItem.querySelector(".qa-sidebar-link"); + ok(!hasLink, "Unavailable runtime is not selectable"); + + info("Add a valid runtime for the same device id and emit update event"); + mocks.createUSBRuntime(RUNTIME_ID, { + deviceId: DEVICE_ID, + deviceName: DEVICE_NAME, + shortName: RUNTIME_NAME, + }); + mocks.removeDevice(DEVICE_ID); + mocks.emitUSBUpdate(); + + info("Wait until connect button appears for the USB runtime"); + let updatedSidebarItem = null; + await waitUntil(() => { + updatedSidebarItem = findSidebarItemByText(DEVICE_NAME, document); + return ( + updatedSidebarItem && + updatedSidebarItem.querySelector(".qa-connect-button") + ); + }); + + ok( + updatedSidebarItem.querySelector(".qa-runtime-item-standard"), + "Sidebar item for the USB runtime is now a standard sidebar item" + ); + + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_unplugged_device.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_unplugged_device.js new file mode 100644 index 0000000000..68d00b19bf --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_sidebar_usb_unplugged_device.js @@ -0,0 +1,69 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const RUNTIME_NAME = "RUNTIME_NAME_1"; +const DEVICE_NAME = "DEVICE_NAME_1"; +const DEVICE_ID = "DEVICE_ID_1"; +const RUNTIME_ID = "RUNTIME_ID_1"; + +const RUNTIME_NAME_2 = "RUNTIME_NAME_2"; +const DEVICE_NAME_2 = "DEVICE_NAME_2"; +const DEVICE_ID_2 = "DEVICE_ID_2"; +const RUNTIME_ID_2 = "RUNTIME_ID_2"; + +// Test that removed USB devices are still visible as "Unplugged devices", until +// about:debugging is reloaded. +add_task(async function() { + const mocks = new Mocks(); + let { document, tab } = await openAboutDebugging(); + + info("Create a mocked USB runtime"); + mocks.createUSBRuntime(RUNTIME_ID, { + deviceId: DEVICE_ID, + deviceName: DEVICE_NAME, + shortName: RUNTIME_NAME, + }); + mocks.emitUSBUpdate(); + + info("Wait until the USB sidebar item appears"); + await waitUntil(() => findSidebarItemByText(DEVICE_NAME, document)); + const sidebarItem = findSidebarItemByText(DEVICE_NAME, document); + ok( + sidebarItem.textContent.includes(RUNTIME_NAME), + "Sidebar item shows the runtime name" + ); + + mocks.removeUSBRuntime(RUNTIME_ID); + mocks.emitUSBUpdate(); + await waitUntilUsbDeviceIsUnplugged(DEVICE_NAME, document); + + const unpluggedItem = findSidebarItemByText(DEVICE_NAME, document); + ok( + unpluggedItem.querySelector(".qa-runtime-item-unplugged"), + "Sidebar item is shown as `Unplugged…`" + ); + + info("Reload about:debugging"); + document = await reloadAboutDebugging(tab); + + info( + "Add another mocked USB runtime, to make sure the sidebar items are rendered." + ); + mocks.createUSBRuntime(RUNTIME_ID_2, { + deviceId: DEVICE_ID_2, + deviceName: DEVICE_NAME_2, + shortName: RUNTIME_NAME_2, + }); + mocks.emitUSBUpdate(); + + info("Wait until the other USB sidebar item appears"); + await waitUntil(() => findSidebarItemByText(DEVICE_NAME_2, document)); + ok( + !findSidebarItemByText(DEVICE_NAME, document), + "Unplugged device is no longer displayed after reloading aboutdebugging" + ); + + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_tab_favicons.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_tab_favicons.js new file mode 100644 index 0000000000..3416cba210 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_tab_favicons.js @@ -0,0 +1,57 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/** + * Check that about:debugging uses the favicon of tab targets as the icon of their debug + * target item, and doesn't always use the default globe icon. + */ + +// PlaceUtils will not store any favicon for data: uris so we need to use a dedicated page +// here. +const TAB_URL = + "https://example.com/browser/devtools/client/aboutdebugging/" + + "test/browser/test-tab-favicons.html"; + +// This is the same png data-url as the one used in test-tab-favicons.html. +const EXPECTED_FAVICON = + "data:image/png;base64," + + "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAATklEQVRYhe3SIQ4AI" + + "BADwf7/04elBAtrVlSduGnSTDJ7cuT1PQJwwO+Hl7sAGAA07gjAAfgIBeAAoH" + + "FHAA7ARygABwCNOwJwAD5CATRgAYXh+kypw86nAAAAAElFTkSuQmCC"; + +add_task(async function() { + const faviconTab = await addTab(TAB_URL, { background: true }); + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + await waitUntil(() => { + const target = findDebugTargetByText("Favicon tab", document); + if (!target) { + return false; + } + // We may get a default globe.svg icon for a short period of time while + // the target tab is still loading. + return target + .querySelector(".qa-debug-target-item-icon") + .src.includes("data:"); + }); + const faviconTabTarget = findDebugTargetByText("Favicon tab", document); + const faviconTabIcon = faviconTabTarget.querySelector( + ".qa-debug-target-item-icon" + ); + + // Note this relies on PlaceUtils.promiseFaviconData returning the same data-url as the + // one provided in the test page. If the implementation changes and PlaceUtils returns a + // different base64 from the one we defined, we can instead load the image and check a + // few pixels to verify it matches the expected icon. + is( + faviconTabIcon.src, + EXPECTED_FAVICON, + "The debug target item for the tab shows the favicon of the tab" + ); + + await removeTab(tab); + await removeTab(faviconTab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_tab_zombietab.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_tab_zombietab.js new file mode 100644 index 0000000000..8232be7c45 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_tab_zombietab.js @@ -0,0 +1,110 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +let gUniqueCounter = 0; +const { E10SUtils } = ChromeUtils.import( + "resource://gre/modules/E10SUtils.jsm" +); +const triggeringPrincipal_base64 = E10SUtils.SERIALIZED_SYSTEMPRINCIPAL; + +const BROWSER_STATE_TABS = [ + "about:debugging", + "data:text/html,<title>TEST_TAB_1</title>", + "data:text/html,<title>TEST_TAB_2</title>", + "data:text/html,<title>TEST_TAB_3</title>", +]; +const BROWSER_STATE = { + windows: [ + { + tabs: BROWSER_STATE_TABS.map(url => { + return { + entries: [{ url, triggeringPrincipal_base64 }], + extData: { uniq: Date.now() + "-" + ++gUniqueCounter }, + }; + }), + selected: 1, + }, + ], +}; + +// Check that the inspect action is disabled for lazy/zombie tabs, such as the +// ones created after a session restore. +add_task(async function() { + // This setup is normally handed by the openAboutDebugging helper, but here we + // open about:debugging via session restore. + silenceWorkerUpdates(); + await pushPref("devtools.aboutdebugging.local-tab-debugging", true); + + info("Restore 4 tabs including a selected about:debugging tab"); + const onBrowserSessionRestored = Promise.all([ + TestUtils.topicObserved("sessionstore-browser-state-restored"), + BrowserTestUtils.waitForEvent(gBrowser.tabContainer, "SSTabRestored"), + ]); + SessionStore.setBrowserState(JSON.stringify(BROWSER_STATE)); + await onBrowserSessionRestored; + + const tab = gBrowser.selectedTab; + const browser = tab.linkedBrowser; + const doc = browser.contentDocument; + const win = browser.contentWindow; + const store = win.AboutDebugging.store; + + info("Wait until Connect page is displayed"); + await waitUntil(() => doc.querySelector(".qa-connect-page")); + + await selectThisFirefoxPage(doc, store); + + // Check that all inspect butttons are disabled. + checkInspectButton("TEST_TAB_1", doc, { expectDisabled: true }); + checkInspectButton("TEST_TAB_2", doc, { expectDisabled: true }); + checkInspectButton("TEST_TAB_3", doc, { expectDisabled: true }); + + info("Select the TEST_TAB_2 tab top restore it completely"); + const onTabRestored = BrowserTestUtils.waitForEvent( + gBrowser.tabContainer, + "SSTabRestored" + ); + gBrowser.selectedTab = gBrowser.tabs[2]; + await onTabRestored; + + const onTabsSuccess = waitForDispatch(store, "REQUEST_TABS_SUCCESS"); + + info("Select the about:debugging tab again"); + gBrowser.selectedTab = tab; + + info("Wait until the tabs update is finished"); + await onTabsSuccess; + + info("Wait until the inspect button for TEST_TAB_2 is enabled"); + await waitUntil(() => { + const target = findDebugTargetByText("TEST_TAB_2", doc); + if (!target) { + // TEST_TAB_2 target might be missing while the tab target list updates. + return false; + } + + const button = target.querySelector(".qa-debug-target-inspect-button"); + return !button.disabled; + }); + + // Check that all inspect butttons are disabled, except for #2. + checkInspectButton("TEST_TAB_1", doc, { expectDisabled: true }); + checkInspectButton("TEST_TAB_2", doc, { expectDisabled: false }); + checkInspectButton("TEST_TAB_3", doc, { expectDisabled: true }); +}); + +function checkInspectButton(targetText, doc, { expectDisabled }) { + const inspectButton = getInspectButton(targetText, doc); + if (expectDisabled) { + ok(inspectButton.disabled, `Inspect button is disabled for ${targetText}`); + } else { + ok(!inspectButton.disabled, `Inspect button is enabled for ${targetText}`); + } +} + +function getInspectButton(targetText, doc) { + const targetElement = findDebugTargetByText(targetText, doc); + return targetElement.querySelector(".qa-debug-target-inspect-button"); +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_basic.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_basic.js new file mode 100644 index 0000000000..587c8caf0a --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_basic.js @@ -0,0 +1,46 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-telemetry.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-telemetry.js", + this +); + +/** + * Check that telemetry events are recorded when opening and closing about debugging. + */ +add_task(async function() { + setupTelemetryTest(); + + const { tab } = await openAboutDebugging(); + + const openEvents = readAboutDebuggingEvents().filter( + e => e.method === "open_adbg" + ); + is( + openEvents.length, + 1, + "Exactly one open event was logged for about:debugging" + ); + const sessionId = openEvents[0].extras.session_id; + ok(!isNaN(sessionId), "Open event has a valid session id"); + + await removeTab(tab); + + const closeEvents = readAboutDebuggingEvents().filter( + e => e.method === "close_adbg" + ); + is( + closeEvents.length, + 1, + "Exactly one close event was logged for about:debugging" + ); + is( + closeEvents[0].extras.session_id, + sessionId, + "Close event has the same session id as the open event" + ); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_connection_attempt.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_connection_attempt.js new file mode 100644 index 0000000000..643226bb25 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_connection_attempt.js @@ -0,0 +1,297 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-telemetry.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-telemetry.js", + this +); + +const USB_RUNTIME = { + id: "runtime-id-1", + deviceName: "Device A", + name: "Runtime 1", + shortName: "R1", +}; + +/** + * Check that telemetry events for connection attempts are correctly recorded in various + * scenarios: + * - successful connection + * - successful connection after showing the timeout warning + * - failed connection + * - connection timeout + */ +add_task(async function testSuccessfulConnectionAttempt() { + const { + doc, + mocks, + runtimeId, + sessionId, + tab, + } = await setupConnectionAttemptTest(); + + await connectToRuntime(USB_RUNTIME.deviceName, doc); + + const connectionEvents = checkTelemetryEvents( + [ + { method: "runtime_connected", extras: { runtime_id: runtimeId } }, + { + method: "connection_attempt", + extras: getEventExtras("start", runtimeId), + }, + { + method: "connection_attempt", + extras: getEventExtras("success", runtimeId), + }, + ], + sessionId + ).filter(({ method }) => method === "connection_attempt"); + + checkConnectionId(connectionEvents); + + await removeUsbRuntime(USB_RUNTIME, mocks, doc); + await removeTab(tab); +}); + +add_task(async function testFailedConnectionAttempt() { + const { + doc, + mocks, + runtimeId, + sessionId, + tab, + } = await setupConnectionAttemptTest(); + mocks.runtimeClientFactoryMock.createClientForRuntime = async runtime => { + throw new Error("failed"); + }; + + info( + "Try to connect to the runtime and wait for the connection error message" + ); + const usbRuntimeSidebarItem = findSidebarItemByText( + USB_RUNTIME.deviceName, + doc + ); + const connectButton = usbRuntimeSidebarItem.querySelector( + ".qa-connect-button" + ); + connectButton.click(); + await waitUntil(() => + usbRuntimeSidebarItem.querySelector(".qa-connection-error") + ); + + const connectionEvents = checkTelemetryEvents( + [ + { + method: "connection_attempt", + extras: getEventExtras("start", runtimeId), + }, + { + method: "connection_attempt", + extras: getEventExtras("failed", runtimeId), + }, + ], + sessionId + ).filter(({ method }) => method === "connection_attempt"); + + checkConnectionId(connectionEvents); + + await removeUsbRuntime(USB_RUNTIME, mocks, doc); + await removeTab(tab); +}); + +add_task(async function testPendingConnectionAttempt() { + info("Set timeout preferences to avoid cancelling the connection"); + await pushPref( + "devtools.aboutdebugging.test-connection-timing-out-delay", + 100 + ); + await pushPref( + "devtools.aboutdebugging.test-connection-cancel-delay", + 100000 + ); + + const { + doc, + mocks, + runtimeId, + sessionId, + tab, + } = await setupConnectionAttemptTest(); + + info("Simulate a pending connection"); + let resumeConnection; + const resumeConnectionPromise = new Promise(r => { + resumeConnection = r; + }); + mocks.runtimeClientFactoryMock.createClientForRuntime = async runtime => { + await resumeConnectionPromise; + return mocks._clients[runtime.type][runtime.id]; + }; + + info("Click on the connect button and wait for the warning message"); + const usbRuntimeSidebarItem = findSidebarItemByText( + USB_RUNTIME.deviceName, + doc + ); + const connectButton = usbRuntimeSidebarItem.querySelector( + ".qa-connect-button" + ); + connectButton.click(); + await waitUntil(() => doc.querySelector(".qa-connection-not-responding")); + + info("Resume the connection and wait for the connection to succeed"); + resumeConnection(); + await waitUntil( + () => !usbRuntimeSidebarItem.querySelector(".qa-connect-button") + ); + + const connectionEvents = checkTelemetryEvents( + [ + { method: "runtime_connected", extras: { runtime_id: runtimeId } }, + { + method: "connection_attempt", + extras: getEventExtras("start", runtimeId), + }, + { + method: "connection_attempt", + extras: getEventExtras("not responding", runtimeId), + }, + { + method: "connection_attempt", + extras: getEventExtras("success", runtimeId), + }, + ], + sessionId + ).filter(({ method }) => method === "connection_attempt"); + checkConnectionId(connectionEvents); + + await removeUsbRuntime(USB_RUNTIME, mocks, doc); + await removeTab(tab); +}); + +add_task(async function testCancelledConnectionAttempt() { + info("Set timeout preferences to quickly cancel the connection"); + await pushPref( + "devtools.aboutdebugging.test-connection-timing-out-delay", + 100 + ); + await pushPref("devtools.aboutdebugging.test-connection-cancel-delay", 1000); + + const { + doc, + mocks, + runtimeId, + sessionId, + tab, + } = await setupConnectionAttemptTest(); + + info("Simulate a connection timeout"); + mocks.runtimeClientFactoryMock.createClientForRuntime = async runtime => { + await new Promise(r => {}); + }; + + info("Click on the connect button and wait for the error message"); + const usbRuntimeSidebarItem = findSidebarItemByText( + USB_RUNTIME.deviceName, + doc + ); + const connectButton = usbRuntimeSidebarItem.querySelector( + ".qa-connect-button" + ); + connectButton.click(); + await waitUntil(() => + usbRuntimeSidebarItem.querySelector(".qa-connection-timeout") + ); + + const connectionEvents = checkTelemetryEvents( + [ + { + method: "connection_attempt", + extras: getEventExtras("start", runtimeId), + }, + { + method: "connection_attempt", + extras: getEventExtras("not responding", runtimeId), + }, + { + method: "connection_attempt", + extras: getEventExtras("cancelled", runtimeId), + }, + ], + sessionId + ).filter(({ method }) => method === "connection_attempt"); + checkConnectionId(connectionEvents); + + await removeUsbRuntime(USB_RUNTIME, mocks, doc); + await removeTab(tab); +}); + +function checkConnectionId(connectionEvents) { + const connectionId = connectionEvents[0].extras.connection_id; + ok( + !!connectionId, + "Found a valid connection id in the first connection_attempt event" + ); + for (const evt of connectionEvents) { + is( + evt.extras.connection_id, + connectionId, + "All connection_attempt events share the same connection id" + ); + } +} + +// Small helper to create the expected event extras object for connection_attempt events +function getEventExtras(status, runtimeId) { + return { + connection_type: "usb", + runtime_id: runtimeId, + status, + }; +} + +// Open about:debugging, setup telemetry, mocks and create a mocked USB runtime. +async function setupConnectionAttemptTest() { + const mocks = new Mocks(); + setupTelemetryTest(); + + const { tab, document } = await openAboutDebugging(); + + const sessionId = getOpenEventSessionId(); + ok(!isNaN(sessionId), "Open event has a valid session id"); + + mocks.createUSBRuntime(USB_RUNTIME.id, { + deviceName: USB_RUNTIME.deviceName, + name: USB_RUNTIME.name, + shortName: USB_RUNTIME.shortName, + }); + mocks.emitUSBUpdate(); + + info("Wait for the runtime to appear in the sidebar"); + await waitUntil(() => findSidebarItemByText(USB_RUNTIME.shortName, document)); + const evts = checkTelemetryEvents( + [ + { method: "device_added", extras: {} }, + { method: "runtime_added", extras: {} }, + ], + sessionId + ); + + const runtimeId = evts.filter(e => e.method === "runtime_added")[0].extras + .runtime_id; + return { doc: document, mocks, runtimeId, sessionId, tab }; +} + +async function removeUsbRuntime(runtime, mocks, doc) { + mocks.removeRuntime(runtime.id); + mocks.emitUSBUpdate(); + await waitUntil( + () => + !findSidebarItemByText(runtime.name, doc) && + !findSidebarItemByText(runtime.shortName, doc) + ); +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_inspect.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_inspect.js new file mode 100644 index 0000000000..bea4055d2b --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_inspect.js @@ -0,0 +1,67 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-telemetry.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-telemetry.js", + this +); + +const TAB_URL = "data:text/html,<title>TEST_TAB</title>"; + +/** + * Check that telemetry events are recorded when inspecting a target. + */ +add_task(async function() { + setupTelemetryTest(); + + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + const sessionId = getOpenEventSessionId(); + ok(!isNaN(sessionId), "Open event has a valid session id"); + + info("Open a new background tab TEST_TAB"); + const backgroundTab1 = await addTab(TAB_URL, { background: true }); + + info("Wait for the tab to appear in the debug targets with the correct name"); + await waitUntil(() => findDebugTargetByText("TEST_TAB", document)); + + const { devtoolsTab } = await openAboutDevtoolsToolbox( + document, + tab, + window, + "TEST_TAB" + ); + + const evts = readAboutDebuggingEvents().filter(e => e.method === "inspect"); + is(evts.length, 1, "Exactly one Inspect event found"); + is( + evts[0].extras.target_type, + "TAB", + "Inspect event has the expected target type" + ); + is( + evts[0].extras.runtime_type, + "this-firefox", + "Inspect event has the expected runtime type" + ); + is( + evts[0].extras.session_id, + sessionId, + "Inspect event has the expected session" + ); + + info("Close the about:devtools-toolbox tab"); + await closeAboutDevtoolsToolbox(document, devtoolsTab, window); + await waitForRequestsToSettle(window.AboutDebugging.store); + + info("Remove first background tab"); + await removeTab(backgroundTab1); + await waitUntil(() => !findDebugTargetByText("TEST_TAB", document)); + await waitForRequestsToSettle(window.AboutDebugging.store); + + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_navigate.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_navigate.js new file mode 100644 index 0000000000..4c7251ef51 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_navigate.js @@ -0,0 +1,67 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; +/* import-globals-from helper-telemetry.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-telemetry.js", + this +); + +/** + * Check that telemetry events are recorded when navigating between different + * about:debugging pages. + */ +add_task(async function() { + // enable USB devices mocks + const mocks = new Mocks(); + + setupTelemetryTest(); + + const { tab, document, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + const sessionId = getOpenEventSessionId(); + ok(!isNaN(sessionId), "Open event has a valid session id"); + + info("Navigate to 'Connect' page"); + document.location.hash = "#/connect"; + await waitUntil(() => document.querySelector(".qa-connect-page")); + checkSelectPageEvent("connect", sessionId); + + info("Navigate to 'USB device runtime' page"); + await navigateToUSBRuntime(mocks, document); + checkSelectPageEvent("runtime", sessionId); + await waitForRequestsToSettle(window.AboutDebugging.store); + + await removeTab(tab); +}); + +function checkSelectPageEvent(expectedType, expectedSessionId) { + const evts = readAboutDebuggingEvents().filter( + e => e.method === "select_page" + ); + is(evts.length, 1, "Exactly one select_page event recorded"); + is( + evts[0].extras.page_type, + expectedType, + "Select page event has the expected type" + ); + is( + evts[0].extras.session_id, + expectedSessionId, + "Select page event has the expected session" + ); +} + +async function navigateToUSBRuntime(mocks, doc) { + mocks.createUSBRuntime("1337id", { + deviceName: "Fancy Phone", + name: "Lorem ipsum", + }); + mocks.emitUSBUpdate(); + await connectToRuntime("Fancy Phone", doc); + // navigate to it via URL + doc.location.hash = "#/runtime/1337id"; + await waitUntil(() => doc.querySelector(".qa-runtime-page")); +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_actions.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_actions.js new file mode 100644 index 0000000000..92d07a3d9c --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_actions.js @@ -0,0 +1,97 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-telemetry.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-telemetry.js", + this +); + +const RUNTIME_ID = "test-runtime-id"; +const RUNTIME_NAME = "Test Runtime"; +const RUNTIME_DEVICE_NAME = "Test Device"; + +/** + * Test that runtime specific actions are logged as telemetry events with the expected + * runtime id and action type. + */ +add_task(async function testUsbRuntimeUpdates() { + // enable USB devices mocks + const mocks = new Mocks(); + setupTelemetryTest(); + + const { tab, document } = await openAboutDebugging(); + + const sessionId = getOpenEventSessionId(); + ok(!isNaN(sessionId), "Open event has a valid session id"); + + const usbClient = mocks.createUSBRuntime(RUNTIME_ID, { + deviceName: RUNTIME_DEVICE_NAME, + name: RUNTIME_NAME, + shortName: RUNTIME_NAME, + }); + mocks.emitUSBUpdate(); + + info("Wait for the runtime to appear in the sidebar"); + await waitUntil(() => findSidebarItemByText(RUNTIME_NAME, document)); + await connectToRuntime(RUNTIME_DEVICE_NAME, document); + await selectRuntime(RUNTIME_DEVICE_NAME, RUNTIME_NAME, document); + + info("Read telemetry events to flush unrelated events"); + const evts = readAboutDebuggingEvents(); + const runtimeAddedEvent = evts.filter(e => e.method === "runtime_added")[0]; + const telemetryRuntimeId = runtimeAddedEvent.extras.runtime_id; + + info("Click on the toggle button and wait until the text is updated"); + const promptButton = document.querySelector( + ".qa-connection-prompt-toggle-button" + ); + promptButton.click(); + await waitUntil(() => promptButton.textContent.includes("Enable")); + + checkTelemetryEvents( + [ + { + method: "update_conn_prompt", + extras: { prompt_enabled: "false", runtime_id: telemetryRuntimeId }, + }, + ], + sessionId + ); + + info("Click on the toggle button again and check we log the correct value"); + promptButton.click(); + await waitUntil(() => promptButton.textContent.includes("Disable")); + + checkTelemetryEvents( + [ + { + method: "update_conn_prompt", + extras: { prompt_enabled: "true", runtime_id: telemetryRuntimeId }, + }, + ], + sessionId + ); + + info("Open the profiler dialog"); + await openProfilerDialog(usbClient, document); + + checkTelemetryEvents( + [ + { + method: "show_profiler", + extras: { runtime_id: telemetryRuntimeId }, + }, + ], + sessionId + ); + + info("Remove runtime"); + mocks.removeRuntime(RUNTIME_ID); + mocks.emitUSBUpdate(); + await waitUntil(() => !findSidebarItemByText(RUNTIME_NAME, document)); + + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_connected_details.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_connected_details.js new file mode 100644 index 0000000000..729eec9da7 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_connected_details.js @@ -0,0 +1,69 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-telemetry.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-telemetry.js", + this +); + +const REMOTE_RUNTIME_ID = "remote-runtime"; +const REMOTE_RUNTIME = "Remote Runtime"; +const REMOTE_DEVICE = "Remote Device"; + +const REMOTE_VERSION = "12.0a1"; +const REMOTE_OS = "SOME_OS"; + +/** + * Runtime connected events will log additional extras about the runtime connection that + * was established. + */ +add_task(async function() { + const mocks = new Mocks(); + + const usbClient = mocks.createUSBRuntime(REMOTE_RUNTIME_ID, { + deviceName: REMOTE_DEVICE, + name: REMOTE_RUNTIME, + shortName: REMOTE_RUNTIME, + }); + usbClient.getDeviceDescription = () => { + return { + os: REMOTE_OS, + version: REMOTE_VERSION, + }; + }; + + const { document, tab } = await openAboutDebugging(); + + mocks.emitUSBUpdate(); + await connectToRuntime(REMOTE_DEVICE, document); + const evts = readAboutDebuggingEvents().filter( + e => e.method === "runtime_connected" + ); + + is( + evts.length, + 1, + "runtime_connected event logged when connecting to remote runtime" + ); + const { + connection_type, + device_name, + runtime_name, + runtime_os, + runtime_version, + } = evts[0].extras; + is(connection_type, "usb", "Expected value for `connection_type` extra"); + is(device_name, REMOTE_DEVICE, "Expected value for `device_name` extra"); + is(runtime_name, REMOTE_RUNTIME, "Expected value for `runtime_name` extra"); + is(runtime_os, REMOTE_OS, "Expected value for `runtime_os` extra"); + is( + runtime_version, + REMOTE_VERSION, + "Expected value for `runtime_version` extra" + ); + + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_updates.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_updates.js new file mode 100644 index 0000000000..51934550a8 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_updates.js @@ -0,0 +1,154 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-telemetry.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-telemetry.js", + this +); + +const DEVICE_A = "Device A"; +const USB_RUNTIME_1 = { + id: "runtime-id-1", + deviceName: DEVICE_A, + name: "Runtime 1", + shortName: "R1", +}; + +const USB_RUNTIME_2 = { + id: "runtime-id-2", + deviceName: DEVICE_A, + name: "Runtime 2", + shortName: "R2", +}; + +const DEVICE_A_EXTRAS = { + connection_type: "usb", + device_name: DEVICE_A, +}; + +const RUNTIME_1_EXTRAS = { + connection_type: "usb", + device_name: USB_RUNTIME_1.deviceName, + runtime_name: USB_RUNTIME_1.shortName, +}; + +const RUNTIME_2_EXTRAS = { + connection_type: "usb", + device_name: USB_RUNTIME_2.deviceName, + runtime_name: USB_RUNTIME_2.shortName, +}; + +/** + * Check that telemetry events are recorded for USB runtimes when: + * - adding a device/runtime + * - removing a device/runtime + * - connecting to a runtime + */ +add_task(async function testUsbRuntimeUpdates() { + // enable USB devices mocks + const mocks = new Mocks(); + setupTelemetryTest(); + + const { tab, document } = await openAboutDebugging(); + + const sessionId = getOpenEventSessionId(); + ok(!isNaN(sessionId), "Open event has a valid session id"); + + await addUsbRuntime(USB_RUNTIME_1, mocks, document); + + let evts = checkTelemetryEvents( + [ + { method: "device_added", extras: DEVICE_A_EXTRAS }, + { method: "runtime_added", extras: RUNTIME_1_EXTRAS }, + ], + sessionId + ); + + // Now that a first telemetry event has been logged for RUNTIME_1, retrieve the id + // generated for telemetry, and check that we keep logging the same id for all events + // related to runtime 1. + const runtime1Id = evts.filter(e => e.method === "runtime_added")[0].extras + .runtime_id; + const runtime1Extras = Object.assign({}, RUNTIME_1_EXTRAS, { + runtime_id: runtime1Id, + }); + // Same as runtime1Extras, but the runtime name should be the complete one. + const runtime1ConnectedExtras = Object.assign({}, runtime1Extras, { + runtime_name: USB_RUNTIME_1.name, + }); + + await connectToRuntime(USB_RUNTIME_1.deviceName, document); + + checkTelemetryEvents( + [ + { method: "runtime_connected", extras: runtime1ConnectedExtras }, + { method: "connection_attempt", extras: { status: "start" } }, + { method: "connection_attempt", extras: { status: "success" } }, + ], + sessionId + ); + + info("Add a second runtime"); + await addUsbRuntime(USB_RUNTIME_2, mocks, document); + evts = checkTelemetryEvents( + [{ method: "runtime_added", extras: RUNTIME_2_EXTRAS }], + sessionId + ); + + // Similar to what we did for RUNTIME_1,w e want to check we reuse the same telemetry id + // for all the events related to RUNTIME_2. + const runtime2Id = evts.filter(e => e.method === "runtime_added")[0].extras + .runtime_id; + const runtime2Extras = Object.assign({}, RUNTIME_2_EXTRAS, { + runtime_id: runtime2Id, + }); + + info("Remove runtime 1"); + await removeUsbRuntime(USB_RUNTIME_1, mocks, document); + + checkTelemetryEvents( + [ + { method: "runtime_disconnected", extras: runtime1ConnectedExtras }, + { method: "runtime_removed", extras: runtime1Extras }, + ], + sessionId + ); + + info("Remove runtime 2"); + await removeUsbRuntime(USB_RUNTIME_2, mocks, document); + + checkTelemetryEvents( + [ + { method: "runtime_removed", extras: runtime2Extras }, + { method: "device_removed", extras: DEVICE_A_EXTRAS }, + ], + sessionId + ); + + await removeTab(tab); +}); + +async function addUsbRuntime(runtime, mocks, doc) { + mocks.createUSBRuntime(runtime.id, { + deviceName: runtime.deviceName, + name: runtime.name, + shortName: runtime.shortName, + }); + mocks.emitUSBUpdate(); + + info("Wait for the runtime to appear in the sidebar"); + await waitUntil(() => findSidebarItemByText(runtime.shortName, doc)); +} + +async function removeUsbRuntime(runtime, mocks, doc) { + mocks.removeRuntime(runtime.id); + mocks.emitUSBUpdate(); + await waitUntil( + () => + !findSidebarItemByText(runtime.name, doc) && + !findSidebarItemByText(runtime.shortName, doc) + ); +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_updates_multi.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_updates_multi.js new file mode 100644 index 0000000000..c1a121c493 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_updates_multi.js @@ -0,0 +1,111 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-telemetry.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-telemetry.js", + this +); + +const DEVICE_A = "Device A"; +const USB_RUNTIME_1 = { + id: "runtime-id-1", + deviceName: DEVICE_A, + name: "Runtime 1", + shortName: "R1", +}; + +const USB_RUNTIME_2 = { + id: "runtime-id-2", + deviceName: DEVICE_A, + name: "Runtime 2", + shortName: "R2", +}; + +const DEVICE_A_EXTRAS = { + connection_type: "usb", + device_name: DEVICE_A, +}; + +const RUNTIME_1_EXTRAS = { + connection_type: "usb", + device_name: USB_RUNTIME_1.deviceName, + runtime_name: USB_RUNTIME_1.shortName, +}; + +const RUNTIME_2_EXTRAS = { + connection_type: "usb", + device_name: USB_RUNTIME_2.deviceName, + runtime_name: USB_RUNTIME_2.shortName, +}; + +/** + * Test runtime update events when a device is connected/disconnected with multiple + * runtimes available on the same device. + */ +add_task(async function() { + // enable USB devices mocks + const mocks = new Mocks(); + setupTelemetryTest(); + + const { tab, document } = await openAboutDebugging(); + + const sessionId = getOpenEventSessionId(); + ok(!isNaN(sessionId), "Open event has a valid session id"); + + info("Add two runtimes on the same device at the same time"); + mocks.createUSBRuntime(USB_RUNTIME_1.id, { + deviceName: USB_RUNTIME_1.deviceName, + name: USB_RUNTIME_1.name, + shortName: USB_RUNTIME_1.shortName, + }); + mocks.createUSBRuntime(USB_RUNTIME_2.id, { + deviceName: USB_RUNTIME_2.deviceName, + name: USB_RUNTIME_2.name, + shortName: USB_RUNTIME_2.shortName, + }); + mocks.emitUSBUpdate(); + await waitUntil(() => + findSidebarItemByText(USB_RUNTIME_1.shortName, document) + ); + await waitUntil(() => + findSidebarItemByText(USB_RUNTIME_2.shortName, document) + ); + + checkTelemetryEvents( + [ + { method: "device_added", extras: DEVICE_A_EXTRAS }, + { method: "runtime_added", extras: RUNTIME_1_EXTRAS }, + { method: "runtime_added", extras: RUNTIME_2_EXTRAS }, + ], + sessionId + ); + + info("Remove both runtimes at once to simulate a device disconnection"); + mocks.removeRuntime(USB_RUNTIME_1.id); + mocks.removeRuntime(USB_RUNTIME_2.id); + mocks.emitUSBUpdate(); + await waitUntil( + () => + !findSidebarItemByText(USB_RUNTIME_1.name, document) && + !findSidebarItemByText(USB_RUNTIME_1.shortName, document) + ); + await waitUntil( + () => + !findSidebarItemByText(USB_RUNTIME_2.name, document) && + !findSidebarItemByText(USB_RUNTIME_2.shortName, document) + ); + + checkTelemetryEvents( + [ + { method: "runtime_removed", extras: RUNTIME_1_EXTRAS }, + { method: "runtime_removed", extras: RUNTIME_2_EXTRAS }, + { method: "device_removed", extras: DEVICE_A_EXTRAS }, + ], + sessionId + ); + + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_updates_network.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_updates_network.js new file mode 100644 index 0000000000..d33810dc59 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_telemetry_runtime_updates_network.js @@ -0,0 +1,90 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-telemetry.js */ +Services.scriptloader.loadSubScript( + CHROME_URL_ROOT + "helper-telemetry.js", + this +); + +const NETWORK_RUNTIME = { + host: "localhost:1234", + // No device name for network runtimes. + name: "Local Network Runtime", +}; + +/** + * Test runtime update events for network runtimes. + */ +add_task(async function testNetworkRuntimeUpdates() { + // enable USB devices mocks + const mocks = new Mocks(); + setupTelemetryTest(); + + const { tab, document } = await openAboutDebugging(); + + const sessionId = getOpenEventSessionId(); + ok(!isNaN(sessionId), "Open event has a valid session id"); + + info("Add a network runtime"); + await addNetworkRuntime(NETWORK_RUNTIME, mocks, document); + + // Before the connection, we don't have any information about the runtime. + // Device information is also not available to network runtimes. + const networkRuntimeExtras = { + connection_type: "network", + device_name: "", + runtime_name: "", + }; + + // Once connected we should be able to log a valid runtime name. + const connectedNetworkRuntimeExtras = Object.assign( + {}, + networkRuntimeExtras, + { + runtime_name: NETWORK_RUNTIME.name, + } + ); + + // For network runtimes, we don't have any device information, so we shouldn't have any + // device_added event. + checkTelemetryEvents( + [{ method: "runtime_added", extras: networkRuntimeExtras }], + sessionId + ); + + await connectToRuntime(NETWORK_RUNTIME.host, document); + checkTelemetryEvents( + [ + { method: "runtime_connected", extras: connectedNetworkRuntimeExtras }, + { method: "connection_attempt", extras: { status: "start" } }, + { method: "connection_attempt", extras: { status: "success" } }, + ], + sessionId + ); + + info("Remove network runtime"); + mocks.removeRuntime(NETWORK_RUNTIME.host); + await waitUntil(() => !findSidebarItemByText(NETWORK_RUNTIME.host, document)); + // Similarly we should not have any device removed event. + checkTelemetryEvents( + [ + { method: "runtime_disconnected", extras: connectedNetworkRuntimeExtras }, + { method: "runtime_removed", extras: networkRuntimeExtras }, + ], + sessionId + ); + + await removeTab(tab); +}); + +async function addNetworkRuntime(runtime, mocks, doc) { + mocks.createNetworkRuntime(runtime.host, { + name: runtime.name, + }); + + info("Wait for the Network Runtime to appear in the sidebar"); + await waitUntil(() => findSidebarItemByText(runtime.host, doc)); +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_thisfirefox.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_thisfirefox.js new file mode 100644 index 0000000000..3f673df758 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_thisfirefox.js @@ -0,0 +1,121 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const EXPECTED_TARGET_PANES = [ + "Tabs", + "Temporary Extensions", + "Extensions", + "Service Workers", + "Shared Workers", + "Other Workers", +]; + +/** + * Check that the This Firefox runtime page contains the expected categories if + * the preference to enable local tab debugging is true. + */ +add_task(async function testThisFirefoxWithLocalTab() { + const { document, tab, window } = await openAboutDebugging({ + enableLocalTabs: true, + }); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + // Expect all target panes to be displayed including tabs. + await checkThisFirefoxTargetPanes(document, EXPECTED_TARGET_PANES); + + await removeTab(tab); +}); + +/** + * Check that the This Firefox runtime page contains the expected categories if + * the preference to enable local tab debugging is false. + */ +add_task(async function testThisFirefoxWithoutLocalTab() { + const { document, tab, window } = await openAboutDebugging({ + enableLocalTabs: false, + }); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + // Expect all target panes but tabs to be displayed. + const expectedTargetPanesWithoutTabs = EXPECTED_TARGET_PANES.filter( + p => p !== "Tabs" + ); + await checkThisFirefoxTargetPanes(document, expectedTargetPanesWithoutTabs); + + await removeTab(tab); +}); + +/** + * Check that the tab which is discarded keeps the state after open the aboutdebugging. + */ +add_task(async function testThisFirefoxKeepDiscardedTab() { + const targetTab = await addTab("https://example.com/"); + const blankTab = await addTab("about:blank"); + targetTab.ownerGlobal.gBrowser.discardBrowser(targetTab); + + const { document, tab, window } = await openAboutDebugging({ + enableLocalTabs: false, + }); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + ok(!targetTab.linkedPanel, "The target tab is still discarded"); + + await removeTab(blankTab); + await removeTab(targetTab); + await removeTab(tab); +}); + +/** + * Check that the Temporary Extensions is hidden if "xpinstall.enabled" is set to false. + */ +add_task(async function testThisFirefoxWithXpinstallDisabled() { + await pushPref("xpinstall.enabled", false); + + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + // Expect all target panes but temporary extensions to be displayed. + const expectedTargetPanesWithXpinstallDisabled = EXPECTED_TARGET_PANES.filter( + p => p !== "Temporary Extensions" + ); + await checkThisFirefoxTargetPanes( + document, + expectedTargetPanesWithXpinstallDisabled + ); + + await removeTab(tab); +}); + +async function checkThisFirefoxTargetPanes(doc, expectedTargetPanes) { + const win = doc.ownerGlobal; + // Check that the selected sidebar item is "This Firefox"/"This Nightly"/... + const selectedSidebarItem = doc.querySelector(".qa-sidebar-item-selected"); + ok(selectedSidebarItem, "An item is selected in the sidebar"); + + const thisFirefoxString = getThisFirefoxString(win); + is( + selectedSidebarItem.textContent, + thisFirefoxString, + "The selected sidebar item is " + thisFirefoxString + ); + + const paneTitlesEls = doc.querySelectorAll(".qa-debug-target-pane-title"); + is( + paneTitlesEls.length, + expectedTargetPanes.length, + "This Firefox has the expected number of debug target categories" + ); + + const paneTitles = [...paneTitlesEls].map(el => el.textContent); + + for (let i = 0; i < expectedTargetPanes.length; i++) { + const expectedPaneTitle = expectedTargetPanes[i]; + const actualPaneTitle = paneTitles[i]; + ok( + actualPaneTitle.startsWith(expectedPaneTitle), + `Expected debug target category found: ${expectedPaneTitle}` + ); + } +} diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_thisfirefox_runtime_info.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_thisfirefox_runtime_info.js new file mode 100644 index 0000000000..cfbb0dcc3a --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_thisfirefox_runtime_info.js @@ -0,0 +1,54 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/** + * Check that the runtime info is correctly displayed for ThisFirefox. + * Also acts as basic sanity check for the default mock of the this-firefox client. + */ + +add_task(async function() { + // Setup a mock for our runtime client factory to return the default THIS_FIREFOX client + // when the client for the this-firefox runtime is requested. + const runtimeClientFactoryMock = createRuntimeClientFactoryMock(); + const thisFirefoxClient = createThisFirefoxClientMock(); + runtimeClientFactoryMock.createClientForRuntime = runtime => { + const { + RUNTIMES, + } = require("devtools/client/aboutdebugging/src/constants"); + if (runtime.id === RUNTIMES.THIS_FIREFOX) { + return thisFirefoxClient; + } + throw new Error("Unexpected runtime id " + runtime.id); + }; + + info("Enable mocks"); + enableRuntimeClientFactoryMock(runtimeClientFactoryMock); + registerCleanupFunction(() => { + disableRuntimeClientFactoryMock(); + }); + + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + info("Check that the 'This Firefox' mock is properly displayed"); + const thisFirefoxRuntimeInfo = document.querySelector(".qa-runtime-name"); + ok( + thisFirefoxRuntimeInfo, + "Runtime info for this-firefox runtime is displayed" + ); + const runtimeInfoText = thisFirefoxRuntimeInfo.textContent; + ok( + runtimeInfoText.includes("Firefox"), + "this-firefox runtime info shows the correct runtime name: " + + runtimeInfoText + ); + ok( + runtimeInfoText.includes("63.0"), + "this-firefox runtime info shows the correct version number: " + + runtimeInfoText + ); + + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_thisfirefox_worker_inspection.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_thisfirefox_worker_inspection.js new file mode 100644 index 0000000000..5f575d2651 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_thisfirefox_worker_inspection.js @@ -0,0 +1,74 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const { + gDevToolsBrowser, +} = require("devtools/client/framework/devtools-browser"); + +add_task(async function() { + const thisFirefoxClient = createThisFirefoxClientMock(); + // Prepare a worker mock. + const testWorker = { + id: "test-worker-id", + name: "Test Worker", + }; + // Add a worker mock as other worker. + thisFirefoxClient.listWorkers = () => ({ + otherWorkers: [testWorker], + serviceWorkers: [], + sharedWorkers: [], + }); + thisFirefoxClient.client.mainRoot = { + getWorker: id => { + return id === testWorker.id ? testWorker : null; + }, + }; + + const runtimeClientFactoryMock = createRuntimeClientFactoryMock(); + runtimeClientFactoryMock.createClientForRuntime = runtime => { + const { + RUNTIMES, + } = require("devtools/client/aboutdebugging/src/constants"); + if (runtime.id === RUNTIMES.THIS_FIREFOX) { + return thisFirefoxClient; + } + throw new Error("Unexpected runtime id " + runtime.id); + }; + + info("Enable mocks"); + enableRuntimeClientFactoryMock(runtimeClientFactoryMock); + const originalOpenWorkerForToolbox = gDevToolsBrowser.openWorkerToolbox; + registerCleanupFunction(() => { + disableRuntimeClientFactoryMock(); + gDevToolsBrowser.openWorkerToolbox = originalOpenWorkerForToolbox; + }); + + const { document, tab, window } = await openAboutDebugging(); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + info("Open a toolbox to debug the worker"); + const { devtoolsTab, devtoolsWindow } = await openAboutDevtoolsToolbox( + document, + tab, + window, + testWorker.name, + false + ); + + info( + "Check whether the correct actor front will be opened in worker toolbox" + ); + const url = new window.URL(devtoolsWindow.location.href); + const workerID = url.searchParams.get("id"); + is( + workerID, + testWorker.id, + "Correct actor front will be opened in worker toolbox" + ); + + await removeTab(devtoolsTab); + await waitUntil(() => !findDebugTargetByText("Toolbox - ", document)); + await removeTab(tab); +}); diff --git a/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_workers_remote_runtime.js b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_workers_remote_runtime.js new file mode 100644 index 0000000000..154a1ea8d1 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/browser_aboutdebugging_workers_remote_runtime.js @@ -0,0 +1,160 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const NETWORK_RUNTIME_HOST = "localhost:6080"; +const NETWORK_RUNTIME_APP_NAME = "TestNetworkApp"; +const USB_RUNTIME_ID = "test-runtime-id"; +const USB_RUNTIME_DEVICE_NAME = "test device name"; +const USB_RUNTIME_APP_NAME = "TestUsbApp"; + +const TESTS = [ + { + category: "Other Workers", + propertyName: "otherWorkers", + workerName: "other/worker/script.js", + }, + { + category: "Service Workers", + propertyName: "serviceWorkers", + workerName: "service/worker/script.js", + }, + { + category: "Shared Workers", + propertyName: "sharedWorkers", + workerName: "shared/worker/script.js", + }, +]; + +const EMPTY_WORKERS_RESPONSE = { + otherWorkers: [], + serviceWorkers: [], + sharedWorkers: [], +}; + +// Test that workers are displayed and updated for remote runtimes when expected. +add_task(async function() { + const mocks = new Mocks(); + + const { document, tab, window } = await openAboutDebugging({ + enableWorkerUpdates: true, + }); + await selectThisFirefoxPage(document, window.AboutDebugging.store); + + info("Prepare USB client mock"); + const usbClient = mocks.createUSBRuntime(USB_RUNTIME_ID, { + deviceName: USB_RUNTIME_DEVICE_NAME, + name: USB_RUNTIME_APP_NAME, + }); + mocks.emitUSBUpdate(); + + info("Test addons in runtime page for USB client"); + await connectToRuntime(USB_RUNTIME_DEVICE_NAME, document); + await selectRuntime(USB_RUNTIME_DEVICE_NAME, USB_RUNTIME_APP_NAME, document); + for (const testData of TESTS) { + await testWorkerOnMockedRemoteClient( + testData, + usbClient, + mocks.thisFirefoxClient, + document + ); + } + + info("Prepare Network client mock"); + const networkClient = mocks.createNetworkRuntime(NETWORK_RUNTIME_HOST, { + name: NETWORK_RUNTIME_APP_NAME, + }); + + info("Test workers in runtime page for Network client"); + await connectToRuntime(NETWORK_RUNTIME_HOST, document); + await selectRuntime(NETWORK_RUNTIME_HOST, NETWORK_RUNTIME_APP_NAME, document); + + for (const testData of TESTS) { + await testWorkerOnMockedRemoteClient( + testData, + networkClient, + mocks.thisFirefoxClient, + document + ); + } + + await removeTab(tab); +}); + +/** + * Check that workers are visible in the runtime page for a remote client. + */ +async function testWorkerOnMockedRemoteClient( + testData, + remoteClient, + firefoxClient, + document +) { + const { category, propertyName, workerName } = testData; + info(`Test workers for category [${category}] in remote runtime`); + + const workersPane = getDebugTargetPane(category, document); + info("Check an empty target pane message is displayed"); + ok( + workersPane.querySelector(".qa-debug-target-list-empty"), + "Workers list is empty" + ); + + info(`Add a worker of type [${propertyName}] to the remote client`); + const workers = Object.assign({}, EMPTY_WORKERS_RESPONSE, { + [propertyName]: [ + { + name: workerName, + workerDescriptorFront: { + actorID: workerName, + }, + }, + ], + }); + remoteClient.listWorkers = () => workers; + remoteClient._eventEmitter.emit("workersUpdated"); + + info("Wait until the worker appears"); + await waitUntil( + () => !workersPane.querySelector(".qa-debug-target-list-empty") + ); + + const workerTarget = findDebugTargetByText(workerName, document); + ok(workerTarget, "Worker target appeared for the remote runtime"); + + // Check that the list of REMOTE workers are NOT updated when the local this-firefox + // emits a workersUpdated event. + info("Remove the worker from the remote client WITHOUT sending an event"); + remoteClient.listWorkers = () => EMPTY_WORKERS_RESPONSE; + + info("Simulate a worker update on the ThisFirefox client"); + firefoxClient._eventEmitter.emit("workersUpdated"); + + // To avoid wait for a set period of time we trigger another async update, adding a new + // tab. We assume that if the worker update mechanism had started, it would also be done + // when the new tab was processed. + info("Wait until the tab target for 'http://some.random/url.com' appears"); + const testTab = { + retrieveFavicon: () => {}, + outerWindowID: 0, + traits: {}, + url: "http://some.random/url.com", + }; + remoteClient.listTabs = () => [testTab]; + remoteClient._eventEmitter.emit("tabListChanged"); + await waitUntil(() => + findDebugTargetByText("http://some.random/url.com", document) + ); + + ok( + findDebugTargetByText(workerName, document), + "The test worker is still visible" + ); + + info( + "Emit `workersUpdated` on remoteClient and wait for the target list to update" + ); + remoteClient._eventEmitter.emit("workersUpdated"); + await waitUntil(() => !findDebugTargetByText(workerName, document)); +} diff --git a/devtools/client/aboutdebugging/test/browser/empty.html b/devtools/client/aboutdebugging/test/browser/empty.html new file mode 100644 index 0000000000..d0fd95ab08 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/empty.html @@ -0,0 +1 @@ +<body>fake_profiler_page</body> diff --git a/devtools/client/aboutdebugging/test/browser/head.js b/devtools/client/aboutdebugging/test/browser/head.js new file mode 100644 index 0000000000..ee65f00fcf --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/head.js @@ -0,0 +1,448 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* eslint-env browser */ +/* eslint no-unused-vars: [2, {"vars": "local"}] */ +/* import-globals-from ../../../shared/test/shared-head.js */ + +// Load the shared-head file first. +Services.scriptloader.loadSubScript( + "chrome://mochitests/content/browser/devtools/client/shared/test/shared-head.js", + this +); + +// Load the shared Redux helpers into this compartment. +Services.scriptloader.loadSubScript( + "chrome://mochitests/content/browser/devtools/client/shared/test/shared-redux-head.js", + this +); + +/* import-globals-from helper-mocks.js */ +Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-mocks.js", this); + +// Make sure the ADB addon is removed and ADB is stopped when the test ends. +registerCleanupFunction(async function() { + // Reset the selected tool in case we opened about:devtools-toolbox to + // avoid side effects between tests. + Services.prefs.clearUserPref("devtools.toolbox.selectedTool"); + + try { + const { + adbAddon, + } = require("devtools/client/shared/remote-debugging/adb/adb-addon"); + await adbAddon.uninstall(); + } catch (e) { + // Will throw if the addon is already uninstalled, ignore exceptions here. + } + const { + adbProcess, + } = require("devtools/client/shared/remote-debugging/adb/adb-process"); + await adbProcess.kill(); + + const { + remoteClientManager, + } = require("devtools/client/shared/remote-debugging/remote-client-manager"); + await remoteClientManager.removeAllClients(); +}); + +async function openAboutDebugging({ + enableWorkerUpdates, + enableLocalTabs = true, +} = {}) { + if (!enableWorkerUpdates) { + silenceWorkerUpdates(); + } + + // This preference changes value depending on the build type, tests need to use a + // consistent value regarless of the build used. + await pushPref( + "devtools.aboutdebugging.local-tab-debugging", + enableLocalTabs + ); + + info("opening about:debugging"); + + const tab = await addTab("about:debugging"); + const browser = tab.linkedBrowser; + const document = browser.contentDocument; + const window = browser.contentWindow; + + info("Wait until Connect page is displayed"); + await waitUntil(() => document.querySelector(".qa-connect-page")); + + return { tab, document, window }; +} + +async function openAboutDevtoolsToolbox( + doc, + tab, + win, + targetText = "about:debugging", + shouldWaitToolboxReady = true +) { + info("Open about:devtools-toolbox page"); + const target = findDebugTargetByText(targetText, doc); + ok(target, `${targetText} tab target appeared`); + const inspectButton = target.querySelector(".qa-debug-target-inspect-button"); + ok(inspectButton, `Inspect button for ${targetText} appeared`); + inspectButton.click(); + await Promise.all([ + waitUntil(() => tab.nextElementSibling), + waitForRequestsToSettle(win.AboutDebugging.store), + shouldWaitToolboxReady + ? gDevTools.once("toolbox-ready") + : Promise.resolve(), + ]); + + info("Wait for about:devtools-toolbox tab will be selected"); + const devtoolsTab = tab.nextElementSibling; + await waitUntil(() => gBrowser.selectedTab === devtoolsTab); + const devtoolsBrowser = gBrowser.selectedBrowser; + await waitUntil(() => + devtoolsBrowser.contentWindow.location.href.startsWith( + "about:devtools-toolbox?" + ) + ); + + if (!shouldWaitToolboxReady) { + // Wait for show error page. + await waitUntil(() => + devtoolsBrowser.contentDocument.querySelector(".qa-error-page") + ); + } + + return { + devtoolsBrowser, + devtoolsDocument: devtoolsBrowser.contentDocument, + devtoolsTab, + devtoolsWindow: devtoolsBrowser.contentWindow, + }; +} + +async function closeAboutDevtoolsToolbox( + aboutDebuggingDocument, + devtoolsTab, + win +) { + // Wait for all requests to settle on the opened about:devtools toolbox. + const devtoolsBrowser = devtoolsTab.linkedBrowser; + const devtoolsWindow = devtoolsBrowser.contentWindow; + const toolbox = getToolbox(devtoolsWindow); + await toolbox.target.client.waitForRequestsToSettle(); + + info("Close about:devtools-toolbox page"); + const onToolboxDestroyed = gDevTools.once("toolbox-destroyed"); + + info("Wait for removeTab"); + await removeTab(devtoolsTab); + + info("Wait for toolbox destroyed"); + await onToolboxDestroyed; + + // Changing the tab will also trigger a request to list tabs, so wait until the selected + // tab has changed to wait for requests to settle. + info("Wait until aboutdebugging is selected"); + await waitUntil(() => gBrowser.selectedTab !== devtoolsTab); + + // Wait for removing about:devtools-toolbox tab info from about:debugging. + info("Wait until about:devtools-toolbox is removed from debug targets"); + await waitUntil( + () => !findDebugTargetByText("Toolbox - ", aboutDebuggingDocument) + ); + + await waitForRequestsToSettle(win.AboutDebugging.store); +} + +async function reloadAboutDebugging(tab) { + info("reload about:debugging"); + + await refreshTab(tab); + const browser = tab.linkedBrowser; + const document = browser.contentDocument; + const window = browser.contentWindow; + info("wait for the initial about:debugging requests to settle"); + await waitForRequestsToSettle(window.AboutDebugging.store); + + return document; +} + +// Wait for all about:debugging target request actions to succeed. +// They will typically be triggered after watching a new runtime or loading +// about:debugging. +function waitForRequestsSuccess(store) { + return Promise.all([ + waitForDispatch(store, "REQUEST_EXTENSIONS_SUCCESS"), + waitForDispatch(store, "REQUEST_TABS_SUCCESS"), + waitForDispatch(store, "REQUEST_WORKERS_SUCCESS"), + ]); +} + +/** + * Wait for all client requests to settle, meaning here that no new request has been + * dispatched after the provided delay. + */ +async function waitForRequestsToSettle(store, delay = 500) { + let hasSettled = false; + + // After each iteration of this while loop, we check is the timerPromise had the time + // to resolve or if we captured a REQUEST_*_SUCCESS action before. + while (!hasSettled) { + let timer; + + // This timer will be executed only if no REQUEST_*_SUCCESS action is dispatched + // during the delay. We consider that when no request are received for some time, it + // means there are no ongoing requests anymore. + const timerPromise = new Promise(resolve => { + timer = setTimeout(() => { + hasSettled = true; + resolve(); + }, delay); + }); + + // Wait either for a REQUEST_*_SUCCESS to be dispatched, or for the timer to resolve. + await Promise.race([ + waitForDispatch(store, "REQUEST_EXTENSIONS_SUCCESS"), + waitForDispatch(store, "REQUEST_TABS_SUCCESS"), + waitForDispatch(store, "REQUEST_WORKERS_SUCCESS"), + timerPromise, + ]); + + // Clear the timer to avoid setting hasSettled to true accidently unless timerPromise + // was the first to resolve. + clearTimeout(timer); + } +} + +function waitForDispatch(store, type) { + return new Promise(resolve => { + store.dispatch({ + type: "@@service/waitUntil", + predicate: action => action.type === type, + run: (dispatch, getState, action) => { + resolve(action); + }, + }); + }); +} + +/** + * Navigate to "This Firefox" + */ +async function selectThisFirefoxPage(doc, store) { + info("Select This Firefox page"); + + const onRequestSuccess = waitForRequestsSuccess(store); + doc.location.hash = "#/runtime/this-firefox"; + info("Wait for requests to be complete"); + await onRequestSuccess; + + info("Wait for runtime page to be rendered"); + await waitUntil(() => doc.querySelector(".qa-runtime-page")); + + // Navigating to this-firefox will trigger a title change for the + // about:debugging tab. This title change _might_ trigger a tablist update. + // If it does, we should make sure to wait for pending tab requests. + await waitForRequestsToSettle(store); +} + +/** + * Navigate to the Connect page. Resolves when the Connect page is rendered. + */ +async function selectConnectPage(doc) { + const sidebarItems = doc.querySelectorAll(".qa-sidebar-item"); + const connectSidebarItem = [...sidebarItems].find(element => { + return element.textContent === "Setup"; + }); + ok(connectSidebarItem, "Sidebar contains a Connect item"); + const connectLink = connectSidebarItem.querySelector(".qa-sidebar-link"); + ok(connectLink, "Sidebar contains a Connect link"); + + info("Click on the Connect link in the sidebar"); + connectLink.click(); + + info("Wait until Connect page is displayed"); + await waitUntil(() => doc.querySelector(".qa-connect-page")); +} + +function getDebugTargetPane(title, document) { + // removes the suffix "(<NUMBER>)" in debug target pane's title, if needed + const sanitizeTitle = x => { + return x.replace(/\s+\(\d+\)$/, ""); + }; + + const targetTitle = sanitizeTitle(title); + for (const titleEl of document.querySelectorAll( + ".qa-debug-target-pane-title" + )) { + if (sanitizeTitle(titleEl.textContent) !== targetTitle) { + continue; + } + + return titleEl.closest(".qa-debug-target-pane"); + } + + return null; +} + +function findDebugTargetByText(text, document) { + const targets = [...document.querySelectorAll(".qa-debug-target-item")]; + return targets.find(target => target.textContent.includes(text)); +} + +function findSidebarItemByText(text, document) { + const sidebarItems = document.querySelectorAll(".qa-sidebar-item"); + return [...sidebarItems].find(element => { + return element.textContent.includes(text); + }); +} + +function findSidebarItemLinkByText(text, document) { + const links = document.querySelectorAll(".qa-sidebar-link"); + return [...links].find(element => { + return element.textContent.includes(text); + }); +} + +async function connectToRuntime(deviceName, document) { + info(`Wait until the sidebar item for ${deviceName} appears`); + await waitUntil(() => findSidebarItemByText(deviceName, document)); + const sidebarItem = findSidebarItemByText(deviceName, document); + const connectButton = sidebarItem.querySelector(".qa-connect-button"); + ok( + connectButton, + `Connect button is displayed for the runtime ${deviceName}` + ); + + info("Click on the connect button and wait until it disappears"); + connectButton.click(); + await waitUntil(() => !sidebarItem.querySelector(".qa-connect-button")); +} + +async function selectRuntime(deviceName, name, document) { + const sidebarItem = findSidebarItemByText(deviceName, document); + const store = document.defaultView.AboutDebugging.store; + const onSelectPageSuccess = waitForDispatch(store, "SELECT_PAGE_SUCCESS"); + + sidebarItem.querySelector(".qa-sidebar-link").click(); + + await waitUntil(() => { + const runtimeInfo = document.querySelector(".qa-runtime-name"); + return runtimeInfo && runtimeInfo.textContent.includes(name); + }); + + info("Wait for SELECT_PAGE_SUCCESS to be dispatched"); + await onSelectPageSuccess; +} + +function getToolbox(win) { + return gDevTools.getToolboxes().find(toolbox => toolbox.win === win); +} + +/** + * Open the performance profiler dialog. Assumes the client is a mocked remote runtime + * client. + */ +async function openProfilerDialog(client, doc) { + const onProfilerLoaded = new Promise(r => { + client.loadPerformanceProfiler = r; + }); + + info("Click on the Profile Runtime button"); + const profileButton = doc.querySelector(".qa-profile-runtime-button"); + profileButton.click(); + + info( + "Wait for the loadPerformanceProfiler callback to be executed on client-wrapper" + ); + return onProfilerLoaded; +} + +/** + * The "This Firefox" string depends on the brandShortName, which will be different + * depending on the channel where tests are running. + */ +function getThisFirefoxString(aboutDebuggingWindow) { + const loader = aboutDebuggingWindow.getBrowserLoaderForWindow(); + const { l10n } = loader.require( + "devtools/client/aboutdebugging/src/modules/l10n" + ); + return l10n.getString("about-debugging-this-firefox-runtime-name"); +} + +function waitUntilUsbDeviceIsUnplugged(deviceName, aboutDebuggingDocument) { + info("Wait until the USB sidebar item appears as unplugged"); + return waitUntil(() => { + const sidebarItem = findSidebarItemByText( + deviceName, + aboutDebuggingDocument + ); + return !!sidebarItem.querySelector(".qa-runtime-item-unplugged"); + }); +} + +/** + * Changing the selected tab in the current browser will trigger a tablist + * update. + * If the currently selected page is "this-firefox", we should wait for the + * the corresponding REQUEST_TABS_SUCCESS that will be triggered by the change. + * + * @param {Browser} browser + * The browser instance to update. + * @param {XULTab} tab + * The tab to select. + * @param {Object} store + * The about:debugging redux store. + */ +async function updateSelectedTab(browser, tab, store) { + info("Update the selected tab"); + + const { runtimes, ui } = store.getState(); + const isOnThisFirefox = + runtimes.selectedRuntimeId === "this-firefox" && + ui.selectedPage === "runtime"; + + // A tabs request will only be issued if we are on this-firefox. + const onTabsSuccess = isOnThisFirefox + ? waitForDispatch(store, "REQUEST_TABS_SUCCESS") + : null; + + // Update the selected tab. + browser.selectedTab = tab; + + if (onTabsSuccess) { + info("Wait for the tablist update after updating the selected tab"); + await onTabsSuccess; + } +} + +/** + * Synthesizes key input inside the DebugTargetInfo's URL component. + * + * @param {DevToolsToolbox} toolbox + * The DevToolsToolbox debugging the target. + * @param {HTMLElement} inputEl + * The <input> element to submit the URL with. + * @param {String} url + * The URL to navigate to. + */ +async function synthesizeUrlKeyInput(toolbox, inputEl, url) { + const { devtoolsDocument, devtoolsWindow } = toolbox; + info("Wait for URL input to be focused."); + const onInputFocused = waitUntil( + () => devtoolsDocument.activeElement === inputEl + ); + inputEl.focus(); + await onInputFocused; + + info("Synthesize entering URL into text field"); + const onInputChange = waitUntil(() => inputEl.value === url); + for (const key of url.split("")) { + EventUtils.synthesizeKey(key, {}, devtoolsWindow); + } + await onInputChange; + + info("Submit URL to navigate to"); + EventUtils.synthesizeKey("KEY_Enter"); +} diff --git a/devtools/client/aboutdebugging/test/browser/helper-adb.js b/devtools/client/aboutdebugging/test/browser/helper-adb.js new file mode 100644 index 0000000000..a7e9b3b8f1 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/helper-adb.js @@ -0,0 +1,59 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from head.js */ + +async function checkAdbNotRunning() { + info("Check if ADB is already running before the test starts"); + const { + check, + } = require("devtools/client/shared/remote-debugging/adb/adb-running-checker"); + const isAdbAlreadyRunning = await check(); + if (isAdbAlreadyRunning) { + throw new Error( + "The ADB process is already running on this machine, it should be " + + "stopped before running this test" + ); + } +} +/* exported checkAdbNotRunning */ + +// Returns a promise that resolves when the adb process exists and is running. +async function waitForAdbStart() { + info("Wait for ADB to start"); + const { + adbProcess, + } = require("devtools/client/shared/remote-debugging/adb/adb-process"); + const { + check, + } = require("devtools/client/shared/remote-debugging/adb/adb-running-checker"); + return asyncWaitUntil(async () => { + const isProcessReady = adbProcess.ready; + const isRunning = await check(); + return isProcessReady && isRunning; + }); +} +/* exported waitForAdbStart */ + +// Attempt to stop ADB. Will only work if ADB was started by the current Firefox instance. +// Returns a promise that resolves when the adb process is no longer running. +async function stopAdbProcess() { + info("Attempt to stop ADB"); + const { + adbProcess, + } = require("devtools/client/shared/remote-debugging/adb/adb-process"); + await adbProcess.stop(); + + info("Wait for ADB to stop"); + const { + check, + } = require("devtools/client/shared/remote-debugging/adb/adb-running-checker"); + return asyncWaitUntil(async () => { + const isProcessReady = adbProcess.ready; + const isRunning = await check(); + return !isProcessReady && !isRunning; + }); +} +/* exported stopAdbProcess */ diff --git a/devtools/client/aboutdebugging/test/browser/helper-addons.js b/devtools/client/aboutdebugging/test/browser/helper-addons.js new file mode 100644 index 0000000000..ee3c888c04 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/helper-addons.js @@ -0,0 +1,182 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from head.js */ + +function _getSupportsFile(path) { + const cr = Cc["@mozilla.org/chrome/chrome-registry;1"].getService( + Ci.nsIChromeRegistry + ); + const uri = Services.io.newURI(CHROME_URL_ROOT + path); + const fileurl = cr.convertChromeURL(uri); + return fileurl.QueryInterface(Ci.nsIFileURL); +} + +async function enableExtensionDebugging() { + // Disable security prompt + await pushPref("devtools.debugger.prompt-connection", false); +} +/* exported enableExtensionDebugging */ + +/** + * Install an extension using the AddonManager so it does not show up as temporary. + */ +async function installRegularExtension(pathOrFile) { + const isFile = typeof pathOrFile.isFile === "function" && pathOrFile.isFile(); + const file = isFile ? pathOrFile : _getSupportsFile(pathOrFile).file; + const install = await AddonManager.getInstallForFile(file); + return new Promise((resolve, reject) => { + if (!install) { + throw new Error(`An install was not created for ${file.path}`); + } + install.addListener({ + onDownloadFailed: reject, + onDownloadCancelled: reject, + onInstallFailed: reject, + onInstallCancelled: reject, + onInstallEnded: resolve, + }); + install.install(); + }); +} +/* exported installRegularExtension */ + +/** + * Install a temporary extension at the provided path, with the provided name. + * Will use a mock file picker to select the file. + */ +async function installTemporaryExtension(pathOrFile, name, document) { + const { Management } = ChromeUtils.import( + "resource://gre/modules/Extension.jsm" + ); + + info("Install temporary extension named " + name); + // Mock the file picker to select a test addon + prepareMockFilePicker(pathOrFile); + + const onAddonInstalled = new Promise(done => { + Management.on("startup", function listener(event, extension) { + if (extension.name != name) { + return; + } + + Management.off("startup", listener); + done(); + }); + }); + + // Trigger the file picker by clicking on the button + document.querySelector(".qa-temporary-extension-install-button").click(); + + info("Wait for addon to be installed"); + await onAddonInstalled; +} +/* exported installTemporaryExtension */ + +function createTemporaryXPI(xpiData) { + const { ExtensionTestCommon } = ChromeUtils.import( + "resource://testing-common/ExtensionTestCommon.jsm" + ); + + const { background, files, id, name, extraProperties } = xpiData; + info("Generate XPI file for " + id); + + const manifest = Object.assign( + {}, + { + applications: { gecko: { id } }, + manifest_version: 2, + name, + version: "1.0", + }, + extraProperties + ); + + const xpiFile = ExtensionTestCommon.generateXPI({ + background, + files, + manifest, + }); + registerCleanupFunction(() => xpiFile.exists() && xpiFile.remove(false)); + return xpiFile; +} +/* exported createTemporaryXPI */ + +/** + * Remove the existing temporary XPI file generated by ExtensionTestCommon and create a + * new one at the same location. + * @return {File} the temporary extension XPI file created + */ +function updateTemporaryXPI(xpiData, existingXPI) { + info("Delete and regenerate XPI for " + xpiData.id); + + // Store the current name to check the xpi is correctly replaced. + const existingName = existingXPI.leafName; + info("Delete existing XPI named: " + existingName); + existingXPI.exists() && existingXPI.remove(false); + + const xpiFile = createTemporaryXPI(xpiData); + // Check that the name of the new file is correct + if (xpiFile.leafName !== existingName) { + throw new Error( + "New XPI created with unexpected name: " + xpiFile.leafName + ); + } + return xpiFile; +} +/* exported updateTemporaryXPI */ + +/** + * Install a fake temporary extension by creating a temporary in-memory XPI file. + * @return {File} the temporary extension XPI file created + */ +async function installTemporaryExtensionFromXPI(xpiData, document) { + const xpiFile = createTemporaryXPI(xpiData); + await installTemporaryExtension(xpiFile, xpiData.name, document); + + info("Wait until the addon debug target appears"); + await waitUntil(() => findDebugTargetByText(xpiData.name, document)); + return xpiFile; +} +/* exported installTemporaryExtensionFromXPI */ + +async function removeTemporaryExtension(name, document) { + info(`Wait for removable extension with name: '${name}'`); + const buttonName = ".qa-temporary-extension-remove-button"; + await waitUntil(() => { + const extension = findDebugTargetByText(name, document); + return extension && extension.querySelector(buttonName); + }); + info(`Remove the temporary extension with name: '${name}'`); + const temporaryExtensionItem = findDebugTargetByText(name, document); + temporaryExtensionItem.querySelector(buttonName).click(); + + info("Wait until the debug target item disappears"); + await waitUntil(() => !findDebugTargetByText(name, document)); +} +/* exported removeTemporaryExtension */ + +async function removeExtension(id, name, document) { + info( + "Retrieve the extension instance from the addon manager, and uninstall it" + ); + const extension = await AddonManager.getAddonByID(id); + extension.uninstall(); + + info("Wait until the addon disappears from about:debugging"); + await waitUntil(() => !findDebugTargetByText(name, document)); +} +/* exported removeExtension */ + +function prepareMockFilePicker(pathOrFile) { + const isFile = typeof pathOrFile.isFile === "function" && pathOrFile.isFile(); + const file = isFile ? pathOrFile : _getSupportsFile(pathOrFile).file; + + // Mock the file picker to select a test addon + const MockFilePicker = SpecialPowers.MockFilePicker; + MockFilePicker.init(window); + MockFilePicker.setFiles([file]); +} +/* exported prepareMockFilePicker */ diff --git a/devtools/client/aboutdebugging/test/browser/helper-collapsibilities.js b/devtools/client/aboutdebugging/test/browser/helper-collapsibilities.js new file mode 100644 index 0000000000..0f0d28da1d --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/helper-collapsibilities.js @@ -0,0 +1,54 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const TARGET_PANES = [ + { + title: "Temporary Extensions", + pref: "devtools.aboutdebugging.collapsibilities.temporaryExtension", + }, + { + title: "Extensions", + pref: "devtools.aboutdebugging.collapsibilities.installedExtension", + }, + { + title: "Tabs", + pref: "devtools.aboutdebugging.collapsibilities.tab", + }, + { + title: "Service Workers", + pref: "devtools.aboutdebugging.collapsibilities.serviceWorker", + }, + { + title: "Shared Workers", + pref: "devtools.aboutdebugging.collapsibilities.sharedWorker", + }, + { + title: "Other Workers", + pref: "devtools.aboutdebugging.collapsibilities.otherWorker", + }, +]; +/* exported TARGET_PANES */ + +function prepareCollapsibilitiesTest() { + // Make all collapsibilities to be expanded. + for (const { pref } of TARGET_PANES) { + Services.prefs.setBoolPref(pref, false); + } +} +/* exported prepareCollapsibilitiesTest */ + +async function toggleCollapsibility(debugTargetPane) { + debugTargetPane.querySelector(".qa-debug-target-pane-title").click(); + // Wait for animation of collapse/expand. + const animations = debugTargetPane.ownerDocument.getAnimations(); + await Promise.all(animations.map(animation => animation.finished)); +} +/* exported toggleCollapsibility */ + +registerCleanupFunction(() => { + for (const { pref } of TARGET_PANES) { + Services.prefs.clearUserPref(pref); + } +}); diff --git a/devtools/client/aboutdebugging/test/browser/helper-mocks.js b/devtools/client/aboutdebugging/test/browser/helper-mocks.js new file mode 100644 index 0000000000..e673999238 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/helper-mocks.js @@ -0,0 +1,258 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from ../../../shared/test/shared-head.js */ + +const MOCKS_ROOT = CHROME_URL_ROOT + "mocks/"; +/* import-globals-from mocks/helper-adb-mock.js */ +Services.scriptloader.loadSubScript(MOCKS_ROOT + "helper-adb-mock.js", this); +/* import-globals-from mocks/helper-client-wrapper-mock.js */ +Services.scriptloader.loadSubScript( + MOCKS_ROOT + "helper-client-wrapper-mock.js", + this +); +/* import-globals-from mocks/helper-runtime-client-factory-mock.js */ +Services.scriptloader.loadSubScript( + MOCKS_ROOT + "helper-runtime-client-factory-mock.js", + this +); + +const { RUNTIMES } = require("devtools/client/aboutdebugging/src/constants"); + +/** + * This wrapper around the mocks used in about:debugging tests provides helpers to + * quickly setup mocks for runtime tests involving USB, network or wifi runtimes that can + * are difficult to setup in a test environment. + */ +class Mocks { + constructor() { + // Setup the adb mock to rely on internal arrays. + this.adbMock = createAdbMock(); + this.adbProcessMock = createAdbProcessMock(); + this._usbRuntimes = []; + this._usbDevices = []; + this.adbMock.adb.getRuntimes = () => { + return this._usbRuntimes; + }; + this.adbMock.adb.getDevices = () => { + const runtimeDevices = this._usbRuntimes.map(r => { + return { id: r.deviceId, name: r.deviceName }; + }); + return runtimeDevices.concat(this._usbDevices); + }; + + // adb.updateRuntimes should ultimately fire the "runtime-list-updated" event. + this.adbMock.adb.updateRuntimes = () => { + this.emitUSBUpdate(); + }; + + this.adbMock.adb.isProcessStarted = () => true; + + // Prepare a fake observer to be able to emit events from this mock. + this._observerMock = addObserverMock(this.adbMock.adb); + + // Setup the runtime-client-factory mock to rely on the internal _clients map. + this.runtimeClientFactoryMock = createRuntimeClientFactoryMock(); + this._clients = { + [RUNTIMES.NETWORK]: {}, + [RUNTIMES.THIS_FIREFOX]: {}, + [RUNTIMES.USB]: {}, + }; + this.runtimeClientFactoryMock.createClientForRuntime = runtime => { + return this._clients[runtime.type][runtime.id]; + }; + + // Add a client for THIS_FIREFOX, since about:debugging will start on the This Firefox + // page. + this._thisFirefoxClient = createThisFirefoxClientMock(); + this._clients[RUNTIMES.THIS_FIREFOX][ + RUNTIMES.THIS_FIREFOX + ] = this._thisFirefoxClient; + + // Enable mocks and remove them after the test. + this.enableMocks(); + registerCleanupFunction(() => this.disableMocks()); + } + + get thisFirefoxClient() { + return this._thisFirefoxClient; + } + + enableMocks() { + enableAdbMock(this.adbMock); + enableAdbProcessMock(this.adbProcessMock); + enableRuntimeClientFactoryMock(this.runtimeClientFactoryMock); + } + + disableMocks() { + disableAdbMock(); + disableAdbProcessMock(); + disableRuntimeClientFactoryMock(); + + for (const host of Object.keys(this._clients[RUNTIMES.NETWORK])) { + this.removeNetworkRuntime(host); + } + } + + createNetworkRuntime(host, runtimeInfo) { + const { + addNetworkLocation, + } = require("devtools/client/aboutdebugging/src/modules/network-locations"); + addNetworkLocation(host); + + // Add a valid client that can be returned for this particular runtime id. + const mockNetworkClient = createClientMock(); + mockNetworkClient.getDeviceDescription = () => { + return { + name: runtimeInfo.name || "TestBrand", + channel: runtimeInfo.channel || "release", + version: runtimeInfo.version || "1.0", + }; + }; + this._clients[RUNTIMES.NETWORK][host] = mockNetworkClient; + + return mockNetworkClient; + } + + removeNetworkRuntime(host) { + const { + removeNetworkLocation, + } = require("devtools/client/aboutdebugging/src/modules/network-locations"); + removeNetworkLocation(host); + + delete this._clients[RUNTIMES.NETWORK][host]; + } + + emitUSBUpdate() { + this._observerMock.emit("runtime-list-updated"); + } + + /** + * Creates a USB runtime for which a client conenction can be established. + * @param {String} id + * The id of the runtime. + * @param {Object} optional object used to create the fake runtime & device + * - channel: {String} Release channel, for instance "release", "nightly" + * - clientWrapper: {ClientWrapper} optional ClientWrapper for this runtime + * - deviceId: {String} Device id + * - deviceName: {String} Device name + * - isFenix: {Boolean} set by ADB if the package name matches a Fenix package + * - name: {String} Application name, for instance "Firefox" + * - shortName: {String} Short name for the device + * - socketPath: {String} (should only be used for connecting, so not here) + * - version: {String} Version, for instance "63.0a" + * - versionName: {String} Version return by ADB "63.0a" + * @return {Object} Returns the mock client created for this runtime so that methods + * can be overridden on it. + */ + createUSBRuntime(id, runtimeInfo = {}) { + // Add a new runtime to the list of scanned runtimes. + this._usbRuntimes.push({ + deviceId: runtimeInfo.deviceId || "test device id", + deviceName: runtimeInfo.deviceName || "test device name", + id: id, + isFenix: runtimeInfo.isFenix, + shortName: runtimeInfo.shortName || "testshort", + socketPath: runtimeInfo.socketPath || "test/path", + versionName: runtimeInfo.versionName || "1.0", + }); + + // Add a valid client that can be returned for this particular runtime id. + let mockUsbClient = runtimeInfo.clientWrapper; + if (mockUsbClient) { + const originalGetDeviceDescription = mockUsbClient.getDeviceDescription.bind( + mockUsbClient + ); + mockUsbClient.getDeviceDescription = async () => { + const deviceDescription = await originalGetDeviceDescription(); + return { + channel: runtimeInfo.channel || deviceDescription.channel, + name: runtimeInfo.name || deviceDescription.name, + version: runtimeInfo.version || deviceDescription.version, + }; + }; + } else { + // If no clientWrapper was provided, create a mock client here. + mockUsbClient = createClientMock(); + mockUsbClient.getDeviceDescription = () => { + return { + channel: runtimeInfo.channel || "release", + name: runtimeInfo.name || "TestBrand", + version: runtimeInfo.version || "1.0", + }; + }; + } + + this._clients[RUNTIMES.USB][id] = mockUsbClient; + + return mockUsbClient; + } + + removeUSBRuntime(id) { + this._usbRuntimes = this._usbRuntimes.filter(runtime => runtime.id !== id); + delete this._clients[RUNTIMES.USB][id]; + } + + addDevice(deviceId, deviceName) { + this._usbDevices.push({ + id: deviceId, + name: deviceName, + }); + } + + removeDevice(deviceId) { + this._usbDevices = this._usbDevices.filter(d => { + return d.id !== deviceId; + }); + } + + removeRuntime(id) { + if (this._clients[RUNTIMES.USB][id]) { + this.removeUSBRuntime(id); + } else if (this._clients[RUNTIMES.NETWORK][id]) { + this.removeNetworkRuntime(id); + } + } +} +/* exported Mocks */ + +const silenceWorkerUpdates = function() { + const { + removeMockedModule, + setMockedModule, + } = require("devtools/client/shared/browser-loader-mocks"); + + const mock = { + WorkersListener: () => { + return { + addListener: () => {}, + removeListener: () => {}, + }; + }, + }; + setMockedModule(mock, "devtools/client/shared/workers-listener"); + + registerCleanupFunction(() => { + removeMockedModule("devtools/client/shared/workers-listener"); + }); +}; +/* exported silenceWorkerUpdates */ + +async function createLocalClientWrapper() { + info("Create a local DevToolsClient"); + const { DevToolsServer } = require("devtools/server/devtools-server"); + const { DevToolsClient } = require("devtools/client/devtools-client"); + const { + ClientWrapper, + } = require("devtools/client/aboutdebugging/src/modules/client-wrapper"); + + DevToolsServer.init(); + DevToolsServer.registerAllActors(); + const client = new DevToolsClient(DevToolsServer.connectPipe()); + + await client.connect(); + return new ClientWrapper(client); +} +/* exported createLocalClientWrapper */ diff --git a/devtools/client/aboutdebugging/test/browser/helper-real-usb.js b/devtools/client/aboutdebugging/test/browser/helper-real-usb.js new file mode 100644 index 0000000000..dbcbd13ae8 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/helper-real-usb.js @@ -0,0 +1,57 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from helper-adb.js */ +Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-adb.js", this); + +async function getExpectedRuntime() { + const runtimes = await getExpectedRuntimeAll(); + return runtimes[0]; +} +/* exported getExpectedRuntime */ + +async function getExpectedRuntimeAll() { + const runtimesPath = _getExpectedRuntimesPath(); + const currentPath = env.get("PWD"); + const path = `${currentPath}/${runtimesPath}`; + info(`Load ${path}`); + const buffer = await OS.File.read(path); + const data = new TextDecoder().decode(buffer); + return JSON.parse(data); +} +/* exported getExpectedRuntimeAll */ + +function isAvailable() { + return !!_getExpectedRuntimesPath(); +} +/* exported isAvailable */ + +async function openAboutDebuggingWithADB() { + const { document, tab, window } = await openAboutDebugging(); + + await pushPref( + "devtools.remote.adb.extensionURL", + CHROME_URL_ROOT + "resources/test-adb-extension/adb-extension-#OS#.xpi" + ); + await checkAdbNotRunning(); + + const { + adbAddon, + } = require("devtools/client/shared/remote-debugging/adb/adb-addon"); + adbAddon.install("internal"); + const usbStatusElement = document.querySelector(".qa-sidebar-usb-status"); + await waitUntil(() => usbStatusElement.textContent.includes("USB enabled")); + await waitForAdbStart(); + + return { document, tab, window }; +} +/* exported openAboutDebuggingWithADB */ + +function _getExpectedRuntimesPath() { + const env = Cc["@mozilla.org/process/environment;1"].getService( + Ci.nsIEnvironment + ); + return env.get("USB_RUNTIMES"); +} diff --git a/devtools/client/aboutdebugging/test/browser/helper-serviceworker.js b/devtools/client/aboutdebugging/test/browser/helper-serviceworker.js new file mode 100644 index 0000000000..11ad4e1716 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/helper-serviceworker.js @@ -0,0 +1,106 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from head.js */ + +/** + * Temporarily flip all the preferences necessary for service worker testing. + */ +async function enableServiceWorkerDebugging() { + // Enable service workers. + await pushPref("dom.serviceWorkers.enabled", true); + + // Accept workers from mochitest's http (normally only available in https). + await pushPref("dom.serviceWorkers.testing.enabled", true); + + // Force single content process. Necessary until sw e10s refactor is done (Bug 1231208). + await pushPref("dom.ipc.processCount", 1); + Services.ppmm.releaseCachedProcesses(); +} +/* exported enableServiceWorkerDebugging */ + +/** + * Helper to listen once on a message sent using postMessage from the provided tab. + * + * @param {Tab} tab + * The tab on which the message will be received. + * @param {String} message + * The name of the expected message. + */ +function onServiceWorkerMessage(tab, message) { + info("Make the test page notify us when the service worker sends a message."); + return SpecialPowers.spawn(tab.linkedBrowser, [message], function( + messageChild + ) { + return new Promise(resolve => { + const win = content.wrappedJSObject; + win.navigator.serviceWorker.addEventListener("message", function(event) { + if (event.data == messageChild) { + resolve(); + } + }); + }); + }); +} +/* exported onServiceWorkerMessage */ + +async function _waitForServiceWorkerStatus(workerText, status, document) { + await waitUntil(() => { + const target = findDebugTargetByText(workerText, document); + const statusElement = target && target.querySelector(".qa-worker-status"); + return statusElement && statusElement.textContent === status; + }); + + return findDebugTargetByText(workerText, document); +} +/* exported waitForServiceWorkerRunning */ + +async function waitForServiceWorkerStopped(workerText, document) { + return _waitForServiceWorkerStatus(workerText, "Stopped", document); +} +/* exported waitForServiceWorkerStopped */ + +async function waitForServiceWorkerRunning(workerText, document) { + return _waitForServiceWorkerStatus(workerText, "Running", document); +} +/* exported waitForServiceWorkerRunning */ + +async function waitForServiceWorkerRegistering(workerText, document) { + return _waitForServiceWorkerStatus(workerText, "Registering", document); +} +/* exported waitForServiceWorkerRegistering */ + +async function waitForRegistration(tab) { + info("Wait until the registration appears on the window"); + const swBrowser = tab.linkedBrowser; + await asyncWaitUntil(async () => + SpecialPowers.spawn(swBrowser, [], async function() { + return !!(await content.wrappedJSObject.getRegistration()); + }) + ); +} +/* exported waitForRegistration */ + +/** + * Unregister the service worker from the content page. The content page should define + * `getRegistration` to allow this helper to retrieve the service worker registration that + * should be unregistered. + * + * @param {Tab} tab + * The tab on which the service worker should be removed. + */ +async function unregisterServiceWorker(tab) { + return SpecialPowers.spawn(tab.linkedBrowser, [], function() { + const win = content.wrappedJSObject; + // Check that the content page defines getRegistration. + is( + typeof win.getRegistration, + "function", + "getRegistration is a valid function" + ); + win.getRegistration().unregister(); + }); +} +/* exported unregisterServiceWorker */ diff --git a/devtools/client/aboutdebugging/test/browser/helper-telemetry.js b/devtools/client/aboutdebugging/test/browser/helper-telemetry.js new file mode 100644 index 0000000000..4c6a3da6e9 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/helper-telemetry.js @@ -0,0 +1,115 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* import-globals-from head.js */ + +/** + * Reset all telemetry events. + */ +function setupTelemetryTest() { + // Let's reset the counts. + Services.telemetry.clearEvents(); + + // Ensure no events have been logged + const ALL_CHANNELS = Ci.nsITelemetry.DATASET_ALL_CHANNELS; + const snapshot = Services.telemetry.snapshotEvents(ALL_CHANNELS, true); + ok(!snapshot.parent, "No events have been logged for the main process"); +} +/* exported setupTelemetryTest */ + +/** + * Check that the logged telemetry events exactly match the array of expected events. + * Will compare the number of events, the event methods, and the event extras including + * the about:debugging session id. + */ +function checkTelemetryEvents(expectedEvents, expectedSessionId) { + const evts = readAboutDebuggingEvents(); + is(evts.length, expectedEvents.length, "Expected number of events"); + + function _eventHasExpectedExtras(e, expectedEvent) { + const expectedExtras = Object.keys(expectedEvent.extras); + return expectedExtras.every(extra => { + return e.extras[extra] === expectedEvent.extras[extra]; + }); + } + + for (const expectedEvent of expectedEvents) { + const sameMethodEvents = evts.filter( + e => e.method === expectedEvent.method + ); + ok( + sameMethodEvents.length > 0, + "Found event for method: " + expectedEvent.method + ); + + const sameExtrasEvents = sameMethodEvents.filter(e => + _eventHasExpectedExtras(e, expectedEvent) + ); + ok( + sameExtrasEvents.length === 1, + "Found exactly one event matching the expected extras" + ); + if (sameExtrasEvents.length === 0) { + info(JSON.stringify(sameMethodEvents)); + } + is( + sameExtrasEvents[0].extras.session_id, + expectedSessionId, + "Select page event has the expected session" + ); + } + + return evts; +} +/* exported checkTelemetryEvents */ + +/** + * Retrieve the session id from an "open" event. + * Note that calling this will "clear" all the events. + */ +function getOpenEventSessionId() { + const openEvents = readAboutDebuggingEvents().filter( + e => e.method === "open_adbg" + ); + ok(!!openEvents[0], "Found an about:debugging open event"); + return openEvents[0].extras.session_id; +} +/* exported getOpenEventSessionId */ + +/** + * Read all the pending events that have "aboutdebugging" as their object property. + * WARNING: Calling this method also flushes/clears the events. + */ +function readAboutDebuggingEvents() { + const ALL_CHANNELS = Ci.nsITelemetry.DATASET_ALL_CHANNELS; + // Retrieve and clear telemetry events. + const snapshot = Services.telemetry.snapshotEvents(ALL_CHANNELS, true); + // about:debugging events are logged in the parent process + const parentEvents = snapshot.parent || []; + + return parentEvents + .map(_toEventObject) + .filter(e => e.object === "aboutdebugging"); +} +/* exported getLoggedEvents */ + +/** + * The telemetry event data structure is simply an array. This helper remaps the array to + * an object with more user friendly properties. + */ +function _toEventObject(rawEvent) { + return { + // Category is typically devtools.main for us. + category: rawEvent[1], + // Method is the event's name (eg open, select_page etc...) + method: rawEvent[2], + // Object will usually be aboutdebugging for our tests + object: rawEvent[3], + // Value is usually empty for devtools events + value: rawEvent[4], + // Extras contain all the details of the event, including the session_id. + extras: rawEvent[5], + }; +} diff --git a/devtools/client/aboutdebugging/test/browser/mocks/helper-adb-mock.js b/devtools/client/aboutdebugging/test/browser/mocks/helper-adb-mock.js new file mode 100644 index 0000000000..a022bc8ffd --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/mocks/helper-adb-mock.js @@ -0,0 +1,137 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/** + * Setup the loader to return the provided mock object instead of the regular adb module. + * + * @param {Object} + * mock should implement the following methods: + * - registerListener(listener) + * - getRuntimes() + * - getDevices() + * - updateRuntimes() + * - unregisterListener(listener) + */ +function enableAdbMock(mock) { + const { + setMockedModule, + } = require("devtools/client/shared/browser-loader-mocks"); + setMockedModule(mock, "devtools/client/shared/remote-debugging/adb/adb"); +} +/* exported enableAdbMock */ + +/** + * Update the loader to clear the mock entry for the adb module. + */ +function disableAdbMock() { + const { + removeMockedModule, + } = require("devtools/client/shared/browser-loader-mocks"); + removeMockedModule("devtools/client/shared/remote-debugging/adb/adb"); +} +/* exported disableAdbMock */ + +/** + * Creates a simple mock version for adb, implementing all the expected methods + * with empty placeholders. + */ +function createAdbMock() { + const adbMock = {}; + adbMock.registerListener = function(listener) { + console.log("MOCKED METHOD registerListener"); + }; + + adbMock.getRuntimes = function() { + console.log("MOCKED METHOD getRuntimes"); + }; + + adbMock.getDevices = function() { + console.log("MOCKED METHOD getDevices"); + }; + + adbMock.updateRuntimes = function() { + console.log("MOCKED METHOD updateRuntimes"); + }; + + adbMock.unregisterListener = function(listener) { + console.log("MOCKED METHOD unregisterListener"); + }; + + adbMock.once = function() { + console.log("MOCKED METHOD once"); + }; + + adbMock.isProcessStarted = function() { + console.log("MOCKED METHOD isProcessStarted"); + }; + + return { adb: adbMock }; +} +/* exported createAdbMock */ + +/** + * The adb module allows to observe runtime updates. To simulate this behaviour + * the easiest is to use an EventEmitter-decorated object that can accept listeners and + * can emit events from the test. + * + * This method will update the registerListener method of the provided + * usbRuntimesMock in order to add listeners to a mockObserver, and returns said observer + * so that the test can emit "runtime-list-updated" when needed. + */ +function addObserverMock(adbMock) { + const EventEmitter = require("devtools/shared/event-emitter"); + + const observerMock = {}; + EventEmitter.decorate(observerMock); + adbMock.registerListener = function(listener) { + console.log("MOCKED METHOD registerListener with mock scanner"); + observerMock.on("runtime-list-updated", listener); + }; + + // NOTE FOR REVIEW: Instead of emitting "runtime-list-updated" events in the test, + // this mock could have a emitObservedEvent method, that would just emit the correct + // event. This way if the event name changes, everything remains contained in this + // method. + + return observerMock; +} +/* exported addObserverMock */ + +function createAdbProcessMock() { + const EventEmitter = require("devtools/shared/event-emitter"); + + const mock = {}; + EventEmitter.decorate(mock); + + mock.ready = false; + + mock.start = async () => { + console.log("MOCKED METHOD start"); + mock.ready = true; + mock.emit("adb-ready"); + }; + + return { adbProcess: mock }; +} +/* exported createAdbProcessMock */ + +function enableAdbProcessMock(mock) { + const { + setMockedModule, + } = require("devtools/client/shared/browser-loader-mocks"); + setMockedModule( + mock, + "devtools/client/shared/remote-debugging/adb/adb-process" + ); +} +/* exported enableAdbProcessMock */ + +function disableAdbProcessMock() { + const { + removeMockedModule, + } = require("devtools/client/shared/browser-loader-mocks"); + removeMockedModule("devtools/client/shared/remote-debugging/adb/adb-process"); +} +/* exported disableAdbProcessMock */ diff --git a/devtools/client/aboutdebugging/test/browser/mocks/helper-client-wrapper-mock.js b/devtools/client/aboutdebugging/test/browser/mocks/helper-client-wrapper-mock.js new file mode 100644 index 0000000000..e78d90457a --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/mocks/helper-client-wrapper-mock.js @@ -0,0 +1,129 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; // defined in head.js + +/* global CHROME_URL_ROOT */ + +// This head file contains helpers to create mock versions of the ClientWrapper class +// defined at devtools/client/aboutdebugging/src/modules/client-wrapper.js . + +const { + RUNTIME_PREFERENCE, +} = require("devtools/client/aboutdebugging/src/constants"); + +// Sensible default values for runtime preferences that should be usable in most +// situations +const DEFAULT_PREFERENCES = { + [RUNTIME_PREFERENCE.CONNECTION_PROMPT]: true, + [RUNTIME_PREFERENCE.PERMANENT_PRIVATE_BROWSING]: false, + [RUNTIME_PREFERENCE.SERVICE_WORKERS_ENABLED]: true, +}; + +// Creates a simple mock ClientWrapper. +function createClientMock() { + const EventEmitter = require("devtools/shared/event-emitter"); + const eventEmitter = {}; + EventEmitter.decorate(eventEmitter); + + return { + // add a reference to the internal event emitter so that consumers can fire client + // events. + _eventEmitter: eventEmitter, + _preferences: {}, + contentProcessFronts: [], + serviceWorkerRegistrationFronts: [], + once: (evt, listener) => { + eventEmitter.once(evt, listener); + }, + on: (evt, listener) => { + eventEmitter.on(evt, listener); + }, + off: (evt, listener) => { + eventEmitter.off(evt, listener); + }, + client: { + once: (evt, listener) => { + eventEmitter.once(evt, listener); + }, + on: (evt, listener) => { + eventEmitter.on(evt, listener); + }, + off: (evt, listener) => { + eventEmitter.off(evt, listener); + }, + }, + // no-op + close: () => {}, + // client is not closed + isClosed: () => false, + // no-op + connect: () => {}, + // no-op + getDeviceDescription: () => {}, + // Return default preference value or null if no match. + getPreference: function(prefName) { + if (prefName in this._preferences) { + return this._preferences[prefName]; + } + if (prefName in DEFAULT_PREFERENCES) { + return DEFAULT_PREFERENCES[prefName]; + } + return null; + }, + // Empty array of addons + listAddons: () => [], + // Empty array of processes + listProcesses: () => [], + // Empty array of tabs + listTabs: () => [], + // Empty arrays of workers + listWorkers: () => ({ + otherWorkers: [], + serviceWorkers: [], + sharedWorkers: [], + }), + // no-op + getMainProcess: () => {}, + // no-op + getFront: () => {}, + // stores the preference locally (doesn't update about:config) + setPreference: function(prefName, value) { + this._preferences[prefName] = value; + }, + getPerformancePanelUrl: () => CHROME_URL_ROOT + "empty.html", + loadPerformanceProfiler: () => {}, + // Valid compatibility report + checkVersionCompatibility: () => { + const { + COMPATIBILITY_STATUS, + } = require("devtools/client/shared/remote-debugging/version-checker"); + return { status: COMPATIBILITY_STATUS.COMPATIBLE }; + }, + }; +} + +// Create a ClientWrapper mock that can be used to replace the this-firefox runtime. +function createThisFirefoxClientMock() { + const mockThisFirefoxDescription = { + name: "Firefox", + channel: "nightly", + version: "63.0", + }; + + // Create a fake about:debugging tab because our test helper openAboutDebugging + // waits until about:debugging is displayed in the list of tabs. + const mockAboutDebuggingTab = { + retrieveFavicon: () => {}, + outerWindowID: 0, + traits: {}, + url: "about:debugging", + }; + + const mockThisFirefoxClient = createClientMock(); + mockThisFirefoxClient.listTabs = () => [mockAboutDebuggingTab]; + mockThisFirefoxClient.getDeviceDescription = () => mockThisFirefoxDescription; + + return mockThisFirefoxClient; +} +/* exported createThisFirefoxClientMock */ diff --git a/devtools/client/aboutdebugging/test/browser/mocks/helper-runtime-client-factory-mock.js b/devtools/client/aboutdebugging/test/browser/mocks/helper-runtime-client-factory-mock.js new file mode 100644 index 0000000000..508c84ba94 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/mocks/helper-runtime-client-factory-mock.js @@ -0,0 +1,76 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/** + * Setup the loader to return the provided mock object instead of the regular + * runtime-client-factory module. + * + * @param {Object} + * mock should implement the following methods: + * - createClientForRuntime(runtime) + */ +function enableRuntimeClientFactoryMock(mock) { + const { + setMockedModule, + } = require("devtools/client/shared/browser-loader-mocks"); + setMockedModule( + mock, + "devtools/client/aboutdebugging/src/modules/runtime-client-factory" + ); + + // When using a mocked client, we should not attempt to check default + // preferences. + mockRuntimeDefaultPreferences(); +} +/* exported enableRuntimeClientFactoryMock */ + +const mockRuntimeDefaultPreferences = function() { + const { + removeMockedModule, + setMockedModule, + } = require("devtools/client/shared/browser-loader-mocks"); + + const mock = { + setDefaultPreferencesIfNeeded: () => {}, + DEFAULT_PREFERENCES: [], + }; + setMockedModule( + mock, + "devtools/client/aboutdebugging/src/modules/runtime-default-preferences" + ); + + registerCleanupFunction(() => { + removeMockedModule( + "devtools/client/aboutdebugging/src/modules/runtime-default-preferences" + ); + }); +}; + +/** + * Update the loader to clear the mock entry for the runtime-client-factory module. + */ +function disableRuntimeClientFactoryMock() { + const { + removeMockedModule, + } = require("devtools/client/shared/browser-loader-mocks"); + removeMockedModule( + "devtools/client/aboutdebugging/src/modules/runtime-client-factory" + ); +} +/* exported disableRuntimeClientFactoryMock */ + +/** + * Creates a simple mock version for runtime-client-factory, implementing all the expected + * methods with empty placeholders. + */ +function createRuntimeClientFactoryMock() { + const RuntimeClientFactoryMock = {}; + RuntimeClientFactoryMock.createClientForRuntime = function(runtime) { + console.log("MOCKED METHOD createClientForRuntime"); + }; + + return RuntimeClientFactoryMock; +} +/* exported createRuntimeClientFactoryMock */ diff --git a/devtools/client/aboutdebugging/test/browser/resources/bad-extensions/invalid-json/manifest.json b/devtools/client/aboutdebugging/test/browser/resources/bad-extensions/invalid-json/manifest.json new file mode 100644 index 0000000000..4ab10b4de7 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/resources/bad-extensions/invalid-json/manifest.json @@ -0,0 +1 @@ +this is not valid json diff --git a/devtools/client/aboutdebugging/test/browser/resources/bad-extensions/invalid-property/manifest.json b/devtools/client/aboutdebugging/test/browser/resources/bad-extensions/invalid-property/manifest.json new file mode 100644 index 0000000000..9378bdaf7f --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/resources/bad-extensions/invalid-property/manifest.json @@ -0,0 +1,26 @@ +{ + "manifest_version": 2, + "name": "test-invalid-extension", + "version": "1", + "description": "the name says it all", + "permissions": [ + "*://*.foo.com/*", + "alarms", + "notifications", + "tabs" + ], + "background": { + "scripts": ["background.js"] + }, + "content_scripts": [{ + "matches": "*://*.foo.com/*", + "js": ["content.js"] + }], + "browser_action": { + "default_icon": { + "32": "home.svg" + }, + "default_title": "foobarbaz (v1)", + "browser_style": true + } +}
\ No newline at end of file diff --git a/devtools/client/aboutdebugging/test/browser/resources/packaged-extension/packaged-extension.xpi b/devtools/client/aboutdebugging/test/browser/resources/packaged-extension/packaged-extension.xpi Binary files differnew file mode 100644 index 0000000000..c1c7af9600 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/resources/packaged-extension/packaged-extension.xpi diff --git a/devtools/client/aboutdebugging/test/browser/resources/real/usb-runtimes-sample.json b/devtools/client/aboutdebugging/test/browser/resources/real/usb-runtimes-sample.json new file mode 100644 index 0000000000..bce334e95a --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/resources/real/usb-runtimes-sample.json @@ -0,0 +1,14 @@ +[ + { + "sidebarInfo": { + "deviceName": "Pixel 2", + "shortName": "Firefox Nightly" + }, + "runtimeDetails": { + "info": { + "name": "Mozilla Nightly", + "version": "64.0a1" + } + } + } +] diff --git a/devtools/client/aboutdebugging/test/browser/resources/service-workers/controlled-sw.html b/devtools/client/aboutdebugging/test/browser/resources/service-workers/controlled-sw.html new file mode 100644 index 0000000000..98d3bffd95 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/resources/service-workers/controlled-sw.html @@ -0,0 +1,38 @@ +<!DOCTYPE HTML> +<html> +<head> + <meta charset="UTF-8"> + <title>Service worker controlled</title> +</head> +<body> +<script type="text/javascript"> + +"use strict"; + +let registration; + +const registerServiceWorker = async function() { + try { + registration = await navigator.serviceWorker.register("controlled-sw.js"); + dump("Controlled service worker registered\n"); + } catch (e) { + dump("Controlled service worker not registered: " + e + "\n"); + } +}; + +// Helper called from helper-serviceworker.js to unregister the service worker. +window.getRegistration = function() { + return registration; +}; + +// Called from browser_aboutdebugging_serviceworker_status.js +window.installServiceWorker = function() { + registration.installing.postMessage("install-service-worker"); +}; + +// Register the service worker. +registerServiceWorker(); + +</script> +</body> +</html> diff --git a/devtools/client/aboutdebugging/test/browser/resources/service-workers/controlled-sw.js b/devtools/client/aboutdebugging/test/browser/resources/service-workers/controlled-sw.js new file mode 100644 index 0000000000..79fb72f91e --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/resources/service-workers/controlled-sw.js @@ -0,0 +1,31 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +/* eslint-env worker */ + +"use strict"; + +// Copied from shared-head.js +function waitUntil(predicate, interval = 10) { + if (predicate()) { + return Promise.resolve(true); + } + return new Promise(resolve => { + setTimeout(function() { + waitUntil(predicate, interval).then(() => resolve(true)); + }, interval); + }); +} + +// This flag will be flipped from controlled-sw.html::installServiceWorker() +let canInstall = false; +self.addEventListener("message", function(event) { + if (event.data === "install-service-worker") { + canInstall = true; + } +}); + +// Wait for the canInstall flag to be flipped before completing the install. +self.addEventListener("install", function(event) { + event.waitUntil(waitUntil(() => canInstall)); +}); diff --git a/devtools/client/aboutdebugging/test/browser/resources/service-workers/empty-sw.html b/devtools/client/aboutdebugging/test/browser/resources/service-workers/empty-sw.html new file mode 100644 index 0000000000..ab862743a7 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/resources/service-workers/empty-sw.html @@ -0,0 +1,30 @@ +<!DOCTYPE HTML> +<html> +<head> + <meta charset="UTF-8"> + <title>Service worker test</title> +</head> +<body> +<script type="text/javascript"> +"use strict"; + +let registration; + +const registerServiceWorker = async function() { + try { + registration = await navigator.serviceWorker.register("empty-sw.js"); + dump("Empty service worker registered\n"); + } catch (e) { + dump("Empty service worker not registered: " + e + "\n"); + } +}; + +// Helper called from helper-serviceworker.js to unregister the service worker. +window.getRegistration = function() { + return registration; +}; +// Register the service worker. +registerServiceWorker(); +</script> +</body> +</html> diff --git a/devtools/client/aboutdebugging/test/browser/resources/service-workers/empty-sw.js b/devtools/client/aboutdebugging/test/browser/resources/service-workers/empty-sw.js new file mode 100644 index 0000000000..1e7226402c --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/resources/service-workers/empty-sw.js @@ -0,0 +1 @@ +// Empty, just test registering. diff --git a/devtools/client/aboutdebugging/test/browser/resources/service-workers/fetch-sw.html b/devtools/client/aboutdebugging/test/browser/resources/service-workers/fetch-sw.html new file mode 100644 index 0000000000..a1bb218341 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/resources/service-workers/fetch-sw.html @@ -0,0 +1,30 @@ +<!DOCTYPE HTML> +<html> +<head> + <meta charset="UTF-8"> + <title>Service worker test</title> +</head> +<body> +<script type="text/javascript"> +"use strict"; + +let registration; + +const registerServiceWorker = async function() { + try { + registration = await navigator.serviceWorker.register("fetch-sw.js"); + dump("Empty service worker registered\n"); + } catch (e) { + dump("Empty service worker not registered: " + e + "\n"); + } +}; + +// Helper called from helper-serviceworker.js to unregister the service worker. +window.getRegistration = function() { + return registration; +}; +// Register the service worker. +registerServiceWorker(); +</script> +</body> +</html> diff --git a/devtools/client/aboutdebugging/test/browser/resources/service-workers/fetch-sw.js b/devtools/client/aboutdebugging/test/browser/resources/service-workers/fetch-sw.js new file mode 100644 index 0000000000..271ee9bb4c --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/resources/service-workers/fetch-sw.js @@ -0,0 +1,6 @@ +"use strict"; + +// Bug 1328293 +self.onfetch = function(event) { + // do nothing. +}; diff --git a/devtools/client/aboutdebugging/test/browser/resources/service-workers/push-sw.html b/devtools/client/aboutdebugging/test/browser/resources/service-workers/push-sw.html new file mode 100644 index 0000000000..174d35722b --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/resources/service-workers/push-sw.html @@ -0,0 +1,52 @@ +<!DOCTYPE HTML> +<html> +<head> + <meta charset="UTF-8"> + <title>Service worker push test</title> +</head> +<body> +<script type="text/javascript"> + +"use strict"; + +let registration; +let subscription; + +const registerServiceWorker = async function() { + const perm = { type: "desktop-notification", allow: true, context: document }; + await SpecialPowers.pushPermissions([perm]); + + try { + registration = await navigator.serviceWorker.register("push-sw.js"); + dump("Push service worker registered\n"); + } catch (e) { + dump("Push service worker not registered: " + e + "\n"); + } +}; + +// Helper called from helper-serviceworker.js to unregister the service worker. +window.getRegistration = function() { + return registration; +}; + +// Helper called from browser_aboutdebugging_serviceworker_pushservice_url.js +window.subscribeToPush = async function() { + try { + subscription = await registration.pushManager.subscribe(); + dump("SW subscribed to push: " + subscription.endpoint + "\n"); + } catch (e) { + dump("SW not subscribed to push: " + e + "\n"); + } +}; + +// Helper called from browser_aboutdebugging_serviceworker_pushservice_url.js +window.unsubscribeToPush = async function() { + subscription.unsubscribe(); +}; + +// Register the service worker. +registerServiceWorker(); + +</script> +</body> +</html> diff --git a/devtools/client/aboutdebugging/test/browser/resources/service-workers/push-sw.js b/devtools/client/aboutdebugging/test/browser/resources/service-workers/push-sw.js new file mode 100644 index 0000000000..20710378c7 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/resources/service-workers/push-sw.js @@ -0,0 +1,35 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +/* eslint-env worker */ +/* global clients */ + +"use strict"; + +// Send a message to all controlled windows. +function postMessage(message) { + return clients.matchAll().then(function(clientlist) { + clientlist.forEach(function(client) { + client.postMessage(message); + }); + }); +} + +// Don't wait for the next page load to become the active service worker. +self.addEventListener("install", function(event) { + event.waitUntil(self.skipWaiting()); +}); + +// Claim control over the currently open test page when activating. +self.addEventListener("activate", function(event) { + event.waitUntil( + self.clients.claim().then(function() { + return postMessage("sw-claimed"); + }) + ); +}); + +// Forward all "push" events to the controlled window. +self.addEventListener("push", function(event) { + event.waitUntil(postMessage("sw-pushed")); +}); diff --git a/devtools/client/aboutdebugging/test/browser/resources/test-adb-extension/adb-extension-linux.xpi b/devtools/client/aboutdebugging/test/browser/resources/test-adb-extension/adb-extension-linux.xpi Binary files differnew file mode 100644 index 0000000000..56054c341c --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/resources/test-adb-extension/adb-extension-linux.xpi diff --git a/devtools/client/aboutdebugging/test/browser/resources/test-adb-extension/adb-extension-linux64.xpi b/devtools/client/aboutdebugging/test/browser/resources/test-adb-extension/adb-extension-linux64.xpi Binary files differnew file mode 100644 index 0000000000..9cd737b017 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/resources/test-adb-extension/adb-extension-linux64.xpi diff --git a/devtools/client/aboutdebugging/test/browser/resources/test-adb-extension/adb-extension-mac64.xpi b/devtools/client/aboutdebugging/test/browser/resources/test-adb-extension/adb-extension-mac64.xpi Binary files differnew file mode 100644 index 0000000000..5af9bc963d --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/resources/test-adb-extension/adb-extension-mac64.xpi diff --git a/devtools/client/aboutdebugging/test/browser/resources/test-adb-extension/adb-extension-win32.xpi b/devtools/client/aboutdebugging/test/browser/resources/test-adb-extension/adb-extension-win32.xpi Binary files differnew file mode 100644 index 0000000000..0c10c8502c --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/resources/test-adb-extension/adb-extension-win32.xpi diff --git a/devtools/client/aboutdebugging/test/browser/resources/test-temporary-extension/manifest.json b/devtools/client/aboutdebugging/test/browser/resources/test-temporary-extension/manifest.json new file mode 100644 index 0000000000..52dfb39662 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/resources/test-temporary-extension/manifest.json @@ -0,0 +1,13 @@ +{ + "manifest_version": 2, + "name": "test-temporary-extension", + "version": "1.0", + "applications": { + "gecko": { + "id": "test-temporary-extension@mozilla.org" + } + }, + "background": { + "scripts": ["script.js"] + } +} diff --git a/devtools/client/aboutdebugging/test/browser/resources/test-temporary-extension/script.js b/devtools/client/aboutdebugging/test/browser/resources/test-temporary-extension/script.js new file mode 100644 index 0000000000..02d5604c3a --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/resources/test-temporary-extension/script.js @@ -0,0 +1,8 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +/* eslint-env browser */ + +"use strict"; + +document.body.innerText = "Background Page Body Test Content"; diff --git a/devtools/client/aboutdebugging/test/browser/test-tab-favicons.html b/devtools/client/aboutdebugging/test/browser/test-tab-favicons.html new file mode 100644 index 0000000000..35954f67a1 --- /dev/null +++ b/devtools/client/aboutdebugging/test/browser/test-tab-favicons.html @@ -0,0 +1,8 @@ +<!DOCTYPE HTML> +<html> + <head> + <title>Favicon tab</title> + <link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAATklEQVRYhe3SIQ4AIBADwf7/04elBAtrVlSduGnSTDJ7cuT1PQJwwO+Hl7sAGAA07gjAAfgIBeAAoHFHAA7ARygABwCNOwJwAD5CATRgAYXh+kypw86nAAAAAElFTkSuQmCC"> + <head> + <body>Some page with a favicon</body> +</html> diff --git a/devtools/client/aboutdebugging/test/node/.eslintrc.js b/devtools/client/aboutdebugging/test/node/.eslintrc.js new file mode 100644 index 0000000000..ffb3e70473 --- /dev/null +++ b/devtools/client/aboutdebugging/test/node/.eslintrc.js @@ -0,0 +1,10 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +module.exports = { + env: { + jest: true, + }, +}; diff --git a/devtools/client/aboutdebugging/test/node/README.md b/devtools/client/aboutdebugging/test/node/README.md new file mode 100644 index 0000000000..58cbe55691 --- /dev/null +++ b/devtools/client/aboutdebugging/test/node/README.md @@ -0,0 +1,22 @@ +# Jest Tests for devtools/client/aboutdebugging + +## About + +DevTools React components can be tested using [jest](https://jestjs.io/). Jest allows to test our UI components in isolation and complement our end to end mochitests. + +## Run locally + +We use yarn for dependency management. To run the tests locally: +``` + cd devtools/client/shared/aboutdebugging/test/node + yarn && yarn test +``` + +## Run on try + +The tests run on try on linux64 platforms. The complete name of try job is `devtools-tests`. In treeherder, they will show up as `node(devtools)`. + +Adding the tests to a try push depends on the try selector you are using. +- try fuzzy: look for the job named `source-test-node-devtools-tests` + +The configuration file for try can be found at `taskcluster/ci/source-test/node.yml` diff --git a/devtools/client/aboutdebugging/test/node/babel.config.js b/devtools/client/aboutdebugging/test/node/babel.config.js new file mode 100644 index 0000000000..a9e47ba7fb --- /dev/null +++ b/devtools/client/aboutdebugging/test/node/babel.config.js @@ -0,0 +1,8 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +module.exports = { + plugins: ["@babel/plugin-proposal-async-generator-functions"], +}; diff --git a/devtools/client/aboutdebugging/test/node/components/__snapshots__/shared-message.test.js.snap b/devtools/client/aboutdebugging/test/node/components/__snapshots__/shared-message.test.js.snap new file mode 100644 index 0000000000..ae0568757a --- /dev/null +++ b/devtools/client/aboutdebugging/test/node/components/__snapshots__/shared-message.test.js.snap @@ -0,0 +1,91 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Message component renders the expected snapshot for ERROR level 1`] = ` +<aside + className="message message--level-error qa-message some-classname-3" +> + <img + className="message__icon" + src="chrome://devtools/skin/images/aboutdebugging-error.svg" + /> + <div + className="message__body" + > + <div> + Message content + </div> + </div> +</aside> +`; + +exports[`Message component renders the expected snapshot for INFO level 1`] = ` +<aside + className="message message--level-info qa-message some-classname-1" +> + <img + className="message__icon" + src="chrome://devtools/skin/images/aboutdebugging-information.svg" + /> + <div + className="message__body" + > + <div> + Message content + </div> + </div> +</aside> +`; + +exports[`Message component renders the expected snapshot for WARNING level 1`] = ` +<aside + className="message message--level-warning qa-message some-classname-2" +> + <img + className="message__icon" + src="chrome://global/skin/icons/warning.svg" + /> + <div + className="message__body" + > + <div> + Message content + </div> + </div> +</aside> +`; + +exports[`Message component renders with closing button renders the expected snapshot for Message with closing button 1`] = ` +<aside + className="message message--level-info qa-message some-classname-1" +> + <img + className="message__icon" + src="chrome://devtools/skin/images/aboutdebugging-information.svg" + /> + <div + className="message__body" + > + <div> + Message content + </div> + </div> + <button + className="ghost-button message__button message__button--info qa-message-button-close-button" + onClick={[Function]} + > + <Localized + attrs={ + Object { + "alt": true, + } + } + id="about-debugging-message-close-icon" + > + <img + className="qa-message-button-close-icon" + src="chrome://devtools/skin/images/close.svg" + /> + </Localized> + </button> +</aside> +`; diff --git a/devtools/client/aboutdebugging/test/node/components/shared-message.test.js b/devtools/client/aboutdebugging/test/node/components/shared-message.test.js new file mode 100644 index 0000000000..02f737c20c --- /dev/null +++ b/devtools/client/aboutdebugging/test/node/components/shared-message.test.js @@ -0,0 +1,69 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/** + * Unit tests for the shared/Message component. + */ + +const { shallow } = require("enzyme"); +const React = require("react"); +const dom = require("devtools/client/shared/vendor/react-dom-factories"); + +const { + MESSAGE_LEVEL, +} = require("devtools/client/aboutdebugging/src/constants"); + +const Message = React.createFactory( + require("devtools/client/aboutdebugging/src/components/shared/Message") +); + +describe("Message component", () => { + it("renders the expected snapshot for INFO level", () => { + const message = shallow( + Message({ + children: dom.div({}, "Message content"), + className: "some-classname-1", + level: MESSAGE_LEVEL.INFO, + }) + ); + expect(message).toMatchSnapshot(); + }); + + it("renders the expected snapshot for WARNING level", () => { + const message = shallow( + Message({ + children: dom.div({}, "Message content"), + className: "some-classname-2", + level: MESSAGE_LEVEL.WARNING, + }) + ); + expect(message).toMatchSnapshot(); + }); + + it("renders the expected snapshot for ERROR level", () => { + const message = shallow( + Message({ + children: dom.div({}, "Message content"), + className: "some-classname-3", + level: MESSAGE_LEVEL.ERROR, + }) + ); + expect(message).toMatchSnapshot(); + }); +}); + +describe("Message component renders with closing button", () => { + it("renders the expected snapshot for Message with closing button", () => { + const message = shallow( + Message({ + children: dom.div({}, "Message content"), + className: "some-classname-1", + level: MESSAGE_LEVEL.INFO, + isCloseable: true, + }) + ); + expect(message).toMatchSnapshot(); + }); +}); diff --git a/devtools/client/aboutdebugging/test/node/jest.config.js b/devtools/client/aboutdebugging/test/node/jest.config.js new file mode 100644 index 0000000000..e114658f88 --- /dev/null +++ b/devtools/client/aboutdebugging/test/node/jest.config.js @@ -0,0 +1,14 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* global __dirname */ + +const sharedJestConfig = require(`${__dirname}/../../../shared/test-helpers/shared-jest.config`); + +module.exports = { + ...sharedJestConfig, + setupFiles: ["<rootDir>setup.js"], + snapshotSerializers: ["enzyme-to-json/serializer"], +}; diff --git a/devtools/client/aboutdebugging/test/node/package.json b/devtools/client/aboutdebugging/test/node/package.json new file mode 100644 index 0000000000..db8fa83e5d --- /dev/null +++ b/devtools/client/aboutdebugging/test/node/package.json @@ -0,0 +1,22 @@ +{ + "name": "devtools-client-framework-tests", + "license": "MPL-2.0", + "version": "0.0.1", + "engines": { + "node": ">=8.9.4" + }, + "scripts": { + "test": "jest", + "test-ci": "jest --json" + }, + "dependencies": { + "@babel/plugin-proposal-async-generator-functions": "^7.2.0", + "enzyme": "^3.9.0", + "enzyme-adapter-react-16": "^1.13.2", + "enzyme-to-json": "^3.3.5", + "jest": "^24.6.0", + "react": "16.4.1", + "react-dom": "16.4.1", + "react-test-renderer": "16.4.1" + } +} diff --git a/devtools/client/aboutdebugging/test/node/setup.js b/devtools/client/aboutdebugging/test/node/setup.js new file mode 100644 index 0000000000..eac87b2c7a --- /dev/null +++ b/devtools/client/aboutdebugging/test/node/setup.js @@ -0,0 +1,15 @@ +/* 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/>. */ + +"use strict"; + +// Configure enzyme with React 16 adapter. +const Enzyme = require("enzyme"); +const Adapter = require("enzyme-adapter-react-16"); +Enzyme.configure({ adapter: new Adapter() }); + +const { + setMocksInGlobal, +} = require("devtools/client/shared/test-helpers/shared-node-helpers"); +setMocksInGlobal(); diff --git a/devtools/client/aboutdebugging/test/node/yarn.lock b/devtools/client/aboutdebugging/test/node/yarn.lock new file mode 100644 index 0000000000..396c84ebcd --- /dev/null +++ b/devtools/client/aboutdebugging/test/node/yarn.lock @@ -0,0 +1,4133 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/code-frame@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" + integrity sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA== + dependencies: + "@babel/highlight" "^7.0.0" + +"@babel/core@^7.1.0": + version "7.4.5" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.4.5.tgz#081f97e8ffca65a9b4b0fdc7e274e703f000c06a" + integrity sha512-OvjIh6aqXtlsA8ujtGKfC7LYWksYSX8yQcM8Ay3LuvVeQ63lcOKgoZWVqcpFwkd29aYU9rVx7jxhfhiEDV9MZA== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.4.4" + "@babel/helpers" "^7.4.4" + "@babel/parser" "^7.4.5" + "@babel/template" "^7.4.4" + "@babel/traverse" "^7.4.5" + "@babel/types" "^7.4.4" + convert-source-map "^1.1.0" + debug "^4.1.0" + json5 "^2.1.0" + lodash "^4.17.11" + resolve "^1.3.2" + semver "^5.4.1" + source-map "^0.5.0" + +"@babel/generator@^7.4.0", "@babel/generator@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.4.4.tgz#174a215eb843fc392c7edcaabeaa873de6e8f041" + integrity sha512-53UOLK6TVNqKxf7RUh8NE851EHRxOOeVXKbK2bivdb+iziMyk03Sr4eaE9OELCbyZAAafAKPDwF2TPUES5QbxQ== + dependencies: + "@babel/types" "^7.4.4" + jsesc "^2.5.1" + lodash "^4.17.11" + source-map "^0.5.0" + trim-right "^1.0.1" + +"@babel/helper-annotate-as-pure@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz#323d39dd0b50e10c7c06ca7d7638e6864d8c5c32" + integrity sha512-3UYcJUj9kvSLbLbUIfQTqzcy5VX7GRZ/CCDrnOaZorFFM01aXp1+GJwuFGV4NDDoAS+mOUyHcO6UD/RfqOks3Q== + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-function-name@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz#a0ceb01685f73355d4360c1247f582bfafc8ff53" + integrity sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw== + dependencies: + "@babel/helper-get-function-arity" "^7.0.0" + "@babel/template" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-get-function-arity@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" + integrity sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ== + dependencies: + "@babel/types" "^7.0.0" + +"@babel/helper-plugin-utils@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz#bbb3fbee98661c569034237cc03967ba99b4f250" + integrity sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA== + +"@babel/helper-remap-async-to-generator@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.1.0.tgz#361d80821b6f38da75bd3f0785ece20a88c5fe7f" + integrity sha512-3fOK0L+Fdlg8S5al8u/hWE6vhufGSn0bN09xm2LXMy//REAF8kDCrYoOBKYmA8m5Nom+sV9LyLCwrFynA8/slg== + dependencies: + "@babel/helper-annotate-as-pure" "^7.0.0" + "@babel/helper-wrap-function" "^7.1.0" + "@babel/template" "^7.1.0" + "@babel/traverse" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-split-export-declaration@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz#ff94894a340be78f53f06af038b205c49d993677" + integrity sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q== + dependencies: + "@babel/types" "^7.4.4" + +"@babel/helper-wrap-function@^7.1.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.2.0.tgz#c4e0012445769e2815b55296ead43a958549f6fa" + integrity sha512-o9fP1BZLLSrYlxYEYyl2aS+Flun5gtjTIG8iln+XuEzQTs0PLagAGSXUcqruJwD5fM48jzIEggCKpIfWTcR7pQ== + dependencies: + "@babel/helper-function-name" "^7.1.0" + "@babel/template" "^7.1.0" + "@babel/traverse" "^7.1.0" + "@babel/types" "^7.2.0" + +"@babel/helpers@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.4.4.tgz#868b0ef59c1dd4e78744562d5ce1b59c89f2f2a5" + integrity sha512-igczbR/0SeuPR8RFfC7tGrbdTbFL3QTvH6D+Z6zNxnTe//GyqmtHmDkzrqDmyZ3eSwPqB/LhyKoU5DXsp+Vp2A== + dependencies: + "@babel/template" "^7.4.4" + "@babel/traverse" "^7.4.4" + "@babel/types" "^7.4.4" + +"@babel/highlight@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" + integrity sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw== + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^4.0.0" + +"@babel/parser@^7.1.0", "@babel/parser@^7.4.3", "@babel/parser@^7.4.4", "@babel/parser@^7.4.5": + version "7.4.5" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.4.5.tgz#04af8d5d5a2b044a2a1bffacc1e5e6673544e872" + integrity sha512-9mUqkL1FF5T7f0WDFfAoDdiMVPWsdD1gZYzSnaXsxUCUqzuch/8of9G3VUSNiZmMBoRxT3neyVsqeiL/ZPcjew== + +"@babel/plugin-proposal-async-generator-functions@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.2.0.tgz#b289b306669dce4ad20b0252889a15768c9d417e" + integrity sha512-+Dfo/SCQqrwx48ptLVGLdE39YtWRuKc/Y9I5Fy0P1DDBB9lsAHpjcEJQt+4IifuSOSTLBKJObJqMvaO1pIE8LQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/helper-remap-async-to-generator" "^7.1.0" + "@babel/plugin-syntax-async-generators" "^7.2.0" + +"@babel/plugin-syntax-async-generators@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.2.0.tgz#69e1f0db34c6f5a0cf7e2b3323bf159a76c8cb7f" + integrity sha512-1ZrIRBv2t0GSlcwVoQ6VgSLpLgiN/FVQUzt9znxo7v2Ov4jJrs8RY8tv0wvDmFN3qIdMKWrmMMW6yZ0G19MfGg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/plugin-syntax-object-rest-spread@^7.0.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz#3b7a3e733510c57e820b9142a6579ac8b0dfad2e" + integrity sha512-t0JKGgqk2We+9may3t0xDdmneaXmyxq0xieYcKHxIsrJO64n1OiMWNUtc5gQK1PA0NpdCRrtZp4z+IUaKugrSA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + +"@babel/template@^7.1.0", "@babel/template@^7.4.0", "@babel/template@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.4.4.tgz#f4b88d1225689a08f5bc3a17483545be9e4ed237" + integrity sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.4.4" + "@babel/types" "^7.4.4" + +"@babel/traverse@^7.1.0", "@babel/traverse@^7.4.3", "@babel/traverse@^7.4.4", "@babel/traverse@^7.4.5": + version "7.4.5" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.4.5.tgz#4e92d1728fd2f1897dafdd321efbff92156c3216" + integrity sha512-Vc+qjynwkjRmIFGxy0KYoPj4FdVDxLej89kMHFsWScq999uX+pwcX4v9mWRjW0KcAYTPAuVQl2LKP1wEVLsp+A== + dependencies: + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.4.4" + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-split-export-declaration" "^7.4.4" + "@babel/parser" "^7.4.5" + "@babel/types" "^7.4.4" + debug "^4.1.0" + globals "^11.1.0" + lodash "^4.17.11" + +"@babel/types@^7.0.0", "@babel/types@^7.2.0", "@babel/types@^7.3.0", "@babel/types@^7.4.0", "@babel/types@^7.4.4": + version "7.4.4" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.4.4.tgz#8db9e9a629bb7c29370009b4b779ed93fe57d5f0" + integrity sha512-dOllgYdnEFOebhkKCjzSVFqw/PmmB8pH6RGOWkY4GsboQNd47b1fBThBSwlHAq9alF9vc1M3+6oqR47R50L0tQ== + dependencies: + esutils "^2.0.2" + lodash "^4.17.11" + to-fast-properties "^2.0.0" + +"@cnakazawa/watch@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.3.tgz#099139eaec7ebf07a27c1786a3ff64f39464d2ef" + integrity sha512-r5160ogAvGyHsal38Kux7YYtodEKOj89RGb28ht1jh3SJb08VwRwAKKJL0bGb04Zd/3r9FL3BFIc3bBidYffCA== + dependencies: + exec-sh "^0.3.2" + minimist "^1.2.0" + +"@jest/console@^24.7.1": + version "24.7.1" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-24.7.1.tgz#32a9e42535a97aedfe037e725bd67e954b459545" + integrity sha512-iNhtIy2M8bXlAOULWVTUxmnelTLFneTNEkHCgPmgd+zNwy9zVddJ6oS5rZ9iwoscNdT5mMwUd0C51v/fSlzItg== + dependencies: + "@jest/source-map" "^24.3.0" + chalk "^2.0.1" + slash "^2.0.0" + +"@jest/core@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-24.8.0.tgz#fbbdcd42a41d0d39cddbc9f520c8bab0c33eed5b" + integrity sha512-R9rhAJwCBQzaRnrRgAdVfnglUuATXdwTRsYqs6NMdVcAl5euG8LtWDe+fVkN27YfKVBW61IojVsXKaOmSnqd/A== + dependencies: + "@jest/console" "^24.7.1" + "@jest/reporters" "^24.8.0" + "@jest/test-result" "^24.8.0" + "@jest/transform" "^24.8.0" + "@jest/types" "^24.8.0" + ansi-escapes "^3.0.0" + chalk "^2.0.1" + exit "^0.1.2" + graceful-fs "^4.1.15" + jest-changed-files "^24.8.0" + jest-config "^24.8.0" + jest-haste-map "^24.8.0" + jest-message-util "^24.8.0" + jest-regex-util "^24.3.0" + jest-resolve-dependencies "^24.8.0" + jest-runner "^24.8.0" + jest-runtime "^24.8.0" + jest-snapshot "^24.8.0" + jest-util "^24.8.0" + jest-validate "^24.8.0" + jest-watcher "^24.8.0" + micromatch "^3.1.10" + p-each-series "^1.0.0" + pirates "^4.0.1" + realpath-native "^1.1.0" + rimraf "^2.5.4" + strip-ansi "^5.0.0" + +"@jest/environment@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-24.8.0.tgz#0342261383c776bdd652168f68065ef144af0eac" + integrity sha512-vlGt2HLg7qM+vtBrSkjDxk9K0YtRBi7HfRFaDxoRtyi+DyVChzhF20duvpdAnKVBV6W5tym8jm0U9EfXbDk1tw== + dependencies: + "@jest/fake-timers" "^24.8.0" + "@jest/transform" "^24.8.0" + "@jest/types" "^24.8.0" + jest-mock "^24.8.0" + +"@jest/fake-timers@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-24.8.0.tgz#2e5b80a4f78f284bcb4bd5714b8e10dd36a8d3d1" + integrity sha512-2M4d5MufVXwi6VzZhJ9f5S/wU4ud2ck0kxPof1Iz3zWx6Y+V2eJrES9jEktB6O3o/oEyk+il/uNu9PvASjWXQw== + dependencies: + "@jest/types" "^24.8.0" + jest-message-util "^24.8.0" + jest-mock "^24.8.0" + +"@jest/reporters@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-24.8.0.tgz#075169cd029bddec54b8f2c0fc489fd0b9e05729" + integrity sha512-eZ9TyUYpyIIXfYCrw0UHUWUvE35vx5I92HGMgS93Pv7du+GHIzl+/vh8Qj9MCWFK/4TqyttVBPakWMOfZRIfxw== + dependencies: + "@jest/environment" "^24.8.0" + "@jest/test-result" "^24.8.0" + "@jest/transform" "^24.8.0" + "@jest/types" "^24.8.0" + chalk "^2.0.1" + exit "^0.1.2" + glob "^7.1.2" + istanbul-lib-coverage "^2.0.2" + istanbul-lib-instrument "^3.0.1" + istanbul-lib-report "^2.0.4" + istanbul-lib-source-maps "^3.0.1" + istanbul-reports "^2.1.1" + jest-haste-map "^24.8.0" + jest-resolve "^24.8.0" + jest-runtime "^24.8.0" + jest-util "^24.8.0" + jest-worker "^24.6.0" + node-notifier "^5.2.1" + slash "^2.0.0" + source-map "^0.6.0" + string-length "^2.0.0" + +"@jest/source-map@^24.3.0": + version "24.3.0" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-24.3.0.tgz#563be3aa4d224caf65ff77edc95cd1ca4da67f28" + integrity sha512-zALZt1t2ou8le/crCeeiRYzvdnTzaIlpOWaet45lNSqNJUnXbppUUFR4ZUAlzgDmKee4Q5P/tKXypI1RiHwgag== + dependencies: + callsites "^3.0.0" + graceful-fs "^4.1.15" + source-map "^0.6.0" + +"@jest/test-result@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-24.8.0.tgz#7675d0aaf9d2484caa65e048d9b467d160f8e9d3" + integrity sha512-+YdLlxwizlfqkFDh7Mc7ONPQAhA4YylU1s529vVM1rsf67vGZH/2GGm5uO8QzPeVyaVMobCQ7FTxl38QrKRlng== + dependencies: + "@jest/console" "^24.7.1" + "@jest/types" "^24.8.0" + "@types/istanbul-lib-coverage" "^2.0.0" + +"@jest/test-sequencer@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-24.8.0.tgz#2f993bcf6ef5eb4e65e8233a95a3320248cf994b" + integrity sha512-OzL/2yHyPdCHXEzhoBuq37CE99nkme15eHkAzXRVqthreWZamEMA0WoetwstsQBCXABhczpK03JNbc4L01vvLg== + dependencies: + "@jest/test-result" "^24.8.0" + jest-haste-map "^24.8.0" + jest-runner "^24.8.0" + jest-runtime "^24.8.0" + +"@jest/transform@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-24.8.0.tgz#628fb99dce4f9d254c6fd9341e3eea262e06fef5" + integrity sha512-xBMfFUP7TortCs0O+Xtez2W7Zu1PLH9bvJgtraN1CDST6LBM/eTOZ9SfwS/lvV8yOfcDpFmwf9bq5cYbXvqsvA== + dependencies: + "@babel/core" "^7.1.0" + "@jest/types" "^24.8.0" + babel-plugin-istanbul "^5.1.0" + chalk "^2.0.1" + convert-source-map "^1.4.0" + fast-json-stable-stringify "^2.0.0" + graceful-fs "^4.1.15" + jest-haste-map "^24.8.0" + jest-regex-util "^24.3.0" + jest-util "^24.8.0" + micromatch "^3.1.10" + realpath-native "^1.1.0" + slash "^2.0.0" + source-map "^0.6.1" + write-file-atomic "2.4.1" + +"@jest/types@^24.8.0": + version "24.8.0" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-24.8.0.tgz#f31e25948c58f0abd8c845ae26fcea1491dea7ad" + integrity sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg== + dependencies: + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^1.1.1" + "@types/yargs" "^12.0.9" + +"@types/babel__core@^7.1.0": + version "7.1.2" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.2.tgz#608c74f55928033fce18b99b213c16be4b3d114f" + integrity sha512-cfCCrFmiGY/yq0NuKNxIQvZFy9kY/1immpSpTngOnyIbD4+eJOG5mxphhHDv3CHL9GltO4GcKr54kGBg3RNdbg== + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + "@types/babel__generator" "*" + "@types/babel__template" "*" + "@types/babel__traverse" "*" + +"@types/babel__generator@*": + version "7.0.2" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.0.2.tgz#d2112a6b21fad600d7674274293c85dce0cb47fc" + integrity sha512-NHcOfab3Zw4q5sEE2COkpfXjoE7o+PmqD9DQW4koUT3roNxwziUdXGnRndMat/LJNUtePwn1TlP4do3uoe3KZQ== + dependencies: + "@babel/types" "^7.0.0" + +"@types/babel__template@*": + version "7.0.2" + resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.0.2.tgz#4ff63d6b52eddac1de7b975a5223ed32ecea9307" + integrity sha512-/K6zCpeW7Imzgab2bLkLEbz0+1JlFSrUMdw7KoIIu+IUdu51GWaBZpd3y1VXGVXzynvGa4DaIaxNZHiON3GXUg== + dependencies: + "@babel/parser" "^7.1.0" + "@babel/types" "^7.0.0" + +"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": + version "7.0.6" + resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.0.6.tgz#328dd1a8fc4cfe3c8458be9477b219ea158fd7b2" + integrity sha512-XYVgHF2sQ0YblLRMLNPB3CkFMewzFmlDsH/TneZFHUXDlABQgh88uOxuez7ZcXxayLFrqLwtDH1t+FmlFwNZxw== + dependencies: + "@babel/types" "^7.3.0" + +"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff" + integrity sha512-hRJD2ahnnpLgsj6KWMYSrmXkM3rm2Dl1qkx6IOFD5FnuNPXJIG5L0dhgKXCYTRMGzU4n0wImQ/xfmRc4POUFlg== + +"@types/istanbul-lib-report@*": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-1.1.1.tgz#e5471e7fa33c61358dd38426189c037a58433b8c" + integrity sha512-3BUTyMzbZa2DtDI2BkERNC6jJw2Mr2Y0oGI7mRxYNBPxppbtEK1F66u3bKwU2g+wxwWI7PAoRpJnOY1grJqzHg== + dependencies: + "@types/istanbul-lib-coverage" "*" + +"@types/istanbul-reports@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-1.1.1.tgz#7a8cbf6a406f36c8add871625b278eaf0b0d255a" + integrity sha512-UpYjBi8xefVChsCoBpKShdxTllC9pwISirfoZsUa2AAdQg/Jd2KQGtSbw+ya7GPo7x/wAPlH6JBhKhAsXUEZNA== + dependencies: + "@types/istanbul-lib-coverage" "*" + "@types/istanbul-lib-report" "*" + +"@types/node@*": + version "12.0.3" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.0.3.tgz#5d8d24e0033fc6393efadc85cb59c1f638095c9a" + integrity sha512-zkOxCS/fA+3SsdA+9Yun0iANxzhQRiNwTvJSr6N95JhuJ/x27z9G2URx1Jpt3zYFfCGUXZGL5UDxt5eyLE7wgw== + +"@types/stack-utils@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e" + integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw== + +"@types/yargs@^12.0.2", "@types/yargs@^12.0.9": + version "12.0.12" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-12.0.12.tgz#45dd1d0638e8c8f153e87d296907659296873916" + integrity sha512-SOhuU4wNBxhhTHxYaiG5NY4HBhDIDnJF60GU+2LqHAdKKer86//e4yg69aENCtQ04n0ovz+tq2YPME5t5yp4pw== + +abab@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.0.tgz#aba0ab4c5eee2d4c79d3487d85450fb2376ebb0f" + integrity sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w== + +abbrev@1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" + integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== + +acorn-globals@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.0.tgz#e3b6f8da3c1552a95ae627571f7dd6923bb54103" + integrity sha512-hMtHj3s5RnuhvHPowpBYvJVj3rAar82JiDQHvGs1zO0l10ocX/xEdBShNHTJaboucJUsScghp74pH3s7EnHHQw== + dependencies: + acorn "^6.0.1" + acorn-walk "^6.0.1" + +acorn-walk@^6.0.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.1.1.tgz#d363b66f5fac5f018ff9c3a1e7b6f8e310cc3913" + integrity sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw== + +acorn@^5.5.3: + version "5.7.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" + integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== + +acorn@^6.0.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.1.1.tgz#7d25ae05bb8ad1f9b699108e1094ecd7884adc1f" + integrity sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA== + +airbnb-prop-types@^2.13.2: + version "2.13.2" + resolved "https://registry.yarnpkg.com/airbnb-prop-types/-/airbnb-prop-types-2.13.2.tgz#43147a5062dd2a4a5600e748a47b64004cc5f7fc" + integrity sha512-2FN6DlHr6JCSxPPi25EnqGaXC4OC3/B3k1lCd6MMYrZ51/Gf/1qDfaR+JElzWa+Tl7cY2aYOlsYJGFeQyVHIeQ== + dependencies: + array.prototype.find "^2.0.4" + function.prototype.name "^1.1.0" + has "^1.0.3" + is-regex "^1.0.4" + object-is "^1.0.1" + object.assign "^4.1.0" + object.entries "^1.1.0" + prop-types "^15.7.2" + prop-types-exact "^1.2.0" + react-is "^16.8.6" + +ajv@^6.5.5: + version "6.10.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.0.tgz#90d0d54439da587cd7e843bfb7045f50bd22bdf1" + integrity sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg== + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ansi-escapes@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" + integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + +ansi-regex@^4.0.0, ansi-regex@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" + integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== + +ansi-styles@^3.2.0, ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +anymatch@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb" + integrity sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw== + dependencies: + micromatch "^3.1.4" + normalize-path "^2.1.1" + +aproba@^1.0.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" + integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw== + +are-we-there-yet@~1.1.2: + version "1.1.5" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" + integrity sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w== + dependencies: + delegates "^1.0.0" + readable-stream "^2.0.6" + +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= + +arr-flatten@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== + +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= + +array-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" + integrity sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM= + +array-filter@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-1.0.0.tgz#baf79e62e6ef4c2a4c0b831232daffec251f9d83" + integrity sha1-uveeYubvTCpMC4MSMtr/7CUfnYM= + +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= + +array.prototype.find@^2.0.4: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array.prototype.find/-/array.prototype.find-2.1.0.tgz#630f2eaf70a39e608ac3573e45cf8ccd0ede9ad7" + integrity sha512-Wn41+K1yuO5p7wRZDl7890c3xvv5UBrfVXTVIe28rSQb6LS0fZMDrQB6PAcxQFRFy6vJTLDc3A2+3CjQdzVKRg== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.13.0" + +array.prototype.flat@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.1.tgz#812db8f02cad24d3fab65dd67eabe3b8903494a4" + integrity sha512-rVqIs330nLJvfC7JqYvEWwqVr5QjYF1ib02i3YJtR/fICO6527Tjpc/e4Mvmxh3GIePPreRXMdaGyC99YphWEw== + dependencies: + define-properties "^1.1.2" + es-abstract "^1.10.0" + function-bind "^1.1.1" + +asap@~2.0.3: + version "2.0.6" + resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" + integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY= + +asn1@~0.2.3: + version "0.2.4" + resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" + integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== + dependencies: + safer-buffer "~2.1.0" + +assert-plus@1.0.0, assert-plus@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" + integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= + +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= + +astral-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" + integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== + +async-limiter@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" + integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= + +atob@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== + +aws-sign2@~0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" + integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= + +aws4@^1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" + integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== + +babel-jest@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.8.0.tgz#5c15ff2b28e20b0f45df43fe6b7f2aae93dba589" + integrity sha512-+5/kaZt4I9efoXzPlZASyK/lN9qdRKmmUav9smVc0ruPQD7IsfucQ87gpOE8mn2jbDuS6M/YOW6n3v9ZoIfgnw== + dependencies: + "@jest/transform" "^24.8.0" + "@jest/types" "^24.8.0" + "@types/babel__core" "^7.1.0" + babel-plugin-istanbul "^5.1.0" + babel-preset-jest "^24.6.0" + chalk "^2.4.2" + slash "^2.0.0" + +babel-plugin-istanbul@^5.1.0: + version "5.1.4" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.4.tgz#841d16b9a58eeb407a0ddce622ba02fe87a752ba" + integrity sha512-dySz4VJMH+dpndj0wjJ8JPs/7i1TdSPb1nRrn56/92pKOF9VKC1FMFJmMXjzlGGusnCAqujP6PBCiKq0sVA+YQ== + dependencies: + find-up "^3.0.0" + istanbul-lib-instrument "^3.3.0" + test-exclude "^5.2.3" + +babel-plugin-jest-hoist@^24.6.0: + version "24.6.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.6.0.tgz#f7f7f7ad150ee96d7a5e8e2c5da8319579e78019" + integrity sha512-3pKNH6hMt9SbOv0F3WVmy5CWQ4uogS3k0GY5XLyQHJ9EGpAT9XWkFd2ZiXXtkwFHdAHa5j7w7kfxSP5lAIwu7w== + dependencies: + "@types/babel__traverse" "^7.0.6" + +babel-preset-jest@^24.6.0: + version "24.6.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-24.6.0.tgz#66f06136eefce87797539c0d63f1769cc3915984" + integrity sha512-pdZqLEdmy1ZK5kyRUfvBb2IfTPb2BUvIJczlPspS8fWmBQslNNDBqVfh7BW5leOVJMDZKzjD8XEyABTk6gQ5yw== + dependencies: + "@babel/plugin-syntax-object-rest-spread" "^7.0.0" + babel-plugin-jest-hoist "^24.6.0" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +base@^0.11.1: + version "0.11.2" + resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== + dependencies: + cache-base "^1.0.1" + class-utils "^0.3.5" + component-emitter "^1.2.1" + define-property "^1.0.0" + isobject "^3.0.1" + mixin-deep "^1.2.0" + pascalcase "^0.1.1" + +bcrypt-pbkdf@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" + integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= + dependencies: + tweetnacl "^0.14.3" + +boolbase@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" + integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== + dependencies: + arr-flatten "^1.1.0" + array-unique "^0.3.2" + extend-shallow "^2.0.1" + fill-range "^4.0.0" + isobject "^3.0.1" + repeat-element "^1.1.2" + snapdragon "^0.8.1" + snapdragon-node "^2.0.1" + split-string "^3.0.2" + to-regex "^3.0.1" + +browser-process-hrtime@^0.1.2: + version "0.1.3" + resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz#616f00faef1df7ec1b5bf9cfe2bdc3170f26c7b4" + integrity sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw== + +browser-resolve@^1.11.3: + version "1.11.3" + resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6" + integrity sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ== + dependencies: + resolve "1.1.7" + +bser@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" + integrity sha1-mseNPtXZFYBP2HrLFYvHlxR6Fxk= + dependencies: + node-int64 "^0.4.0" + +buffer-from@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" + integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== + +cache-base@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== + dependencies: + collection-visit "^1.0.0" + component-emitter "^1.2.1" + get-value "^2.0.6" + has-value "^1.0.0" + isobject "^3.0.1" + set-value "^2.0.0" + to-object-path "^0.3.0" + union-value "^1.0.0" + unset-value "^1.0.0" + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + +camelcase@^5.0.0: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + +capture-exit@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/capture-exit/-/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4" + integrity sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g== + dependencies: + rsvp "^4.8.4" + +caseless@~0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" + integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= + +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +cheerio@^1.0.0-rc.2: + version "1.0.0-rc.3" + resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-1.0.0-rc.3.tgz#094636d425b2e9c0f4eb91a46c05630c9a1a8bf6" + integrity sha512-0td5ijfUPuubwLUu0OBoe98gZj8C/AA+RW3v67GPlGOrvxWjZmBXiBCRU+I8VEiNyJzjth40POfHiz2RB3gImA== + dependencies: + css-select "~1.2.0" + dom-serializer "~0.1.1" + entities "~1.1.1" + htmlparser2 "^3.9.1" + lodash "^4.15.0" + parse5 "^3.0.1" + +chownr@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.1.tgz#54726b8b8fff4df053c42187e801fb4412df1494" + integrity sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g== + +ci-info@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" + integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== + +class-utils@^0.3.5: + version "0.3.6" + resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== + dependencies: + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + static-extend "^0.1.1" + +cliui@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.1.0.tgz#348422dbe82d800b3022eef4f6ac10bf2e4d1b49" + integrity sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ== + dependencies: + string-width "^2.1.1" + strip-ansi "^4.0.0" + wrap-ansi "^2.0.0" + +co@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" + integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= + +code-point-at@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" + integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c= + +collection-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= + dependencies: + map-visit "^1.0.0" + object-visit "^1.0.0" + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + +combined-stream@^1.0.6, combined-stream@~1.0.6: + version "1.0.7" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.7.tgz#2d1d24317afb8abe95d6d2c0b07b57813539d828" + integrity sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w== + dependencies: + delayed-stream "~1.0.0" + +commander@^2.19.0: + version "2.20.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422" + integrity sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ== + +commander@~2.19.0: + version "2.19.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" + integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg== + +component-emitter@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.2.1.tgz#137918d6d78283f7df7a6b7c5a63e140e69425e6" + integrity sha1-E3kY1teCg/ffemt8WmPhQOaUJeY= + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +console-control-strings@^1.0.0, console-control-strings@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= + +convert-source-map@^1.1.0, convert-source-map@^1.4.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20" + integrity sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A== + dependencies: + safe-buffer "~5.1.1" + +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= + +core-js@^1.0.0: + version "1.2.7" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" + integrity sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY= + +core-util-is@1.0.2, core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + +cross-spawn@^6.0.0: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + +css-select@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858" + integrity sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg= + dependencies: + boolbase "~1.0.0" + css-what "2.1" + domutils "1.5.1" + nth-check "~1.0.1" + +css-what@2.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.3.tgz#a6d7604573365fe74686c3f311c56513d88285f2" + integrity sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg== + +cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": + version "0.3.6" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.6.tgz#f85206cee04efa841f3c5982a74ba96ab20d65ad" + integrity sha512-DtUeseGk9/GBW0hl0vVPpU22iHL6YB5BUX7ml1hB+GMpo0NX5G4voX3kdWiMSEguFtcW3Vh3djqNF4aIe6ne0A== + +cssstyle@^1.0.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-1.2.1.tgz#3aceb2759eaf514ac1a21628d723d6043a819495" + integrity sha512-7DYm8qe+gPx/h77QlCyFmX80+fGaE/6A/Ekl0zaszYOubvySO2saYFdQ78P29D0UsULxFKCetDGNaNRUdSF+2A== + dependencies: + cssom "0.3.x" + +dashdash@^1.12.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" + integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= + dependencies: + assert-plus "^1.0.0" + +data-urls@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.1.0.tgz#15ee0582baa5e22bb59c77140da8f9c76963bbfe" + integrity sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ== + dependencies: + abab "^2.0.0" + whatwg-mimetype "^2.2.0" + whatwg-url "^7.0.0" + +debug@^2.1.2, debug@^2.2.0, debug@^2.3.3: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +debug@^4.1.0, debug@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== + dependencies: + ms "^2.1.1" + +decamelize@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= + +decode-uri-component@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= + +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= + +define-properties@^1.1.2, define-properties@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" + integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== + dependencies: + object-keys "^1.0.12" + +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= + dependencies: + is-descriptor "^1.0.0" + +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= + +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= + +detect-libc@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= + +detect-newline@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" + integrity sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I= + +diff-sequences@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-24.3.0.tgz#0f20e8a1df1abddaf4d9c226680952e64118b975" + integrity sha512-xLqpez+Zj9GKSnPWS0WZw1igGocZ+uua8+y+5dDNTT934N3QuY1sp2LkHzwiaYQGz60hMq0pjAshdeXm5VUOEw== + +discontinuous-range@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/discontinuous-range/-/discontinuous-range-1.0.0.tgz#e38331f0844bba49b9a9cb71c771585aab1bc65a" + integrity sha1-44Mx8IRLukm5qctxx3FYWqsbxlo= + +dom-serializer@0, dom-serializer@~0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.1.tgz#1ec4059e284babed36eec2941d4a970a189ce7c0" + integrity sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA== + dependencies: + domelementtype "^1.3.0" + entities "^1.1.1" + +domelementtype@1, domelementtype@^1.3.0, domelementtype@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f" + integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w== + +domexception@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" + integrity sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug== + dependencies: + webidl-conversions "^4.0.2" + +domhandler@^2.3.0: + version "2.4.2" + resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803" + integrity sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA== + dependencies: + domelementtype "1" + +domutils@1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf" + integrity sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8= + dependencies: + dom-serializer "0" + domelementtype "1" + +domutils@^1.5.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a" + integrity sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg== + dependencies: + dom-serializer "0" + domelementtype "1" + +ecc-jsbn@~0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" + integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= + dependencies: + jsbn "~0.1.0" + safer-buffer "^2.1.0" + +encoding@^0.1.11: + version "0.1.12" + resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" + integrity sha1-U4tm8+5izRq1HsMjgp0flIDHS+s= + dependencies: + iconv-lite "~0.4.13" + +end-of-stream@^1.1.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" + integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q== + dependencies: + once "^1.4.0" + +entities@^1.1.1, entities@~1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56" + integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w== + +enzyme-adapter-react-16@^1.13.2: + version "1.13.2" + resolved "https://registry.yarnpkg.com/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.13.2.tgz#8a574d7cbbef7ef0cab2022e9bfc12aeaebb7ae5" + integrity sha512-h0neTuAAFfQUgEZ+PPHVIMDFJ9+CGafI8AjojNlSVh4Fd1pLDgtl2OeVkm4yKF7RSgzrPAwugq4JW8Jjo2iRJA== + dependencies: + enzyme-adapter-utils "^1.12.0" + has "^1.0.3" + object.assign "^4.1.0" + object.values "^1.1.0" + prop-types "^15.7.2" + react-is "^16.8.6" + react-test-renderer "^16.0.0-0" + semver "^5.7.0" + +enzyme-adapter-utils@^1.12.0: + version "1.12.0" + resolved "https://registry.yarnpkg.com/enzyme-adapter-utils/-/enzyme-adapter-utils-1.12.0.tgz#96e3730d76b872f593e54ce1c51fa3a451422d93" + integrity sha512-wkZvE0VxcFx/8ZsBw0iAbk3gR1d9hK447ebnSYBf95+r32ezBq+XDSAvRErkc4LZosgH8J7et7H7/7CtUuQfBA== + dependencies: + airbnb-prop-types "^2.13.2" + function.prototype.name "^1.1.0" + object.assign "^4.1.0" + object.fromentries "^2.0.0" + prop-types "^15.7.2" + semver "^5.6.0" + +enzyme-to-json@^3.3.5: + version "3.3.5" + resolved "https://registry.yarnpkg.com/enzyme-to-json/-/enzyme-to-json-3.3.5.tgz#f8eb82bd3d5941c9d8bc6fd9140030777d17d0af" + integrity sha512-DmH1wJ68HyPqKSYXdQqB33ZotwfUhwQZW3IGXaNXgR69Iodaoj8TF/D9RjLdz4pEhGq2Tx2zwNUIjBuqoZeTgA== + dependencies: + lodash "^4.17.4" + +enzyme@^3.9.0: + version "3.9.0" + resolved "https://registry.yarnpkg.com/enzyme/-/enzyme-3.9.0.tgz#2b491f06ca966eb56b6510068c7894a7e0be3909" + integrity sha512-JqxI2BRFHbmiP7/UFqvsjxTirWoM1HfeaJrmVSZ9a1EADKkZgdPcAuISPMpoUiHlac9J4dYt81MC5BBIrbJGMg== + dependencies: + array.prototype.flat "^1.2.1" + cheerio "^1.0.0-rc.2" + function.prototype.name "^1.1.0" + has "^1.0.3" + html-element-map "^1.0.0" + is-boolean-object "^1.0.0" + is-callable "^1.1.4" + is-number-object "^1.0.3" + is-regex "^1.0.4" + is-string "^1.0.4" + is-subset "^0.1.1" + lodash.escape "^4.0.1" + lodash.isequal "^4.5.0" + object-inspect "^1.6.0" + object-is "^1.0.1" + object.assign "^4.1.0" + object.entries "^1.0.4" + object.values "^1.0.4" + raf "^3.4.0" + rst-selector-parser "^2.2.3" + string.prototype.trim "^1.1.2" + +error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + +es-abstract@^1.10.0, es-abstract@^1.11.0, es-abstract@^1.12.0, es-abstract@^1.13.0, es-abstract@^1.5.0, es-abstract@^1.5.1: + version "1.13.0" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9" + integrity sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg== + dependencies: + es-to-primitive "^1.2.0" + function-bind "^1.1.1" + has "^1.0.3" + is-callable "^1.1.4" + is-regex "^1.0.4" + object-keys "^1.0.12" + +es-to-primitive@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" + integrity sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + +escodegen@^1.9.1: + version "1.11.1" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.11.1.tgz#c485ff8d6b4cdb89e27f4a856e91f118401ca510" + integrity sha512-JwiqFD9KdGVVpeuRa68yU3zZnBEOcPs0nKW7wZzXky8Z7tffdYUHbe11bPCV5jYlK6DVdKLWLm0f5I/QlL0Kmw== + dependencies: + esprima "^3.1.3" + estraverse "^4.2.0" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.6.1" + +esprima@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" + integrity sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM= + +estraverse@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" + integrity sha1-De4/7TH81GlhjOc0IJn8GvoL2xM= + +esutils@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" + integrity sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs= + +exec-sh@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.3.2.tgz#6738de2eb7c8e671d0366aea0b0db8c6f7d7391b" + integrity sha512-9sLAvzhI5nc8TpuQUh4ahMdCrWT00wPWz7j47/emR5+2qEfoZP5zzUXvx+vdx+H6ohhnsYC31iX04QLYJK8zTg== + +execa@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" + integrity sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA== + dependencies: + cross-spawn "^6.0.0" + get-stream "^4.0.0" + is-stream "^1.1.0" + npm-run-path "^2.0.0" + p-finally "^1.0.0" + signal-exit "^3.0.0" + strip-eof "^1.0.0" + +exit@^0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" + integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= + +expand-brackets@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= + dependencies: + debug "^2.3.3" + define-property "^0.2.5" + extend-shallow "^2.0.1" + posix-character-classes "^0.1.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +expect@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/expect/-/expect-24.8.0.tgz#471f8ec256b7b6129ca2524b2a62f030df38718d" + integrity sha512-/zYvP8iMDrzaaxHVa724eJBCKqSHmO0FA7EDkBiRHxg6OipmMn1fN+C8T9L9K8yr7UONkOifu6+LLH+z76CnaA== + dependencies: + "@jest/types" "^24.8.0" + ansi-styles "^3.2.0" + jest-get-type "^24.8.0" + jest-matcher-utils "^24.8.0" + jest-message-util "^24.8.0" + jest-regex-util "^24.3.0" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= + dependencies: + is-extendable "^0.1.0" + +extend-shallow@^3.0.0, extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + +extend@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== + dependencies: + array-unique "^0.3.2" + define-property "^1.0.0" + expand-brackets "^2.1.4" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +extsprintf@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= + +extsprintf@^1.2.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" + integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= + +fast-deep-equal@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" + integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= + +fast-json-stable-stringify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= + +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= + +fb-watchman@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" + integrity sha1-VOmr99+i8mzZsWNsWIwa/AXeXVg= + dependencies: + bser "^2.0.0" + +fbjs@^0.8.16: + version "0.8.17" + resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd" + integrity sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90= + dependencies: + core-js "^1.0.0" + isomorphic-fetch "^2.1.1" + loose-envify "^1.0.0" + object-assign "^4.1.0" + promise "^7.1.1" + setimmediate "^1.0.5" + ua-parser-js "^0.7.18" + +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + +find-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" + integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== + dependencies: + locate-path "^3.0.0" + +for-in@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= + +forever-agent@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" + integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= + +form-data@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" + integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.6" + mime-types "^2.1.12" + +fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= + dependencies: + map-cache "^0.2.2" + +fs-minipass@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.5.tgz#06c277218454ec288df77ada54a03b8702aacb9d" + integrity sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ== + dependencies: + minipass "^2.2.1" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +fsevents@^1.2.7: + version "1.2.9" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.9.tgz#3f5ed66583ccd6f400b5a00db6f7e861363e388f" + integrity sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw== + dependencies: + nan "^2.12.1" + node-pre-gyp "^0.12.0" + +function-bind@^1.0.2, function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +function.prototype.name@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.0.tgz#8bd763cc0af860a859cc5d49384d74b932cd2327" + integrity sha512-Bs0VRrTz4ghD8pTmbJQD1mZ8A/mN0ur/jGz+A6FBxPDUPkm1tNfF6bhTYPA7i7aF4lZJVr+OXTNNrnnIl58Wfg== + dependencies: + define-properties "^1.1.2" + function-bind "^1.1.1" + is-callable "^1.1.3" + +gauge@~2.7.3: + version "2.7.4" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c= + dependencies: + aproba "^1.0.3" + console-control-strings "^1.0.0" + has-unicode "^2.0.0" + object-assign "^4.1.0" + signal-exit "^3.0.0" + string-width "^1.0.1" + strip-ansi "^3.0.1" + wide-align "^1.1.0" + +get-caller-file@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.3.tgz#f978fa4c90d1dfe7ff2d6beda2a515e713bdcf4a" + integrity sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w== + +get-stream@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" + integrity sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w== + dependencies: + pump "^3.0.0" + +get-value@^2.0.3, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= + +getpass@^0.1.1: + version "0.1.7" + resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" + integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= + dependencies: + assert-plus "^1.0.0" + +glob@^7.1.1, glob@^7.1.2, glob@^7.1.3: + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^11.1.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + +graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2: + version "4.1.15" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" + integrity sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA== + +growly@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" + integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= + +handlebars@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.1.2.tgz#b6b37c1ced0306b221e094fc7aca3ec23b131b67" + integrity sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw== + dependencies: + neo-async "^2.6.0" + optimist "^0.6.1" + source-map "^0.6.1" + optionalDependencies: + uglify-js "^3.1.4" + +har-schema@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" + integrity sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI= + +har-validator@~5.1.0: + version "5.1.3" + resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080" + integrity sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g== + dependencies: + ajv "^6.5.5" + har-schema "^2.0.0" + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + +has-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" + integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= + +has-unicode@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk= + +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= + dependencies: + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= + dependencies: + get-value "^2.0.6" + has-values "^1.0.0" + isobject "^3.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= + +has-values@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +has@^1.0.1, has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + +hosted-git-info@^2.1.4: + version "2.7.1" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047" + integrity sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w== + +html-element-map@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/html-element-map/-/html-element-map-1.0.1.tgz#3c4fcb4874ebddfe4283b51c8994e7713782b592" + integrity sha512-BZSfdEm6n706/lBfXKWa4frZRZcT5k1cOusw95ijZsHlI+GdgY0v95h6IzO3iIDf2ROwq570YTwqNPqHcNMozw== + dependencies: + array-filter "^1.0.0" + +html-encoding-sniffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" + integrity sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw== + dependencies: + whatwg-encoding "^1.0.1" + +htmlparser2@^3.9.1: + version "3.10.1" + resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f" + integrity sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ== + dependencies: + domelementtype "^1.3.1" + domhandler "^2.3.0" + domutils "^1.5.1" + entities "^1.1.1" + inherits "^2.0.1" + readable-stream "^3.1.1" + +http-signature@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" + integrity sha1-muzZJRFHcvPZW2WmCruPfBj7rOE= + dependencies: + assert-plus "^1.0.0" + jsprim "^1.2.2" + sshpk "^1.7.0" + +iconv-lite@0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +ignore-walk@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.1.tgz#a83e62e7d272ac0e3b551aaa82831a19b69f82f8" + integrity sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ== + dependencies: + minimatch "^3.0.4" + +import-local@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-2.0.0.tgz#55070be38a5993cf18ef6db7e961f5bee5c5a09d" + integrity sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ== + dependencies: + pkg-dir "^3.0.0" + resolve-cwd "^2.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + +ini@~1.3.0: + version "1.3.5" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" + integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== + +invariant@^2.2.4: + version "2.2.4" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== + dependencies: + loose-envify "^1.0.0" + +invert-kv@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-2.0.0.tgz#7393f5afa59ec9ff5f67a27620d11c226e3eec02" + integrity sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA== + +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= + dependencies: + kind-of "^3.0.2" + +is-accessor-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== + dependencies: + kind-of "^6.0.0" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= + +is-boolean-object@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.0.0.tgz#98f8b28030684219a95f375cfbd88ce3405dff93" + integrity sha1-mPiygDBoQhmpXzdc+9iM40Bd/5M= + +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== + +is-callable@^1.1.3, is-callable@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" + integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== + +is-ci@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" + integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== + dependencies: + ci-info "^2.0.0" + +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= + dependencies: + kind-of "^3.0.2" + +is-data-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== + dependencies: + kind-of "^6.0.0" + +is-date-object@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" + integrity sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY= + +is-descriptor@^0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^5.0.0" + +is-descriptor@^1.0.0, is-descriptor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== + dependencies: + is-accessor-descriptor "^1.0.0" + is-data-descriptor "^1.0.0" + kind-of "^6.0.2" + +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= + +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== + dependencies: + is-plain-object "^2.0.4" + +is-fullwidth-code-point@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" + integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs= + dependencies: + number-is-nan "^1.0.0" + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + +is-generator-fn@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" + integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== + +is-number-object@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.3.tgz#f265ab89a9f445034ef6aff15a8f00b00f551799" + integrity sha1-8mWrian0RQNO9q/xWo8AsA9VF5k= + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= + dependencies: + kind-of "^3.0.2" + +is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== + dependencies: + isobject "^3.0.1" + +is-regex@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" + integrity sha1-VRdIm1RwkbCTDglWVM7SXul+lJE= + dependencies: + has "^1.0.1" + +is-stream@^1.0.1, is-stream@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" + integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= + +is-string@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.4.tgz#cc3a9b69857d621e963725a24caeec873b826e64" + integrity sha1-zDqbaYV9Yh6WNyWiTK7shzuCbmQ= + +is-subset@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-subset/-/is-subset-0.1.1.tgz#8a59117d932de1de00f245fcdd39ce43f1e939a6" + integrity sha1-ilkRfZMt4d4A8kX83TnOQ/HpOaY= + +is-symbol@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" + integrity sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw== + dependencies: + has-symbols "^1.0.0" + +is-typedarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" + integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= + +is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== + +is-wsl@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" + integrity sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0= + +isarray@1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= + dependencies: + isarray "1.0.0" + +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= + +isomorphic-fetch@^2.1.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" + integrity sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk= + dependencies: + node-fetch "^1.0.1" + whatwg-fetch ">=0.10.0" + +isstream@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" + integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= + +istanbul-lib-coverage@^2.0.2, istanbul-lib-coverage@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz#675f0ab69503fad4b1d849f736baaca803344f49" + integrity sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA== + +istanbul-lib-instrument@^3.0.1, istanbul-lib-instrument@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz#a5f63d91f0bbc0c3e479ef4c5de027335ec6d630" + integrity sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA== + dependencies: + "@babel/generator" "^7.4.0" + "@babel/parser" "^7.4.3" + "@babel/template" "^7.4.0" + "@babel/traverse" "^7.4.3" + "@babel/types" "^7.4.0" + istanbul-lib-coverage "^2.0.5" + semver "^6.0.0" + +istanbul-lib-report@^2.0.4: + version "2.0.8" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz#5a8113cd746d43c4889eba36ab10e7d50c9b4f33" + integrity sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ== + dependencies: + istanbul-lib-coverage "^2.0.5" + make-dir "^2.1.0" + supports-color "^6.1.0" + +istanbul-lib-source-maps@^3.0.1: + version "3.0.6" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz#284997c48211752ec486253da97e3879defba8c8" + integrity sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw== + dependencies: + debug "^4.1.1" + istanbul-lib-coverage "^2.0.5" + make-dir "^2.1.0" + rimraf "^2.6.3" + source-map "^0.6.1" + +istanbul-reports@^2.1.1: + version "2.2.6" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-2.2.6.tgz#7b4f2660d82b29303a8fe6091f8ca4bf058da1af" + integrity sha512-SKi4rnMyLBKe0Jy2uUdx28h8oG7ph2PPuQPvIAh31d+Ci+lSiEu4C+h3oBPuJ9+mPKhOyW0M8gY4U5NM1WLeXA== + dependencies: + handlebars "^4.1.2" + +jest-changed-files@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-24.8.0.tgz#7e7eb21cf687587a85e50f3d249d1327e15b157b" + integrity sha512-qgANC1Yrivsq+UrLXsvJefBKVoCsKB0Hv+mBb6NMjjZ90wwxCDmU3hsCXBya30cH+LnPYjwgcU65i6yJ5Nfuug== + dependencies: + "@jest/types" "^24.8.0" + execa "^1.0.0" + throat "^4.0.0" + +jest-cli@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-24.8.0.tgz#b075ac914492ed114fa338ade7362a301693e989" + integrity sha512-+p6J00jSMPQ116ZLlHJJvdf8wbjNbZdeSX9ptfHX06/MSNaXmKihQzx5vQcw0q2G6JsdVkUIdWbOWtSnaYs3yA== + dependencies: + "@jest/core" "^24.8.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" + chalk "^2.0.1" + exit "^0.1.2" + import-local "^2.0.0" + is-ci "^2.0.0" + jest-config "^24.8.0" + jest-util "^24.8.0" + jest-validate "^24.8.0" + prompts "^2.0.1" + realpath-native "^1.1.0" + yargs "^12.0.2" + +jest-config@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-24.8.0.tgz#77db3d265a6f726294687cbbccc36f8a76ee0f4f" + integrity sha512-Czl3Nn2uEzVGsOeaewGWoDPD8GStxCpAe0zOYs2x2l0fZAgPbCr3uwUkgNKV3LwE13VXythM946cd5rdGkkBZw== + dependencies: + "@babel/core" "^7.1.0" + "@jest/test-sequencer" "^24.8.0" + "@jest/types" "^24.8.0" + babel-jest "^24.8.0" + chalk "^2.0.1" + glob "^7.1.1" + jest-environment-jsdom "^24.8.0" + jest-environment-node "^24.8.0" + jest-get-type "^24.8.0" + jest-jasmine2 "^24.8.0" + jest-regex-util "^24.3.0" + jest-resolve "^24.8.0" + jest-util "^24.8.0" + jest-validate "^24.8.0" + micromatch "^3.1.10" + pretty-format "^24.8.0" + realpath-native "^1.1.0" + +jest-diff@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.8.0.tgz#146435e7d1e3ffdf293d53ff97e193f1d1546172" + integrity sha512-wxetCEl49zUpJ/bvUmIFjd/o52J+yWcoc5ZyPq4/W1LUKGEhRYDIbP1KcF6t+PvqNrGAFk4/JhtxDq/Nnzs66g== + dependencies: + chalk "^2.0.1" + diff-sequences "^24.3.0" + jest-get-type "^24.8.0" + pretty-format "^24.8.0" + +jest-docblock@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-24.3.0.tgz#b9c32dac70f72e4464520d2ba4aec02ab14db5dd" + integrity sha512-nlANmF9Yq1dufhFlKG9rasfQlrY7wINJbo3q01tu56Jv5eBU5jirylhF2O5ZBnLxzOVBGRDz/9NAwNyBtG4Nyg== + dependencies: + detect-newline "^2.1.0" + +jest-each@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-24.8.0.tgz#a05fd2bf94ddc0b1da66c6d13ec2457f35e52775" + integrity sha512-NrwK9gaL5+XgrgoCsd9svsoWdVkK4gnvyhcpzd6m487tXHqIdYeykgq3MKI1u4I+5Zf0tofr70at9dWJDeb+BA== + dependencies: + "@jest/types" "^24.8.0" + chalk "^2.0.1" + jest-get-type "^24.8.0" + jest-util "^24.8.0" + pretty-format "^24.8.0" + +jest-environment-jsdom@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-24.8.0.tgz#300f6949a146cabe1c9357ad9e9ecf9f43f38857" + integrity sha512-qbvgLmR7PpwjoFjM/sbuqHJt/NCkviuq9vus9NBn/76hhSidO+Z6Bn9tU8friecegbJL8gzZQEMZBQlFWDCwAQ== + dependencies: + "@jest/environment" "^24.8.0" + "@jest/fake-timers" "^24.8.0" + "@jest/types" "^24.8.0" + jest-mock "^24.8.0" + jest-util "^24.8.0" + jsdom "^11.5.1" + +jest-environment-node@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-24.8.0.tgz#d3f726ba8bc53087a60e7a84ca08883a4c892231" + integrity sha512-vIGUEScd1cdDgR6sqn2M08sJTRLQp6Dk/eIkCeO4PFHxZMOgy+uYLPMC4ix3PEfM5Au/x3uQ/5Tl0DpXXZsJ/Q== + dependencies: + "@jest/environment" "^24.8.0" + "@jest/fake-timers" "^24.8.0" + "@jest/types" "^24.8.0" + jest-mock "^24.8.0" + jest-util "^24.8.0" + +jest-get-type@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-24.8.0.tgz#a7440de30b651f5a70ea3ed7ff073a32dfe646fc" + integrity sha512-RR4fo8jEmMD9zSz2nLbs2j0zvPpk/KCEz3a62jJWbd2ayNo0cb+KFRxPHVhE4ZmgGJEQp0fosmNz84IfqM8cMQ== + +jest-haste-map@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-24.8.0.tgz#51794182d877b3ddfd6e6d23920e3fe72f305800" + integrity sha512-ZBPRGHdPt1rHajWelXdqygIDpJx8u3xOoLyUBWRW28r3tagrgoepPrzAozW7kW9HrQfhvmiv1tncsxqHJO1onQ== + dependencies: + "@jest/types" "^24.8.0" + anymatch "^2.0.0" + fb-watchman "^2.0.0" + graceful-fs "^4.1.15" + invariant "^2.2.4" + jest-serializer "^24.4.0" + jest-util "^24.8.0" + jest-worker "^24.6.0" + micromatch "^3.1.10" + sane "^4.0.3" + walker "^1.0.7" + optionalDependencies: + fsevents "^1.2.7" + +jest-jasmine2@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-24.8.0.tgz#a9c7e14c83dd77d8b15e820549ce8987cc8cd898" + integrity sha512-cEky88npEE5LKd5jPpTdDCLvKkdyklnaRycBXL6GNmpxe41F0WN44+i7lpQKa/hcbXaQ+rc9RMaM4dsebrYong== + dependencies: + "@babel/traverse" "^7.1.0" + "@jest/environment" "^24.8.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" + chalk "^2.0.1" + co "^4.6.0" + expect "^24.8.0" + is-generator-fn "^2.0.0" + jest-each "^24.8.0" + jest-matcher-utils "^24.8.0" + jest-message-util "^24.8.0" + jest-runtime "^24.8.0" + jest-snapshot "^24.8.0" + jest-util "^24.8.0" + pretty-format "^24.8.0" + throat "^4.0.0" + +jest-leak-detector@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-24.8.0.tgz#c0086384e1f650c2d8348095df769f29b48e6980" + integrity sha512-cG0yRSK8A831LN8lIHxI3AblB40uhv0z+SsQdW3GoMMVcK+sJwrIIyax5tu3eHHNJ8Fu6IMDpnLda2jhn2pD/g== + dependencies: + pretty-format "^24.8.0" + +jest-matcher-utils@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-24.8.0.tgz#2bce42204c9af12bde46f83dc839efe8be832495" + integrity sha512-lex1yASY51FvUuHgm0GOVj7DCYEouWSlIYmCW7APSqB9v8mXmKSn5+sWVF0MhuASG0bnYY106/49JU1FZNl5hw== + dependencies: + chalk "^2.0.1" + jest-diff "^24.8.0" + jest-get-type "^24.8.0" + pretty-format "^24.8.0" + +jest-message-util@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-24.8.0.tgz#0d6891e72a4beacc0292b638685df42e28d6218b" + integrity sha512-p2k71rf/b6ns8btdB0uVdljWo9h0ovpnEe05ZKWceQGfXYr4KkzgKo3PBi8wdnd9OtNh46VpNIJynUn/3MKm1g== + dependencies: + "@babel/code-frame" "^7.0.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" + "@types/stack-utils" "^1.0.1" + chalk "^2.0.1" + micromatch "^3.1.10" + slash "^2.0.0" + stack-utils "^1.0.1" + +jest-mock@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-24.8.0.tgz#2f9d14d37699e863f1febf4e4d5a33b7fdbbde56" + integrity sha512-6kWugwjGjJw+ZkK4mDa0Df3sDlUTsV47MSrT0nGQ0RBWJbpODDQ8MHDVtGtUYBne3IwZUhtB7elxHspU79WH3A== + dependencies: + "@jest/types" "^24.8.0" + +jest-pnp-resolver@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz#ecdae604c077a7fbc70defb6d517c3c1c898923a" + integrity sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ== + +jest-regex-util@^24.3.0: + version "24.3.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-24.3.0.tgz#d5a65f60be1ae3e310d5214a0307581995227b36" + integrity sha512-tXQR1NEOyGlfylyEjg1ImtScwMq8Oh3iJbGTjN7p0J23EuVX1MA8rwU69K4sLbCmwzgCUbVkm0FkSF9TdzOhtg== + +jest-resolve-dependencies@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-24.8.0.tgz#19eec3241f2045d3f990dba331d0d7526acff8e0" + integrity sha512-hyK1qfIf/krV+fSNyhyJeq3elVMhK9Eijlwy+j5jqmZ9QsxwKBiP6qukQxaHtK8k6zql/KYWwCTQ+fDGTIJauw== + dependencies: + "@jest/types" "^24.8.0" + jest-regex-util "^24.3.0" + jest-snapshot "^24.8.0" + +jest-resolve@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-24.8.0.tgz#84b8e5408c1f6a11539793e2b5feb1b6e722439f" + integrity sha512-+hjSzi1PoRvnuOICoYd5V/KpIQmkAsfjFO71458hQ2Whi/yf1GDeBOFj8Gxw4LrApHsVJvn5fmjcPdmoUHaVKw== + dependencies: + "@jest/types" "^24.8.0" + browser-resolve "^1.11.3" + chalk "^2.0.1" + jest-pnp-resolver "^1.2.1" + realpath-native "^1.1.0" + +jest-runner@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-24.8.0.tgz#4f9ae07b767db27b740d7deffad0cf67ccb4c5bb" + integrity sha512-utFqC5BaA3JmznbissSs95X1ZF+d+4WuOWwpM9+Ak356YtMhHE/GXUondZdcyAAOTBEsRGAgH/0TwLzfI9h7ow== + dependencies: + "@jest/console" "^24.7.1" + "@jest/environment" "^24.8.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" + chalk "^2.4.2" + exit "^0.1.2" + graceful-fs "^4.1.15" + jest-config "^24.8.0" + jest-docblock "^24.3.0" + jest-haste-map "^24.8.0" + jest-jasmine2 "^24.8.0" + jest-leak-detector "^24.8.0" + jest-message-util "^24.8.0" + jest-resolve "^24.8.0" + jest-runtime "^24.8.0" + jest-util "^24.8.0" + jest-worker "^24.6.0" + source-map-support "^0.5.6" + throat "^4.0.0" + +jest-runtime@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-24.8.0.tgz#05f94d5b05c21f6dc54e427cd2e4980923350620" + integrity sha512-Mq0aIXhvO/3bX44ccT+czU1/57IgOMyy80oM0XR/nyD5zgBcesF84BPabZi39pJVA6UXw+fY2Q1N+4BiVUBWOA== + dependencies: + "@jest/console" "^24.7.1" + "@jest/environment" "^24.8.0" + "@jest/source-map" "^24.3.0" + "@jest/transform" "^24.8.0" + "@jest/types" "^24.8.0" + "@types/yargs" "^12.0.2" + chalk "^2.0.1" + exit "^0.1.2" + glob "^7.1.3" + graceful-fs "^4.1.15" + jest-config "^24.8.0" + jest-haste-map "^24.8.0" + jest-message-util "^24.8.0" + jest-mock "^24.8.0" + jest-regex-util "^24.3.0" + jest-resolve "^24.8.0" + jest-snapshot "^24.8.0" + jest-util "^24.8.0" + jest-validate "^24.8.0" + realpath-native "^1.1.0" + slash "^2.0.0" + strip-bom "^3.0.0" + yargs "^12.0.2" + +jest-serializer@^24.4.0: + version "24.4.0" + resolved "https://registry.yarnpkg.com/jest-serializer/-/jest-serializer-24.4.0.tgz#f70c5918c8ea9235ccb1276d232e459080588db3" + integrity sha512-k//0DtglVstc1fv+GY/VHDIjrtNjdYvYjMlbLUed4kxrE92sIUewOi5Hj3vrpB8CXfkJntRPDRjCrCvUhBdL8Q== + +jest-snapshot@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-24.8.0.tgz#3bec6a59da2ff7bc7d097a853fb67f9d415cb7c6" + integrity sha512-5ehtWoc8oU9/cAPe6fez6QofVJLBKyqkY2+TlKTOf0VllBB/mqUNdARdcjlZrs9F1Cv+/HKoCS/BknT0+tmfPg== + dependencies: + "@babel/types" "^7.0.0" + "@jest/types" "^24.8.0" + chalk "^2.0.1" + expect "^24.8.0" + jest-diff "^24.8.0" + jest-matcher-utils "^24.8.0" + jest-message-util "^24.8.0" + jest-resolve "^24.8.0" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + pretty-format "^24.8.0" + semver "^5.5.0" + +jest-util@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-24.8.0.tgz#41f0e945da11df44cc76d64ffb915d0716f46cd1" + integrity sha512-DYZeE+XyAnbNt0BG1OQqKy/4GVLPtzwGx5tsnDrFcax36rVE3lTA5fbvgmbVPUZf9w77AJ8otqR4VBbfFJkUZA== + dependencies: + "@jest/console" "^24.7.1" + "@jest/fake-timers" "^24.8.0" + "@jest/source-map" "^24.3.0" + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" + callsites "^3.0.0" + chalk "^2.0.1" + graceful-fs "^4.1.15" + is-ci "^2.0.0" + mkdirp "^0.5.1" + slash "^2.0.0" + source-map "^0.6.0" + +jest-validate@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-24.8.0.tgz#624c41533e6dfe356ffadc6e2423a35c2d3b4849" + integrity sha512-+/N7VOEMW1Vzsrk3UWBDYTExTPwf68tavEPKDnJzrC6UlHtUDU/fuEdXqFoHzv9XnQ+zW6X3qMZhJ3YexfeLDA== + dependencies: + "@jest/types" "^24.8.0" + camelcase "^5.0.0" + chalk "^2.0.1" + jest-get-type "^24.8.0" + leven "^2.1.0" + pretty-format "^24.8.0" + +jest-watcher@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-24.8.0.tgz#58d49915ceddd2de85e238f6213cef1c93715de4" + integrity sha512-SBjwHt5NedQoVu54M5GEx7cl7IGEFFznvd/HNT8ier7cCAx/Qgu9ZMlaTQkvK22G1YOpcWBLQPFSImmxdn3DAw== + dependencies: + "@jest/test-result" "^24.8.0" + "@jest/types" "^24.8.0" + "@types/yargs" "^12.0.9" + ansi-escapes "^3.0.0" + chalk "^2.0.1" + jest-util "^24.8.0" + string-length "^2.0.0" + +jest-worker@^24.6.0: + version "24.6.0" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-24.6.0.tgz#7f81ceae34b7cde0c9827a6980c35b7cdc0161b3" + integrity sha512-jDwgW5W9qGNvpI1tNnvajh0a5IE/PuGLFmHk6aR/BZFz8tSgGw17GsDPXAJ6p91IvYDjOw8GpFbvvZGAK+DPQQ== + dependencies: + merge-stream "^1.0.1" + supports-color "^6.1.0" + +jest@^24.6.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/jest/-/jest-24.8.0.tgz#d5dff1984d0d1002196e9b7f12f75af1b2809081" + integrity sha512-o0HM90RKFRNWmAWvlyV8i5jGZ97pFwkeVoGvPW1EtLTgJc2+jcuqcbbqcSZLE/3f2S5pt0y2ZBETuhpWNl1Reg== + dependencies: + import-local "^2.0.0" + jest-cli "^24.8.0" + +"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +jsbn@~0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" + integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= + +jsdom@^11.5.1: + version "11.12.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.12.0.tgz#1a80d40ddd378a1de59656e9e6dc5a3ba8657bc8" + integrity sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw== + dependencies: + abab "^2.0.0" + acorn "^5.5.3" + acorn-globals "^4.1.0" + array-equal "^1.0.0" + cssom ">= 0.3.2 < 0.4.0" + cssstyle "^1.0.0" + data-urls "^1.0.0" + domexception "^1.0.1" + escodegen "^1.9.1" + html-encoding-sniffer "^1.0.2" + left-pad "^1.3.0" + nwsapi "^2.0.7" + parse5 "4.0.0" + pn "^1.1.0" + request "^2.87.0" + request-promise-native "^1.0.5" + sax "^1.2.4" + symbol-tree "^3.2.2" + tough-cookie "^2.3.4" + w3c-hr-time "^1.0.1" + webidl-conversions "^4.0.2" + whatwg-encoding "^1.0.3" + whatwg-mimetype "^2.1.0" + whatwg-url "^6.4.1" + ws "^5.2.0" + xml-name-validator "^3.0.0" + +jsesc@^2.5.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== + +json-parse-better-errors@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" + integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-schema@0.2.3: + version "0.2.3" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" + integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= + +json-stringify-safe@~5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= + +json5@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.1.0.tgz#e7a0c62c48285c628d20a10b85c89bb807c32850" + integrity sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ== + dependencies: + minimist "^1.2.0" + +jsprim@^1.2.2: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" + integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= + dependencies: + assert-plus "1.0.0" + extsprintf "1.3.0" + json-schema "0.2.3" + verror "1.10.0" + +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= + dependencies: + is-buffer "^1.1.5" + +kind-of@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== + +kind-of@^6.0.0, kind-of@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051" + integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA== + +kleur@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" + integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== + +lcid@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lcid/-/lcid-2.0.0.tgz#6ef5d2df60e52f82eb228a4c373e8d1f397253cf" + integrity sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA== + dependencies: + invert-kv "^2.0.0" + +left-pad@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" + integrity sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA== + +leven@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/leven/-/leven-2.1.0.tgz#c2e7a9f772094dee9d34202ae8acce4687875580" + integrity sha1-wuep93IJTe6dNCAq6KzORoeHVYA= + +levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +load-json-file@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b" + integrity sha1-L19Fq5HjMhYjT9U62rZo607AmTs= + dependencies: + graceful-fs "^4.1.2" + parse-json "^4.0.0" + pify "^3.0.0" + strip-bom "^3.0.0" + +locate-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" + integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== + dependencies: + p-locate "^3.0.0" + path-exists "^3.0.0" + +lodash.escape@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/lodash.escape/-/lodash.escape-4.0.1.tgz#c9044690c21e04294beaa517712fded1fa88de98" + integrity sha1-yQRGkMIeBClL6qUXcS/e0fqI3pg= + +lodash.flattendeep@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz#fb030917f86a3134e5bc9bec0d69e0013ddfedb2" + integrity sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI= + +lodash.isequal@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" + integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA= + +lodash.sortby@^4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" + integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= + +lodash@^4.15.0, lodash@^4.17.11, lodash@^4.17.4: + version "4.17.11" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" + integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== + +loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +make-dir@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" + integrity sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA== + dependencies: + pify "^4.0.1" + semver "^5.6.0" + +makeerror@1.0.x: + version "1.0.11" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" + integrity sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw= + dependencies: + tmpl "1.0.x" + +map-age-cleaner@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a" + integrity sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w== + dependencies: + p-defer "^1.0.0" + +map-cache@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= + +map-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= + dependencies: + object-visit "^1.0.0" + +mem@^4.0.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178" + integrity sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w== + dependencies: + map-age-cleaner "^0.1.1" + mimic-fn "^2.0.0" + p-is-promise "^2.0.0" + +merge-stream@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1" + integrity sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE= + dependencies: + readable-stream "^2.0.1" + +micromatch@^3.1.10, micromatch@^3.1.4: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.3.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" + extglob "^2.0.4" + fragment-cache "^0.2.1" + kind-of "^6.0.2" + nanomatch "^1.2.9" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.2" + +mime-db@~1.38.0: + version "1.38.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.38.0.tgz#1a2aab16da9eb167b49c6e4df2d9c68d63d8e2ad" + integrity sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg== + +mime-types@^2.1.12, mime-types@~2.1.19: + version "2.1.22" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.22.tgz#fe6b355a190926ab7698c9a0556a11199b2199bd" + integrity sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog== + dependencies: + mime-db "~1.38.0" + +mimic-fn@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" + integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= + +minimist@^1.1.1, minimist@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= + +minimist@~0.0.1: + version "0.0.10" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" + integrity sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8= + +minipass@^2.2.1, minipass@^2.3.4: + version "2.3.5" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.3.5.tgz#cacebe492022497f656b0f0f51e2682a9ed2d848" + integrity sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA== + dependencies: + safe-buffer "^5.1.2" + yallist "^3.0.0" + +minizlib@^1.1.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.2.1.tgz#dd27ea6136243c7c880684e8672bb3a45fd9b614" + integrity sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA== + dependencies: + minipass "^2.2.1" + +mixin-deep@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" + integrity sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ== + dependencies: + for-in "^1.0.2" + is-extendable "^1.0.1" + +mkdirp@^0.5.0, mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= + dependencies: + minimist "0.0.8" + +moo@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/moo/-/moo-0.4.3.tgz#3f847a26f31cf625a956a87f2b10fbc013bfd10e" + integrity sha512-gFD2xGCl8YFgGHsqJ9NKRVdwlioeW3mI1iqfLNYQOv0+6JRwG58Zk9DIGQgyIaffSYaO1xsKnMaYzzNr1KyIAw== + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + +ms@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + +nan@^2.12.1: + version "2.13.2" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.13.2.tgz#f51dc7ae66ba7d5d55e1e6d4d8092e802c9aefe7" + integrity sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw== + +nanomatch@^1.2.9: + version "1.2.13" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^2.0.2" + extend-shallow "^3.0.2" + fragment-cache "^0.2.1" + is-windows "^1.0.2" + kind-of "^6.0.2" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= + +nearley@^2.7.10: + version "2.16.0" + resolved "https://registry.yarnpkg.com/nearley/-/nearley-2.16.0.tgz#77c297d041941d268290ec84b739d0ee297e83a7" + integrity sha512-Tr9XD3Vt/EujXbZBv6UAHYoLUSMQAxSsTnm9K3koXzjzNWY195NqALeyrzLZBKzAkL3gl92BcSogqrHjD8QuUg== + dependencies: + commander "^2.19.0" + moo "^0.4.3" + railroad-diagrams "^1.0.0" + randexp "0.4.6" + semver "^5.4.1" + +needle@^2.2.1: + version "2.2.4" + resolved "https://registry.yarnpkg.com/needle/-/needle-2.2.4.tgz#51931bff82533b1928b7d1d69e01f1b00ffd2a4e" + integrity sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA== + dependencies: + debug "^2.1.2" + iconv-lite "^0.4.4" + sax "^1.2.4" + +neo-async@^2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.0.tgz#b9d15e4d71c6762908654b5183ed38b753340835" + integrity sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA== + +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== + +node-fetch@^1.0.1: + version "1.7.3" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" + integrity sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ== + dependencies: + encoding "^0.1.11" + is-stream "^1.0.1" + +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= + +node-modules-regexp@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" + integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= + +node-notifier@^5.2.1: + version "5.4.0" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.4.0.tgz#7b455fdce9f7de0c63538297354f3db468426e6a" + integrity sha512-SUDEb+o71XR5lXSTyivXd9J7fCloE3SyP4lSgt3lU2oSANiox+SxlNRGPjDKrwU1YN3ix2KN/VGGCg0t01rttQ== + dependencies: + growly "^1.3.0" + is-wsl "^1.1.0" + semver "^5.5.0" + shellwords "^0.1.1" + which "^1.3.0" + +node-pre-gyp@^0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.12.0.tgz#39ba4bb1439da030295f899e3b520b7785766149" + integrity sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A== + dependencies: + detect-libc "^1.0.2" + mkdirp "^0.5.1" + needle "^2.2.1" + nopt "^4.0.1" + npm-packlist "^1.1.6" + npmlog "^4.0.2" + rc "^1.2.7" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^4" + +nopt@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" + integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= + dependencies: + abbrev "1" + osenv "^0.1.4" + +normalize-package-data@^2.3.2: + version "2.5.0" + resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.5.0.tgz#e66db1838b200c1dfc233225d12cb36520e234a8" + integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== + dependencies: + hosted-git-info "^2.1.4" + resolve "^1.10.0" + semver "2 || 3 || 4 || 5" + validate-npm-package-license "^3.0.1" + +normalize-path@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= + dependencies: + remove-trailing-separator "^1.0.1" + +npm-bundled@^1.0.1: + version "1.0.6" + resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.0.6.tgz#e7ba9aadcef962bb61248f91721cd932b3fe6bdd" + integrity sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g== + +npm-packlist@^1.1.6: + version "1.4.1" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-1.4.1.tgz#19064cdf988da80ea3cee45533879d90192bbfbc" + integrity sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw== + dependencies: + ignore-walk "^3.0.1" + npm-bundled "^1.0.1" + +npm-run-path@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" + integrity sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8= + dependencies: + path-key "^2.0.0" + +npmlog@^4.0.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" + integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg== + dependencies: + are-we-there-yet "~1.1.2" + console-control-strings "~1.1.0" + gauge "~2.7.3" + set-blocking "~2.0.0" + +nth-check@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.2.tgz#b2bd295c37e3dd58a3bf0700376663ba4d9cf05c" + integrity sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg== + dependencies: + boolbase "~1.0.0" + +number-is-nan@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" + integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= + +nwsapi@^2.0.7: + version "2.1.1" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.1.1.tgz#08d6d75e69fd791bdea31507ffafe8c843b67e9c" + integrity sha512-T5GaA1J/d34AC8mkrFD2O0DR17kwJ702ZOtJOsS8RpbsQZVOC2/xYFb1i/cw+xdM54JIlMuojjDOYct8GIWtwg== + +oauth-sign@~0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" + integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== + +object-assign@^4.1.0, object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" + +object-inspect@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.6.0.tgz#c70b6cbf72f274aab4c34c0c82f5167bf82cf15b" + integrity sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ== + +object-is@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.0.1.tgz#0aa60ec9989a0b3ed795cf4d06f62cf1ad6539b6" + integrity sha1-CqYOyZiaCz7Xlc9NBvYs8a1lObY= + +object-keys@^1.0.11: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + +object-keys@^1.0.12: + version "1.1.0" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.0.tgz#11bd22348dd2e096a045ab06f6c85bcc340fa032" + integrity sha512-6OO5X1+2tYkNyNEx6TsCxEqFfRWaqx6EtMiSbGrw8Ob8v9Ne+Hl8rBAgLBZn5wjEz3s/s6U1WXFUFOcxxAwUpg== + +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= + dependencies: + isobject "^3.0.0" + +object.assign@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" + integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== + dependencies: + define-properties "^1.1.2" + function-bind "^1.1.1" + has-symbols "^1.0.0" + object-keys "^1.0.11" + +object.entries@^1.0.4, object.entries@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.0.tgz#2024fc6d6ba246aee38bdb0ffd5cfbcf371b7519" + integrity sha512-l+H6EQ8qzGRxbkHOd5I/aHRhHDKoQXQ8g0BYt4uSweQU1/J6dZUOyWh9a2Vky35YCKjzmgxOzta2hH6kf9HuXA== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.12.0" + function-bind "^1.1.1" + has "^1.0.3" + +object.fromentries@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.0.tgz#49a543d92151f8277b3ac9600f1e930b189d30ab" + integrity sha512-9iLiI6H083uiqUuvzyY6qrlmc/Gz8hLQFOcb/Ri/0xXFkSNS3ctV+CbE6yM2+AnkYfOB3dGjdzC0wrMLIhQICA== + dependencies: + define-properties "^1.1.2" + es-abstract "^1.11.0" + function-bind "^1.1.1" + has "^1.0.1" + +object.getownpropertydescriptors@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" + integrity sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY= + dependencies: + define-properties "^1.1.2" + es-abstract "^1.5.1" + +object.pick@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= + dependencies: + isobject "^3.0.1" + +object.values@^1.0.4, object.values@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.0.tgz#bf6810ef5da3e5325790eaaa2be213ea84624da9" + integrity sha512-8mf0nKLAoFX6VlNVdhGj31SVYpaNFtUnuoOXWyFEstsWRgU837AK+JYM0iAxwkSzGRbwn8cbFmgbyxj1j4VbXg== + dependencies: + define-properties "^1.1.3" + es-abstract "^1.12.0" + function-bind "^1.1.1" + has "^1.0.3" + +once@^1.3.0, once@^1.3.1, once@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +optimist@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" + integrity sha1-2j6nRob6IaGaERwybpDrFaAZZoY= + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + +optionator@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= + +os-locale@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-3.1.0.tgz#a802a6ee17f24c10483ab9935719cef4ed16bf1a" + integrity sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q== + dependencies: + execa "^1.0.0" + lcid "^2.0.0" + mem "^4.0.0" + +os-tmpdir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= + +osenv@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.5.tgz#85cdfafaeb28e8677f416e287592b5f3f49ea410" + integrity sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g== + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.0" + +p-defer@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" + integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww= + +p-each-series@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-each-series/-/p-each-series-1.0.0.tgz#930f3d12dd1f50e7434457a22cd6f04ac6ad7f71" + integrity sha1-kw89Et0fUOdDRFeiLNbwSsatf3E= + dependencies: + p-reduce "^1.0.0" + +p-finally@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" + integrity sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4= + +p-is-promise@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/p-is-promise/-/p-is-promise-2.1.0.tgz#918cebaea248a62cf7ffab8e3bca8c5f882fc42e" + integrity sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg== + +p-limit@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.2.0.tgz#417c9941e6027a9abcba5092dd2904e255b5fbc2" + integrity sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ== + dependencies: + p-try "^2.0.0" + +p-locate@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" + integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== + dependencies: + p-limit "^2.0.0" + +p-reduce@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/p-reduce/-/p-reduce-1.0.0.tgz#18c2b0dd936a4690a529f8231f58a0fdb6a47dfa" + integrity sha1-GMKw3ZNqRpClKfgjH1ig/bakffo= + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +parse-json@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-4.0.0.tgz#be35f5425be1f7f6c747184f98a788cb99477ee0" + integrity sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA= + dependencies: + error-ex "^1.3.1" + json-parse-better-errors "^1.0.1" + +parse5@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" + integrity sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA== + +parse5@^3.0.1: + version "3.0.3" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-3.0.3.tgz#042f792ffdd36851551cf4e9e066b3874ab45b5c" + integrity sha512-rgO9Zg5LLLkfJF9E6CCmXlSE4UVceloys8JrFqCcHloC3usd/kJCyPDwH2SOlzix2j3xaP9sUX3e8+kvkuleAA== + dependencies: + "@types/node" "*" + +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +path-key@^2.0.0, path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= + +path-parse@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + +path-type@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" + integrity sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg== + dependencies: + pify "^3.0.0" + +performance-now@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" + integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= + +pify@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-3.0.0.tgz#e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176" + integrity sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY= + +pify@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" + integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== + +pirates@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87" + integrity sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA== + dependencies: + node-modules-regexp "^1.0.0" + +pkg-dir@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3" + integrity sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw== + dependencies: + find-up "^3.0.0" + +pn@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" + integrity sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA== + +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= + +pretty-format@^24.8.0: + version "24.8.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.8.0.tgz#8dae7044f58db7cb8be245383b565a963e3c27f2" + integrity sha512-P952T7dkrDEplsR+TuY7q3VXDae5Sr7zmQb12JU/NDQa/3CH7/QW0yvqLcGN6jL+zQFKaoJcPc+yJxMTGmosqw== + dependencies: + "@jest/types" "^24.8.0" + ansi-regex "^4.0.0" + ansi-styles "^3.2.0" + react-is "^16.8.4" + +process-nextick-args@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" + integrity sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw== + +promise@^7.1.1: + version "7.3.1" + resolved "https://registry.yarnpkg.com/promise/-/promise-7.3.1.tgz#064b72602b18f90f29192b8b1bc418ffd1ebd3bf" + integrity sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg== + dependencies: + asap "~2.0.3" + +prompts@^2.0.1: + version "2.1.0" + resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.1.0.tgz#bf90bc71f6065d255ea2bdc0fe6520485c1b45db" + integrity sha512-+x5TozgqYdOwWsQFZizE/Tra3fKvAoy037kOyU6cgz84n8f6zxngLOV4O32kTwt9FcLCxAqw0P/c8rOr9y+Gfg== + dependencies: + kleur "^3.0.2" + sisteransi "^1.0.0" + +prop-types-exact@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/prop-types-exact/-/prop-types-exact-1.2.0.tgz#825d6be46094663848237e3925a98c6e944e9869" + integrity sha512-K+Tk3Kd9V0odiXFP9fwDHUYRyvK3Nun3GVyPapSIs5OBkITAm15W0CPFD/YKTkMUAbc0b9CUwRQp2ybiBIq+eA== + dependencies: + has "^1.0.3" + object.assign "^4.1.0" + reflect.ownkeys "^0.2.0" + +prop-types@^15.6.0, prop-types@^15.6.2, prop-types@^15.7.2: + version "15.7.2" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" + integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== + dependencies: + loose-envify "^1.4.0" + object-assign "^4.1.1" + react-is "^16.8.1" + +psl@^1.1.24, psl@^1.1.28: + version "1.1.31" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184" + integrity sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw== + +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +punycode@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" + integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= + +punycode@^2.1.0, punycode@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +qs@~6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" + integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== + +raf@^3.4.0: + version "3.4.1" + resolved "https://registry.yarnpkg.com/raf/-/raf-3.4.1.tgz#0742e99a4a6552f445d73e3ee0328af0ff1ede39" + integrity sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA== + dependencies: + performance-now "^2.1.0" + +railroad-diagrams@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz#eb7e6267548ddedfb899c1b90e57374559cddb7e" + integrity sha1-635iZ1SN3t+4mcG5Dlc3RVnN234= + +randexp@0.4.6: + version "0.4.6" + resolved "https://registry.yarnpkg.com/randexp/-/randexp-0.4.6.tgz#e986ad5e5e31dae13ddd6f7b3019aa7c87f60ca3" + integrity sha512-80WNmd9DA0tmZrw9qQa62GPPWfuXJknrmVmLcxvq4uZBdYqb1wYoKTmnlGUchvVWe0XiLupYkBoXVOxz3C8DYQ== + dependencies: + discontinuous-range "1.0.0" + ret "~0.1.10" + +rc@^1.2.7: + version "1.2.8" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== + dependencies: + deep-extend "^0.6.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + +react-dom@16.4.1: + version "16.4.1" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.4.1.tgz#7f8b0223b3a5fbe205116c56deb85de32685dad6" + integrity sha512-1Gin+wghF/7gl4Cqcvr1DxFX2Osz7ugxSwl6gBqCMpdrxHjIFUS7GYxrFftZ9Ln44FHw0JxCFD9YtZsrbR5/4A== + dependencies: + fbjs "^0.8.16" + loose-envify "^1.1.0" + object-assign "^4.1.1" + prop-types "^15.6.0" + +react-is@^16.4.1, react-is@^16.8.4, react-is@^16.8.6: + version "16.8.6" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16" + integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA== + +react-is@^16.8.1: + version "16.8.5" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.5.tgz#c54ac229dd66b5afe0de5acbe47647c3da692ff8" + integrity sha512-sudt2uq5P/2TznPV4Wtdi+Lnq3yaYW8LfvPKLM9BKD8jJNBkxMVyB0C9/GmVhLw7Jbdmndk/73n7XQGeN9A3QQ== + +react-test-renderer@16.4.1: + version "16.4.1" + resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.4.1.tgz#f2fb30c2c7b517db6e5b10ed20bb6b0a7ccd8d70" + integrity sha512-wyyiPxRZOTpKnNIgUBOB6xPLTpIzwcQMIURhZvzUqZzezvHjaGNsDPBhMac5fIY3Jf5NuKxoGvV64zDSOECPPQ== + dependencies: + fbjs "^0.8.16" + object-assign "^4.1.1" + prop-types "^15.6.0" + react-is "^16.4.1" + +react-test-renderer@^16.0.0-0: + version "16.8.6" + resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.8.6.tgz#188d8029b8c39c786f998aa3efd3ffe7642d5ba1" + integrity sha512-H2srzU5IWYT6cZXof6AhUcx/wEyJddQ8l7cLM/F7gDXYyPr4oq+vCIxJYXVGhId1J706sqziAjuOEjyNkfgoEw== + dependencies: + object-assign "^4.1.1" + prop-types "^15.6.2" + react-is "^16.8.6" + scheduler "^0.13.6" + +react@16.4.1: + version "16.4.1" + resolved "https://registry.yarnpkg.com/react/-/react-16.4.1.tgz#de51ba5764b5dbcd1f9079037b862bd26b82fe32" + integrity sha512-3GEs0giKp6E0Oh/Y9ZC60CmYgUPnp7voH9fbjWsvXtYFb4EWtgQub0ADSq0sJR0BbHc4FThLLtzlcFaFXIorwg== + dependencies: + fbjs "^0.8.16" + loose-envify "^1.1.0" + object-assign "^4.1.1" + prop-types "^15.6.0" + +read-pkg-up@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-4.0.0.tgz#1b221c6088ba7799601c808f91161c66e58f8978" + integrity sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA== + dependencies: + find-up "^3.0.0" + read-pkg "^3.0.0" + +read-pkg@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389" + integrity sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k= + dependencies: + load-json-file "^4.0.0" + normalize-package-data "^2.3.2" + path-type "^3.0.0" + +readable-stream@^2.0.1, readable-stream@^2.0.6: + version "2.3.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" + integrity sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readable-stream@^3.1.1: + version "3.4.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.4.0.tgz#a51c26754658e0a3c21dbf59163bd45ba6f447fc" + integrity sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + +realpath-native@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.1.0.tgz#2003294fea23fb0672f2476ebe22fcf498a2d65c" + integrity sha512-wlgPA6cCIIg9gKz0fgAPjnzh4yR/LnXovwuo9hvyGvx3h8nX4+/iLZplfUWasXpqD8BdnGnP5njOFjkUwPzvjA== + dependencies: + util.promisify "^1.0.0" + +reflect.ownkeys@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/reflect.ownkeys/-/reflect.ownkeys-0.2.0.tgz#749aceec7f3fdf8b63f927a04809e90c5c0b3460" + integrity sha1-dJrO7H8/34tj+SegSAnpDFwLNGA= + +regex-not@^1.0.0, regex-not@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== + dependencies: + extend-shallow "^3.0.2" + safe-regex "^1.1.0" + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= + +repeat-element@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" + integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== + +repeat-string@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= + +request-promise-core@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/request-promise-core/-/request-promise-core-1.1.2.tgz#339f6aababcafdb31c799ff158700336301d3346" + integrity sha512-UHYyq1MO8GsefGEt7EprS8UrXsm1TxEvFUX1IMTuSLU2Rh7fTIdFtl8xD7JiEYiWU2dl+NYAjCTksTehQUxPag== + dependencies: + lodash "^4.17.11" + +request-promise-native@^1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.7.tgz#a49868a624bdea5069f1251d0a836e0d89aa2c59" + integrity sha512-rIMnbBdgNViL37nZ1b3L/VfPOpSi0TqVDQPAvO6U14lMzOLrt5nilxCQqtDKhZeDiW0/hkCXGoQjhgJd/tCh6w== + dependencies: + request-promise-core "1.1.2" + stealthy-require "^1.1.1" + tough-cookie "^2.3.3" + +request@^2.87.0: + version "2.88.0" + resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" + integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== + dependencies: + aws-sign2 "~0.7.0" + aws4 "^1.8.0" + caseless "~0.12.0" + combined-stream "~1.0.6" + extend "~3.0.2" + forever-agent "~0.6.1" + form-data "~2.3.2" + har-validator "~5.1.0" + http-signature "~1.2.0" + is-typedarray "~1.0.0" + isstream "~0.1.2" + json-stringify-safe "~5.0.1" + mime-types "~2.1.19" + oauth-sign "~0.9.0" + performance-now "^2.1.0" + qs "~6.5.2" + safe-buffer "^5.1.2" + tough-cookie "~2.4.3" + tunnel-agent "^0.6.0" + uuid "^3.3.2" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + +require-main-filename@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" + integrity sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE= + +require-main-filename@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" + integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== + +resolve-cwd@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a" + integrity sha1-AKn3OHVW4nA46uIyyqNypqWbZlo= + dependencies: + resolve-from "^3.0.0" + +resolve-from@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" + integrity sha1-six699nWiBvItuZTM17rywoYh0g= + +resolve-url@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= + +resolve@1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs= + +resolve@^1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.10.0.tgz#3bdaaeaf45cc07f375656dfd2e54ed0810b101ba" + integrity sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg== + dependencies: + path-parse "^1.0.6" + +resolve@^1.3.2: + version "1.11.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.0.tgz#4014870ba296176b86343d50b60f3b50609ce232" + integrity sha512-WL2pBDjqT6pGUNSUzMw00o4T7If+z4H2x3Gz893WoUQ5KW8Vr9txp00ykiP16VBaZF5+j/OcXJHZ9+PCvdiDKw== + dependencies: + path-parse "^1.0.6" + +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== + +rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.3: + version "2.6.3" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" + integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== + dependencies: + glob "^7.1.3" + +rst-selector-parser@^2.2.3: + version "2.2.3" + resolved "https://registry.yarnpkg.com/rst-selector-parser/-/rst-selector-parser-2.2.3.tgz#81b230ea2fcc6066c89e3472de794285d9b03d91" + integrity sha1-gbIw6i/MYGbInjRy3nlChdmwPZE= + dependencies: + lodash.flattendeep "^4.4.0" + nearley "^2.7.10" + +rsvp@^4.8.4: + version "4.8.4" + resolved "https://registry.yarnpkg.com/rsvp/-/rsvp-4.8.4.tgz#b50e6b34583f3dd89329a2f23a8a2be072845911" + integrity sha512-6FomvYPfs+Jy9TfXmBpBuMWNH94SgCsZmJKcanySzgNNP6LjWxBvyLTa9KaMfDDM5oxRfrKDB0r/qeRsLwnBfA== + +safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +safe-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= + dependencies: + ret "~0.1.10" + +"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +sane@^4.0.3: + version "4.1.0" + resolved "https://registry.yarnpkg.com/sane/-/sane-4.1.0.tgz#ed881fd922733a6c461bc189dc2b6c006f3ffded" + integrity sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA== + dependencies: + "@cnakazawa/watch" "^1.0.3" + anymatch "^2.0.0" + capture-exit "^2.0.0" + exec-sh "^0.3.2" + execa "^1.0.0" + fb-watchman "^2.0.0" + micromatch "^3.1.4" + minimist "^1.1.1" + walker "~1.0.5" + +sax@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" + integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== + +scheduler@^0.13.6: + version "0.13.6" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.13.6.tgz#466a4ec332467b31a91b9bf74e5347072e4cd889" + integrity sha512-IWnObHt413ucAYKsD9J1QShUKkbKLQQHdxRyw73sw4FN26iWr3DY/H34xGPe4nmL1DwXyWmSWmMrA9TfQbE/XQ== + dependencies: + loose-envify "^1.1.0" + object-assign "^4.1.1" + +"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.5.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + +semver@^5.4.1, semver@^5.6.0, semver@^5.7.0: + version "5.7.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b" + integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA== + +semver@^6.0.0: + version "6.1.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.1.1.tgz#53f53da9b30b2103cd4f15eab3a18ecbcb210c9b" + integrity sha512-rWYq2e5iYW+fFe/oPPtYJxYgjBm8sC4rmoGdUOgBB7VnwKt6HrL793l2voH1UlsyYZpJ4g0wfjnTEO1s1NP2eQ== + +set-blocking@^2.0.0, set-blocking@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= + +set-value@^0.4.3: + version "0.4.3" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-0.4.3.tgz#7db08f9d3d22dc7f78e53af3c3bf4666ecdfccf1" + integrity sha1-fbCPnT0i3H945Trzw79GZuzfzPE= + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.1" + to-object-path "^0.3.0" + +set-value@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.0.tgz#71ae4a88f0feefbbf52d1ea604f3fb315ebb6274" + integrity sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg== + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + +setimmediate@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= + +shellwords@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" + integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== + +signal-exit@^3.0.0, signal-exit@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= + +sisteransi@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.0.tgz#77d9622ff909080f1c19e5f4a1df0c1b0a27b88c" + integrity sha512-N+z4pHB4AmUv0SjveWRd6q1Nj5w62m5jodv+GD8lvmbY/83T/rpbJGZOnK5T149OldDj4Db07BSv9xY4K6NTPQ== + +slash@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" + integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== + +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^3.1.0" + +source-map-resolve@^0.5.0: + version "0.5.2" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.2.tgz#72e2cc34095543e43b2c62b2c4c10d4a9054f259" + integrity sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA== + dependencies: + atob "^2.1.1" + decode-uri-component "^0.2.0" + resolve-url "^0.2.1" + source-map-url "^0.4.0" + urix "^0.1.0" + +source-map-support@^0.5.6: + version "0.5.11" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.11.tgz#efac2ce0800355d026326a0ca23e162aeac9a4e2" + integrity sha512-//sajEx/fGL3iw6fltKMdPvy8kL3kJ2O3iuYlRoT3k9Kb4BjOoZ+BZzaNHeuaruSt+Kf3Zk9tnfAQg9/AJqUVQ== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" + +source-map-url@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= + +source-map@^0.5.0, source-map@^0.5.6: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= + +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +spdx-correct@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" + integrity sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q== + dependencies: + spdx-expression-parse "^3.0.0" + spdx-license-ids "^3.0.0" + +spdx-exceptions@^2.1.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz#2ea450aee74f2a89bfb94519c07fcd6f41322977" + integrity sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA== + +spdx-expression-parse@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz#99e119b7a5da00e05491c9fa338b7904823b41d0" + integrity sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg== + dependencies: + spdx-exceptions "^2.1.0" + spdx-license-ids "^3.0.0" + +spdx-license-ids@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz#81c0ce8f21474756148bbb5f3bfc0f36bf15d76e" + integrity sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g== + +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== + dependencies: + extend-shallow "^3.0.0" + +sshpk@^1.7.0: + version "1.16.1" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" + integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== + dependencies: + asn1 "~0.2.3" + assert-plus "^1.0.0" + bcrypt-pbkdf "^1.0.0" + dashdash "^1.12.0" + ecc-jsbn "~0.1.1" + getpass "^0.1.1" + jsbn "~0.1.0" + safer-buffer "^2.0.2" + tweetnacl "~0.14.0" + +stack-utils@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.2.tgz#33eba3897788558bebfc2db059dc158ec36cebb8" + integrity sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA== + +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= + dependencies: + define-property "^0.2.5" + object-copy "^0.1.0" + +stealthy-require@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/stealthy-require/-/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b" + integrity sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks= + +string-length@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-2.0.0.tgz#d40dbb686a3ace960c1cffca562bf2c45f8363ed" + integrity sha1-1A27aGo6zpYMHP/KVivyxF+DY+0= + dependencies: + astral-regex "^1.0.0" + strip-ansi "^4.0.0" + +string-width@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" + integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= + dependencies: + code-point-at "^1.0.0" + is-fullwidth-code-point "^1.0.0" + strip-ansi "^3.0.0" + +"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string.prototype.trim@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz#d04de2c89e137f4d7d206f086b5ed2fae6be8cea" + integrity sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo= + dependencies: + define-properties "^1.1.2" + es-abstract "^1.5.0" + function-bind "^1.0.2" + +string_decoder@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d" + integrity sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w== + dependencies: + safe-buffer "~5.1.0" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + +strip-ansi@^3.0.0, strip-ansi@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= + dependencies: + ansi-regex "^3.0.0" + +strip-ansi@^5.0.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== + dependencies: + ansi-regex "^4.1.0" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM= + +strip-eof@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" + integrity sha1-u0P/VZim6wXYm1n80SnJgzE2Br8= + +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-color@^6.1.0: + version "6.1.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3" + integrity sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ== + dependencies: + has-flag "^3.0.0" + +symbol-tree@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" + integrity sha1-rifbOPZgp64uHDt9G8KQgZuFGeY= + +tar@^4: + version "4.4.8" + resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.8.tgz#b19eec3fde2a96e64666df9fdb40c5ca1bc3747d" + integrity sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ== + dependencies: + chownr "^1.1.1" + fs-minipass "^1.2.5" + minipass "^2.3.4" + minizlib "^1.1.1" + mkdirp "^0.5.0" + safe-buffer "^5.1.2" + yallist "^3.0.2" + +test-exclude@^5.2.3: + version "5.2.3" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.2.3.tgz#c3d3e1e311eb7ee405e092dac10aefd09091eac0" + integrity sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g== + dependencies: + glob "^7.1.3" + minimatch "^3.0.4" + read-pkg-up "^4.0.0" + require-main-filename "^2.0.0" + +throat@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/throat/-/throat-4.1.0.tgz#89037cbc92c56ab18926e6ba4cbb200e15672a6a" + integrity sha1-iQN8vJLFarGJJua6TLsgDhVnKmo= + +tmpl@1.0.x: + version "1.0.4" + resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" + integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE= + +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= + +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= + dependencies: + kind-of "^3.0.2" + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" + +tough-cookie@^2.3.3, tough-cookie@^2.3.4: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" + integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== + dependencies: + psl "^1.1.28" + punycode "^2.1.1" + +tough-cookie@~2.4.3: + version "2.4.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" + integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ== + dependencies: + psl "^1.1.24" + punycode "^1.4.1" + +tr46@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" + integrity sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk= + dependencies: + punycode "^2.1.0" + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= + +tunnel-agent@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" + integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= + dependencies: + safe-buffer "^5.0.1" + +tweetnacl@^0.14.3, tweetnacl@~0.14.0: + version "0.14.5" + resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" + integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= + dependencies: + prelude-ls "~1.1.2" + +ua-parser-js@^0.7.18: + version "0.7.19" + resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.19.tgz#94151be4c0a7fb1d001af7022fdaca4642659e4b" + integrity sha512-T3PVJ6uz8i0HzPxOF9SWzWAlfN/DavlpQqepn22xgve/5QecC+XMCAtmUNnY7C9StehaV6exjUCI801lOI7QlQ== + +uglify-js@^3.1.4: + version "3.5.2" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.5.2.tgz#dc0c7ac2da0a4b7d15e84266818ff30e82529474" + integrity sha512-imog1WIsi9Yb56yRt5TfYVxGmnWs3WSGU73ieSOlMVFwhJCA9W8fqFFMMj4kgDqiS/80LGdsYnWL7O9UcjEBlg== + dependencies: + commander "~2.19.0" + source-map "~0.6.1" + +union-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.0.tgz#5c71c34cb5bad5dcebe3ea0cd08207ba5aa1aea4" + integrity sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ= + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^0.4.3" + +unset-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + +uri-js@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" + integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== + dependencies: + punycode "^2.1.0" + +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= + +use@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== + +util-deprecate@^1.0.1, util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + +util.promisify@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030" + integrity sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA== + dependencies: + define-properties "^1.1.2" + object.getownpropertydescriptors "^2.0.3" + +uuid@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131" + integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA== + +validate-npm-package-license@^3.0.1: + version "3.0.4" + resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" + integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== + dependencies: + spdx-correct "^3.0.0" + spdx-expression-parse "^3.0.0" + +verror@1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + +w3c-hr-time@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045" + integrity sha1-gqwr/2PZUOqeMYmlimViX+3xkEU= + dependencies: + browser-process-hrtime "^0.1.2" + +walker@^1.0.7, walker@~1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" + integrity sha1-L3+bj9ENZ3JisYqITijRlhjgKPs= + dependencies: + makeerror "1.0.x" + +webidl-conversions@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" + integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== + +whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3: + version "1.0.5" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" + integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== + dependencies: + iconv-lite "0.4.24" + +whatwg-fetch@>=0.10.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb" + integrity sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q== + +whatwg-mimetype@^2.1.0, whatwg-mimetype@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" + integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== + +whatwg-url@^6.4.1: + version "6.5.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.5.0.tgz#f2df02bff176fd65070df74ad5ccbb5a199965a8" + integrity sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ== + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.1" + webidl-conversions "^4.0.2" + +whatwg-url@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.0.0.tgz#fde926fa54a599f3adf82dff25a9f7be02dc6edd" + integrity sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ== + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.1" + webidl-conversions "^4.0.2" + +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= + +which@^1.2.9, which@^1.3.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + +wide-align@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== + dependencies: + string-width "^1.0.2 || 2" + +wordwrap@~0.0.2: + version "0.0.3" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" + integrity sha1-o9XabNXAvAAI03I0u68b7WMFkQc= + +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= + +wrap-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" + integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +write-file-atomic@2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.4.1.tgz#d0b05463c188ae804396fd5ab2a370062af87529" + integrity sha512-TGHFeZEZMnv+gBFRfjAcxL5bPHrsGKtnb4qsFAws7/vlh+QfwAaySIw4AXP9ZskTTh5GWu3FLuJhsWVdiJPGvg== + dependencies: + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + signal-exit "^3.0.2" + +ws@^5.2.0: + version "5.2.2" + resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f" + integrity sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA== + dependencies: + async-limiter "~1.0.0" + +xml-name-validator@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" + integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== + +"y18n@^3.2.1 || ^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" + integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== + +yallist@^3.0.0, yallist@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9" + integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A== + +yargs-parser@^11.1.1: + version "11.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-11.1.1.tgz#879a0865973bca9f6bab5cbdf3b1c67ec7d3bcf4" + integrity sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + +yargs@^12.0.2: + version "12.0.5" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" + integrity sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw== + dependencies: + cliui "^4.0.0" + decamelize "^1.2.0" + find-up "^3.0.0" + get-caller-file "^1.0.1" + os-locale "^3.0.0" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^2.0.0" + which-module "^2.0.0" + y18n "^3.2.1 || ^4.0.0" + yargs-parser "^11.1.1" diff --git a/devtools/client/aboutdebugging/test/xpcshell/.eslintrc.js b/devtools/client/aboutdebugging/test/xpcshell/.eslintrc.js new file mode 100644 index 0000000000..8611c174f5 --- /dev/null +++ b/devtools/client/aboutdebugging/test/xpcshell/.eslintrc.js @@ -0,0 +1,6 @@ +"use strict"; + +module.exports = { + // Extend from the common devtools xpcshell eslintrc config. + extends: "../../../../.eslintrc.xpcshell.js", +}; diff --git a/devtools/client/aboutdebugging/test/xpcshell/test_extensions_path.js b/devtools/client/aboutdebugging/test/xpcshell/test_extensions_path.js new file mode 100644 index 0000000000..f7fc70ec30 --- /dev/null +++ b/devtools/client/aboutdebugging/test/xpcshell/test_extensions_path.js @@ -0,0 +1,27 @@ +/* global equal */ + +"use strict"; + +const { + parseFileUri, +} = require("devtools/client/aboutdebugging/src/modules/extensions-helper"); + +add_task(async function testParseFileUri() { + equal( + parseFileUri("file:///home/me/my-extension/"), + "/home/me/my-extension/", + "UNIX paths are supported" + ); + + equal( + parseFileUri("file:///C:/Documents/my-extension/"), + "C:/Documents/my-extension/", + "Windows paths are supported" + ); + + equal( + parseFileUri("file://home/Documents/my-extension/"), + "home/Documents/my-extension/", + "Windows network paths are supported" + ); +}); diff --git a/devtools/client/aboutdebugging/test/xpcshell/test_runtime_default_preferences.js b/devtools/client/aboutdebugging/test/xpcshell/test_runtime_default_preferences.js new file mode 100644 index 0000000000..a14eb12049 --- /dev/null +++ b/devtools/client/aboutdebugging/test/xpcshell/test_runtime_default_preferences.js @@ -0,0 +1,201 @@ +"use strict"; + +const { sinon } = ChromeUtils.import("resource://testing-common/Sinon.jsm"); +const { + setDefaultPreferencesIfNeeded, + PREFERENCE_TYPES, +} = require("devtools/client/aboutdebugging/src/modules/runtime-default-preferences"); + +const CHAR_PREF = "some.char.pref"; +const BOOL_PREF = "some.bool.pref"; +const INT_PREF = "some.int.pref"; + +const TEST_PREFERENCES = [ + { + prefName: BOOL_PREF, + defaultValue: false, + trait: "boolPrefTrait", + type: PREFERENCE_TYPES.BOOL, + }, + { + prefName: CHAR_PREF, + defaultValue: "", + trait: "charPrefTrait", + type: PREFERENCE_TYPES.CHAR, + }, + { + prefName: INT_PREF, + defaultValue: 1, + trait: "intPrefTrait", + type: PREFERENCE_TYPES.INT, + }, +]; + +add_task(async function test_with_traits() { + // Create a front that indicates that the preferences should be safe to query. + // We should not perform any additional call to the preferences front. + const preferencesFront = { + getTraits: () => ({ + boolPrefTrait: true, + charPrefTrait: true, + intPrefTrait: true, + }), + + setBoolPref: sinon.spy(), + getBoolPref: sinon.spy(), + setCharPref: sinon.spy(), + getCharPref: sinon.spy(), + setIntPref: sinon.spy(), + getIntPref: sinon.spy(), + }; + + const clientWrapper = createClientWrapper(preferencesFront); + await setDefaultPreferencesIfNeeded(clientWrapper, TEST_PREFERENCES); + + // Check get/setBoolPref spies + ok(preferencesFront.getBoolPref.notCalled, "getBoolPref was not called"); + ok(preferencesFront.setBoolPref.notCalled, "setBoolPref was not called"); + + // Check get/setCharPref spies + ok(preferencesFront.getCharPref.notCalled, "getCharPref was not called"); + ok(preferencesFront.setCharPref.notCalled, "setCharPref was not called"); + + // Check get/setIntPref spies + ok(preferencesFront.getIntPref.notCalled, "getIntPref was not called"); + ok(preferencesFront.setIntPref.notCalled, "setIntPref was not called"); +}); + +add_task(async function test_without_traits_no_error() { + // Create a front that indicates that the preferences are missing, but which + // doesn't fail when getting the preferences. This will typically happen when + // the user managed to set the preference on the remote runtime. + // We should not erase user values, so we should not call the set*Pref APIs. + const preferencesFront = { + getTraits: () => ({ + boolPrefTrait: false, + charPrefTrait: false, + intPrefTrait: false, + }), + + setBoolPref: sinon.spy(), + getBoolPref: sinon.spy(), + setCharPref: sinon.spy(), + getCharPref: sinon.spy(), + setIntPref: sinon.spy(), + getIntPref: sinon.spy(), + }; + + const clientWrapper = createClientWrapper(preferencesFront); + await setDefaultPreferencesIfNeeded(clientWrapper, TEST_PREFERENCES); + + // Check get/setBoolPref spies + ok( + preferencesFront.getBoolPref.calledWith(BOOL_PREF), + "getBoolPref was called with the proper preference name" + ); + ok(preferencesFront.getBoolPref.calledOnce, "getBoolPref was called once"); + ok(preferencesFront.setBoolPref.notCalled, "setBoolPref was not called"); + + // Check get/setCharPref spies + ok( + preferencesFront.getCharPref.calledWith(CHAR_PREF), + "getCharPref was called with the proper preference name" + ); + ok(preferencesFront.getCharPref.calledOnce, "getCharPref was called once"); + ok(preferencesFront.setCharPref.notCalled, "setCharPref was not called"); + + // Check get/setIntPref spies + ok( + preferencesFront.getIntPref.calledWith(INT_PREF), + "getIntPref was called with the proper preference name" + ); + ok(preferencesFront.getIntPref.calledOnce, "getIntPref was called once"); + ok(preferencesFront.setIntPref.notCalled, "setIntPref was not called"); +}); + +add_task(async function test_without_traits_with_error() { + // Create a front that indicates that the preferences are missing, and which + // will also throw when attempting to get said preferences. + // This should lead to create default values for the preferences. + const preferencesFront = { + getTraits: () => ({ + boolPrefTrait: false, + charPrefTrait: false, + intPrefTrait: false, + }), + + setBoolPref: sinon.spy(), + getBoolPref: sinon.spy(pref => { + if (pref === BOOL_PREF) { + throw new Error("Invalid preference"); + } + }), + setCharPref: sinon.spy(), + getCharPref: sinon.spy(pref => { + if (pref === CHAR_PREF) { + throw new Error("Invalid preference"); + } + }), + setIntPref: sinon.spy(), + getIntPref: sinon.spy(pref => { + if (pref === INT_PREF) { + throw new Error("Invalid preference"); + } + }), + }; + + const clientWrapper = createClientWrapper(preferencesFront); + await setDefaultPreferencesIfNeeded(clientWrapper, TEST_PREFERENCES); + + // Check get/setBoolPref spies + ok(preferencesFront.getBoolPref.calledOnce, "getBoolPref was called once"); + ok(preferencesFront.getBoolPref.threw(), "getBoolPref threw"); + ok( + preferencesFront.getBoolPref.calledWith(BOOL_PREF), + "getBoolPref was called with the proper preference name" + ); + + ok(preferencesFront.setBoolPref.calledOnce, "setBoolPref was called once"); + ok( + preferencesFront.setBoolPref.calledWith(BOOL_PREF, false), + "setBoolPref was called with the proper preference name and value" + ); + + // Check get/setCharPref spies + ok(preferencesFront.getCharPref.calledOnce, "getCharPref was called once"); + ok(preferencesFront.getCharPref.threw(), "getCharPref threw"); + ok( + preferencesFront.getCharPref.calledWith(CHAR_PREF), + "getCharPref was called with the proper preference name" + ); + + ok(preferencesFront.setCharPref.calledOnce, "setCharPref was called once"); + ok( + preferencesFront.setCharPref.calledWith(CHAR_PREF, ""), + "setCharPref was called with the proper preference name and value" + ); + + // Check get/setIntPref spies + ok(preferencesFront.getIntPref.calledOnce, "getIntPref was called once"); + ok(preferencesFront.getIntPref.threw(), "getIntPref threw"); + ok( + preferencesFront.getIntPref.calledWith(INT_PREF), + "getIntPref was called with the proper preference name" + ); + + ok(preferencesFront.setIntPref.calledOnce, "setIntPref was called once"); + ok( + preferencesFront.setIntPref.calledWith(INT_PREF, 1), + "setIntPref was called with the proper preference name and value" + ); +}); + +function createClientWrapper(preferencesFront) { + const clientWrapper = { + getFront: name => { + return preferencesFront; + }, + }; + + return clientWrapper; +} diff --git a/devtools/client/aboutdebugging/test/xpcshell/xpcshell-head.js b/devtools/client/aboutdebugging/test/xpcshell/xpcshell-head.js new file mode 100644 index 0000000000..93a0b0881f --- /dev/null +++ b/devtools/client/aboutdebugging/test/xpcshell/xpcshell-head.js @@ -0,0 +1,8 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +/* eslint no-unused-vars: [2, {"vars": "local"}] */ + +const { require } = ChromeUtils.import("resource://devtools/shared/Loader.jsm"); diff --git a/devtools/client/aboutdebugging/test/xpcshell/xpcshell.ini b/devtools/client/aboutdebugging/test/xpcshell/xpcshell.ini new file mode 100644 index 0000000000..42954757e8 --- /dev/null +++ b/devtools/client/aboutdebugging/test/xpcshell/xpcshell.ini @@ -0,0 +1,8 @@ +[DEFAULT] +tags = devtools +head = xpcshell-head.js +firefox-appdir = browser +skip-if = toolkit == 'android' + +[test_extensions_path.js] +[test_runtime_default_preferences.js] |