Merge mozilla-central to inbound. a=merge CLOSED TREE

This commit is contained in:
Brindusan Cristian 2019-05-02 18:33:18 +03:00
Родитель 2a824be22f 7667ecf1f2
Коммит 9deae973cd
186 изменённых файлов: 3845 добавлений и 2588 удалений

Просмотреть файл

@ -12,3 +12,4 @@ skip-if = e10s
[browser_test_focus_browserui.js]
[browser_test_focus_dialog.js]
[browser_test_focus_urlbar.js]
skip-if = true # Skipping temporarily, tracked in bug 1522440.

Просмотреть файл

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<blocklist lastupdate="1556224874229" xmlns="http://www.mozilla.org/2006/addons-blocklist">
<blocklist lastupdate="1556794746654" xmlns="http://www.mozilla.org/2006/addons-blocklist">
<emItems>
<emItem blockID="i334" id="{0F827075-B026-42F3-885D-98981EE7B1AE}">
<prefs/>
@ -2860,6 +2860,26 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="3659d4a2-3121-45cd-b8b6-5b2c96ebc17f" id="{a1f6fa05-26cd-4399-a97a-7996067d04b0}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="e6371474-8681-4498-8e89-421f25fd2e12" id="{c11adb01-56bc-44d6-ac05-6f364e2afe01}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="71475499-ca6f-4b71-8bef-2b95cf59ee30" id="{0beedf0b-dc79-48bd-adff-2ed36acdb806}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="b0ff609b-c98e-4d29-8323-61c3e064ec9c" id="{a38141d9-ef67-4d4b-a9da-e3e4d0b7ba6a}">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="9efe3274-2bd2-44a3-aa7f-92934581470b" id="/^((premium-enhancer@ext\.com)|(notif-rm-unlisted@ext\.com)|(search-updater@ext\.com)|(updt-lite-unlisted@ext\.com)|(coldsearch@ext\.com)|(reader@ext\.com)|(local@ext\.com)|(fptool@ext\.com)|(gflash@ext\.com)|(advplayer@ext\.com)|(yfp@ext\.com)|(ytbenhancer@ext\.com)|(yoump@ext\.com)|(floating@ext\.com)|(ytbhelper@ext\.com))$/">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
</emItems>
<pluginItems>
<pluginItem blockID="p332">

Просмотреть файл

@ -336,8 +336,13 @@ pref("browser.urlbar.openintab", false);
pref("browser.urlbar.usepreloadedtopurls.enabled", false);
pref("browser.urlbar.usepreloadedtopurls.expire_days", 14);
// Toggle the new work in progress Address Bar code.
// Toggle the new work in progress Address Bar code. Enable it on Nightly and Beta,
// not on Release yet.
#ifdef EARLY_BETA_OR_EARLIER
pref("browser.urlbar.quantumbar", true);
#else
pref("browser.urlbar.quantumbar", false);
#endif
pref("browser.altClickSave", false);

Просмотреть файл

@ -1411,7 +1411,9 @@ var PanelView = class extends AssociatedToNode {
_isNavigableWithTabOnly(element) {
let tag = element.localName;
return tag == "menulist" || tag == "textbox" || tag == "input"
|| tag == "textarea";
|| tag == "textarea"
// Allow tab to reach embedded documents in extension panels.
|| tag == "browser";
}
/**
@ -1565,6 +1567,24 @@ var PanelView = class extends AssociatedToNode {
return;
}
let focus = this.document.activeElement;
// Make sure the focus is actually inside the panel. (It might not be if
// the panel was opened with the mouse.) If it isn't, we don't care
// about it for our purposes.
// We use Node.compareDocumentPosition because Node.contains doesn't
// behave as expected for anonymous content; e.g. the input inside a
// textbox.
if (focus && !(this.node.compareDocumentPosition(focus)
& Node.DOCUMENT_POSITION_CONTAINED_BY)) {
focus = null;
}
// Extension panels contain embedded documents. We can't manage
// keyboard navigation within those.
if (focus && focus.tagName == "browser") {
return;
}
let stop = () => {
event.stopPropagation();
event.preventDefault();
@ -1578,20 +1598,7 @@ var PanelView = class extends AssociatedToNode {
// We use the real focus rather than this.selectedElement because focus
// might have been moved without keyboard navigation (e.g. mouse click)
// and this.selectedElement is only updated for keyboard navigation.
let focus = this.document.activeElement;
if (!focus) {
return false;
}
// Make sure the focus is actually inside the panel.
// (It might not be if the panel was opened with the mouse.)
// We use Node.compareDocumentPosition because Node.contains doesn't
// behave as expected for anonymous content; e.g. the input inside a
// textbox.
if (!(this.node.compareDocumentPosition(focus)
& Node.DOCUMENT_POSITION_CONTAINED_BY)) {
return false;
}
return this._isNavigableWithTabOnly(focus);
return focus && this._isNavigableWithTabOnly(focus);
};
let keyCode = event.code;
@ -1657,12 +1664,17 @@ var PanelView = class extends AssociatedToNode {
this._doingKeyboardActivation = true;
// Unfortunately, 'tabindex' doesn't execute the default action, so
// we explicitly do this here.
// We are sending a command event and then a click event.
// This is done in order to mimic a "real" mouse click event.
// The command event executes the action, then the click event closes the menu.
// We are sending a command event, a mousedown event and then a click
// event. This is done in order to mimic a "real" mouse click event.
// Normally, the command event executes the action, then the click event
// closes the menu. However, in some cases (e.g. the Library button),
// there is no command event handler and the mousedown event executes the
// action instead.
button.doCommand();
let clickEvent = new event.target.ownerGlobal.MouseEvent("click", {"bubbles": true});
button.dispatchEvent(clickEvent);
let dispEvent = new event.target.ownerGlobal.MouseEvent("mousedown", {"bubbles": true});
button.dispatchEvent(dispEvent);
dispEvent = new event.target.ownerGlobal.MouseEvent("click", {"bubbles": true});
button.dispatchEvent(dispEvent);
this._doingKeyboardActivation = false;
break;
}

Просмотреть файл

@ -23,6 +23,8 @@ let gMainArrowOrder;
let gSubView;
let gSubButton;
let gSubTextarea;
let gDocView;
let gDocBrowser;
async function openPopup() {
let shown = BrowserTestUtils.waitForEvent(gMainView, "ViewShown");
@ -36,9 +38,10 @@ async function hidePopup() {
await hidden;
}
async function showSubView() {
let shown = BrowserTestUtils.waitForEvent(gSubView, "ViewShown");
gPanelMultiView.showSubView(gSubView);
async function showSubView(view = gSubView) {
let shown = BrowserTestUtils.waitForEvent(view, "ViewShown");
// We must show with an anchor so the Back button is generated.
gPanelMultiView.showSubView(view, gMainButton1);
await shown;
}
@ -74,6 +77,8 @@ add_task(async function setup() {
gMainButton1 = document.createXULElement("button");
gMainButton1.id = "gMainButton1";
gMainView.appendChild(gMainButton1);
// We use this for anchoring subviews, so it must have a label.
gMainButton1.setAttribute("label", "gMainButton1");
gMainMenulist = document.createXULElement("menulist");
gMainMenulist.id = "gMainMenulist";
gMainView.appendChild(gMainMenulist);
@ -111,6 +116,18 @@ add_task(async function setup() {
gSubView.appendChild(gSubTextarea);
gSubTextarea.value = "value";
gDocView = document.createXULElement("panelview");
gDocView.id = "testDocView";
gPanelMultiView.appendChild(gDocView);
gDocBrowser = document.createXULElement("browser");
gDocBrowser.id = "gDocBrowser";
gDocBrowser.setAttribute("type", "content");
gDocBrowser.setAttribute("src",
'data:text/html,<textarea id="docTextarea">value</textarea><button id="docButton"></button>');
gDocBrowser.setAttribute("width", 100);
gDocBrowser.setAttribute("height", 100);
gDocView.appendChild(gDocBrowser);
registerCleanupFunction(() => {
gAnchor.remove();
gPanel.remove();
@ -270,3 +287,49 @@ add_task(async function testActivation() {
checkActivated(gMainButton1, () => EventUtils.synthesizeKey("KEY_Enter", {code: "NumpadEnter"}), "pressing numpad enter");
await hidePopup();
});
// Test that keyboard activation works for buttons responding to mousedown
// events (instead of command or click). The Library button does this, for
// example.
add_task(async function testActivationMousedown() {
await openPopup();
await expectFocusAfterKey("ArrowDown", gMainButton1);
let activated = false;
gMainButton1.onmousedown = function() { activated = true; };
EventUtils.synthesizeKey(" ");
ok(activated, "mousedown activated after space");
gMainButton1.onmousedown = null;
await hidePopup();
});
// Test that tab and the arrow keys aren't overridden in embedded documents.
add_task(async function testTabArrowsBrowser() {
await openPopup();
await showSubView(gDocView);
let backButton = gDocView.querySelector(".subviewbutton-back");
backButton.id = "docBack";
await expectFocusAfterKey("Tab", backButton);
let doc = gDocBrowser.contentDocument;
// Documents don't have an id property, but expectFocusAfterKey wants one.
doc.id = "doc";
await expectFocusAfterKey("Tab", doc);
// Make sure tab/arrows aren't overridden within the embedded document.
let textarea = doc.getElementById("docTextarea");
// Tab should really focus the textarea, but default tab handling seems to
// skip everything inside the browser element when run in this test. This
// behaves as expected in real panels, though. Force focus to the textarea
// and then test from there.
textarea.focus();
is(doc.activeElement, textarea, "textarea focused");
is(textarea.selectionStart, 0, "selectionStart initially 0");
EventUtils.synthesizeKey("KEY_ArrowRight");
is(textarea.selectionStart, 1, "selectionStart 1 after ArrowRight");
EventUtils.synthesizeKey("KEY_ArrowLeft");
is(textarea.selectionStart, 0, "selectionStart 0 after ArrowLeft");
is(doc.activeElement, textarea, "textarea still focused");
let docButton = doc.getElementById("docButton");
expectFocusAfterKey("Tab", docButton);
// Make sure tab leaves the document and reaches the Back button.
expectFocusAfterKey("Tab", backButton);
await hidePopup();
});

Просмотреть файл

@ -37,15 +37,15 @@ class CompatibilityWarning extends PureComponent {
let localizationId, statusClassName;
switch (status) {
case COMPATIBILITY_STATUS.TOO_OLD:
statusClassName = "js-compatibility-warning-too-old";
statusClassName = "qa-compatibility-warning-too-old";
localizationId = "about-debugging-browser-version-too-old";
break;
case COMPATIBILITY_STATUS.TOO_RECENT:
statusClassName = "js-compatibility-warning-too-recent";
statusClassName = "qa-compatibility-warning-too-recent";
localizationId = "about-debugging-browser-version-too-recent";
break;
case COMPATIBILITY_STATUS.TOO_OLD_67_DEBUGGER:
statusClassName = "js-compatibility-warning-too-old-67-debugger";
statusClassName = "qa-compatibility-warning-too-old-67-debugger";
localizationId = "about-debugging-browser-version-too-old-67-debugger";
break;
}
@ -70,7 +70,7 @@ class CompatibilityWarning extends PureComponent {
},
dom.p(
{
className: `js-compatibility-warning ${statusClassName}`,
className: `qa-compatibility-warning ${statusClassName}`,
},
localizationId,
),

Просмотреть файл

@ -40,7 +40,7 @@ class ConnectionPromptSetting extends PureComponent {
},
dom.button(
{
className: `${ className } default-button js-connection-prompt-toggle-button`,
className: `${ className } default-button qa-connection-prompt-toggle-button`,
onClick: () => this.onToggleClick(),
},
localizedState

Просмотреть файл

@ -37,7 +37,7 @@ class ExtensionDebugSetting extends PureComponent {
{
type: "checkbox",
id: "extension-debug-setting-input",
className: "default-checkbox js-extension-debug-checkbox",
className: "default-checkbox qa-extension-debug-checkbox",
checked: extensionDebugEnabled,
onChange: () => this.onToggle(),
}

Просмотреть файл

@ -34,12 +34,12 @@ class ProfilerDialog extends PureComponent {
return dom.div(
{
className: "profiler-dialog__mask js-profiler-dialog-mask",
className: "profiler-dialog__mask qa-profiler-dialog-mask",
onClick: () => this.hide(),
},
dom.article(
{
className: "profiler-dialog__inner js-profiler-dialog",
className: "profiler-dialog__inner qa-profiler-dialog",
onClick: e => e.stopPropagation(),
},
dom.header(
@ -59,7 +59,7 @@ class ProfilerDialog extends PureComponent {
),
dom.button(
{
className: "ghost-button js-profiler-dialog-close",
className: "ghost-button qa-profiler-dialog-close",
onClick: () => this.hide(),
},
dom.img(

Просмотреть файл

@ -66,7 +66,7 @@ class RuntimeActions extends PureComponent {
},
dom.button(
{
className: "default-button js-profile-runtime-button",
className: "default-button qa-profile-runtime-button",
onClick: () => this.onProfilerButtonClick(),
},
"about-debugging-runtime-profile-button2"

Просмотреть файл

@ -49,7 +49,7 @@ class RuntimeInfo extends PureComponent {
},
dom.label(
{
className: "js-runtime-name runtime-info__title",
className: "qa-runtime-name runtime-info__title",
},
`${ name } (${ version })`
)

Просмотреть файл

@ -147,7 +147,7 @@ class RuntimePage extends PureComponent {
return dom.article(
{
className: "page js-runtime-page",
className: "page qa-runtime-page",
},
RuntimeInfo({ ...runtimeDetails.info, runtimeId, dispatch }),
RuntimeActions({ dispatch, runtimeId, runtimeDetails }),

Просмотреть файл

@ -32,7 +32,7 @@ class ServiceWorkersWarning extends PureComponent {
},
dom.p(
{
className: "js-service-workers-warning",
className: "qa-service-workers-warning",
},
"about-debugging-runtime-service-workers-not-compatible",
),

Просмотреть файл

@ -108,7 +108,7 @@ class ConnectPage extends PureComponent {
{
className:
"default-button connect-page__usb-section__heading__toggle " +
"js-connect-usb-toggle-button",
"qa-connect-usb-toggle-button",
disabled,
onClick: () => this.onToggleUSBClick(),
},
@ -166,7 +166,7 @@ class ConnectPage extends PureComponent {
},
dom.aside(
{
className: "js-connect-usb-disabled-message",
className: "qa-connect-usb-disabled-message",
},
"Enabling this will download and add the required Android USB debugging " +
"components to Firefox."
@ -199,7 +199,7 @@ class ConnectPage extends PureComponent {
render() {
return dom.article(
{
className: "page connect-page js-connect-page",
className: "page connect-page qa-connect-page",
},
Localized(
{

Просмотреть файл

@ -108,7 +108,7 @@ class NetworkLocationsForm extends PureComponent {
),
dom.input({
id: "about-debugging-network-locations-host-input",
className: "default-input js-network-form-input",
className: "default-input qa-network-form-input",
placeholder: "localhost:6080",
type: "text",
value: this.state.value,
@ -123,7 +123,7 @@ class NetworkLocationsForm extends PureComponent {
},
dom.button(
{
className: "primary-button js-network-form-submit-button",
className: "primary-button qa-network-form-submit-button",
},
"Add"
)

Просмотреть файл

@ -28,12 +28,12 @@ class NetworkLocationsList extends PureComponent {
this.props.networkLocations.map(location =>
dom.li(
{
className: "network-location js-network-location",
className: "network-location qa-network-location",
key: location,
},
dom.span(
{
className: "ellipsis-text js-network-location-value",
className: "ellipsis-text qa-network-location-value",
},
location
),
@ -43,7 +43,7 @@ class NetworkLocationsList extends PureComponent {
},
dom.button(
{
className: "default-button js-network-location-remove-button",
className: "default-button qa-network-location-remove-button",
onClick: () => {
this.props.dispatch(Actions.removeNetworkLocation(location));
},

Просмотреть файл

@ -56,7 +56,7 @@ class DebugTargetItem extends PureComponent {
renderIcon() {
return dom.img({
className: "debug-target-item__icon js-debug-target-item-icon",
className: "debug-target-item__icon qa-debug-target-item-icon",
src: this.props.target.icon,
});
}
@ -74,7 +74,7 @@ class DebugTargetItem extends PureComponent {
render() {
return dom.li(
{
className: "card debug-target-item js-debug-target-item",
className: "card debug-target-item qa-debug-target-item",
},
this.renderIcon(),
this.renderName(),

Просмотреть файл

@ -37,7 +37,7 @@ class DebugTargetList extends PureComponent {
},
dom.p(
{
className: "js-debug-target-list-empty",
className: "qa-debug-target-list-empty",
},
"Nothing yet."
)
@ -57,7 +57,7 @@ class DebugTargetList extends PureComponent {
? this.renderEmptyList()
: dom.ul(
{
className: "debug-target-list js-debug-target-list",
className: "debug-target-list qa-debug-target-list",
},
targets.map((target, key) =>
DebugTargetItem({

Просмотреть файл

@ -88,12 +88,12 @@ class DebugTargetPane extends PureComponent {
return dom.section(
{
className: "js-debug-target-pane",
className: "qa-debug-target-pane",
},
dom.a(
{
className: "undecorated-link debug-target-pane__title " +
"js-debug-target-pane-title",
"qa-debug-target-pane-title",
title,
onClick: e => this.toggleCollapsibility(),
},
@ -117,7 +117,7 @@ class DebugTargetPane extends PureComponent {
),
dom.div(
{
className: "debug-target-pane__collapsable js-debug-target-pane__collapsable" +
className: "debug-target-pane__collapsable qa-debug-target-pane__collapsable" +
(isCollapsed ? " debug-target-pane__collapsable--collapsed" : ""),
ref: this.collapsableRef,
},

Просмотреть файл

@ -124,7 +124,7 @@ class ExtensionDetail extends PureComponent {
const link = dom.a(
{
className: "js-manifest-url",
className: "qa-manifest-url",
href: manifestURL,
target: "_blank",
},

Просмотреть файл

@ -41,7 +41,7 @@ class InspectAction extends PureComponent {
dom.button(
{
onClick: e => this.inspect(),
className: "default-button js-debug-target-inspect-button",
className: "default-button qa-debug-target-inspect-button",
disabled,
},
"Inspect"

Просмотреть файл

@ -74,7 +74,7 @@ class ServiceWorkerAction extends PureComponent {
dom.span(
{
className:
`service-worker-action__status js-worker-status ${ statusClassName }`,
`service-worker-action__status qa-worker-status ${ statusClassName }`,
},
status
)

Просмотреть файл

@ -67,7 +67,7 @@ class ServiceWorkerAdditionalActions extends PureComponent {
_renderPushButton() {
return this._renderButton({
className: "default-button default-button--micro js-push-button",
className: "default-button default-button--micro qa-push-button",
disabled: this.props.runtimeDetails.isMultiE10s,
key: "service-worker-push-button",
labelId: "about-debugging-worker-action-push",
@ -77,7 +77,7 @@ class ServiceWorkerAdditionalActions extends PureComponent {
_renderStartButton() {
return this._renderButton({
className: "default-button default-button--micro js-start-button",
className: "default-button default-button--micro qa-start-button",
disabled: this.props.runtimeDetails.isMultiE10s,
key: "service-worker-start-button",
labelId: "about-debugging-worker-action-start",
@ -87,7 +87,7 @@ class ServiceWorkerAdditionalActions extends PureComponent {
_renderUnregisterButton() {
return this._renderButton({
className: "default-button default-button--micro js-unregister-button",
className: "default-button default-button--micro qa-unregister-button",
key: "service-worker-unregister-button",
labelId: "about-debugging-worker-action-unregister",
onClick: this.unregister.bind(this),

Просмотреть файл

@ -68,7 +68,7 @@ class TemporaryExtensionAdditionalActions extends PureComponent {
dom.button(
{
className: "default-button default-button--micro " +
"js-temporary-extension-reload-button",
"qa-temporary-extension-reload-button",
onClick: e => this.reload(),
},
"Reload",
@ -81,7 +81,7 @@ class TemporaryExtensionAdditionalActions extends PureComponent {
dom.button(
{
className: "default-button default-button--micro " +
"js-temporary-extension-remove-button",
"qa-temporary-extension-remove-button",
onClick: e => this.remove(),
},
"Remove",

Просмотреть файл

@ -36,13 +36,13 @@ class TemporaryExtensionDetail extends PureComponent {
{
id: "about-debugging-tmp-extension-temporary-id",
a: dom.a({
className: "js-temporary-id-link",
className: "qa-temporary-id-link",
href: TEMP_ID_DOC_URL,
target: "_blank",
}),
},
dom.div({
className: "js-temporary-id-message",
className: "qa-temporary-id-message",
}),
);
}

Просмотреть файл

@ -53,7 +53,7 @@ class TemporaryExtensionInstallSection extends PureComponent {
return Message(
{
level: MESSAGE_LEVEL.ERROR,
className: "js-tmp-extension-install-error",
className: "qa-tmp-extension-install-error",
isCloseable: true,
},
Localized(

Просмотреть файл

@ -38,7 +38,7 @@ class TemporaryExtensionInstaller extends PureComponent {
dom.button(
{
className:
`${ className } default-button js-temporary-extension-install-button`,
`${ className } default-button qa-temporary-extension-install-button`,
onClick: e => this.install(),
},
"Load Temporary Add-on…"

Просмотреть файл

@ -49,7 +49,7 @@ class WorkerDetail extends PureComponent {
FieldPair(
{
className: isListening ?
"js-worker-fetch-listening" : "js-worker-fetch-not-listening",
"qa-worker-fetch-listening" : "qa-worker-fetch-not-listening",
label: "Fetch",
slug: "fetch",
value: "about-debugging-worker-fetch-value",
@ -72,7 +72,7 @@ class WorkerDetail extends PureComponent {
label: "Push Service",
value: dom.span(
{
className: "js-worker-push-service-value",
className: "qa-worker-push-service-value",
},
pushServiceEndpoint,
),

Просмотреть файл

@ -79,7 +79,7 @@ class Message extends PureComponent {
return dom.aside(
{
className: `message message--level-${level} js-message` +
className: `message message--level-${level} qa-message` +
(className ? ` ${ className }` : ""),
},
dom.img(

Просмотреть файл

@ -30,7 +30,7 @@ class RefreshDevicesButton extends PureComponent {
{ id: "about-debugging-refresh-usb-devices-button" },
dom.button(
{
className: "default-button js-refresh-devices-button",
className: "default-button qa-refresh-devices-button",
disabled: this.props.isScanning,
onClick: () => this.refreshDevices(),
},

Просмотреть файл

@ -55,7 +55,7 @@ class Sidebar extends PureComponent {
},
dom.span(
{
className: "js-sidebar-usb-status",
className: "qa-sidebar-usb-status",
},
localizationId
)
@ -72,7 +72,7 @@ class Sidebar extends PureComponent {
},
dom.aside(
{
className: "sidebar__label js-sidebar-no-devices",
className: "sidebar__label qa-sidebar-no-devices",
},
"No devices discovered"
)

Просмотреть файл

@ -45,7 +45,7 @@ class SidebarItem extends PureComponent {
)
: Link(
{
className: "sidebar-item__link js-sidebar-link",
className: "sidebar-item__link qa-sidebar-link",
to,
},
children,
@ -60,10 +60,10 @@ class SidebarItem extends PureComponent {
return dom.li(
{
className: "sidebar-item js-sidebar-item" +
className: "sidebar-item qa-sidebar-item" +
(className ? ` ${className}` : "") +
(isSelected ?
" sidebar-item--selected js-sidebar-item-selected" :
" sidebar-item--selected qa-sidebar-item-selected" :
""
) +
(to ? " sidebar-item--selectable" : ""),

Просмотреть файл

@ -51,7 +51,7 @@ class SidebarRuntimeItem extends PureComponent {
},
dom.button(
{
className: "default-button default-button--micro js-connect-button",
className: "default-button default-button--micro qa-connect-button",
disabled: isConnecting,
onClick: () => {
const { dispatch, runtimeId } = this.props;

Просмотреть файл

@ -59,7 +59,7 @@ async function testState({ chromeEnabled, debuggerRemoteEnable, isEnabledAtIniti
await installExtensions(document);
info("Check the status of extension debug setting checkbox and inspect buttons");
const checkbox = document.querySelector(".js-extension-debug-checkbox");
const checkbox = document.querySelector(".qa-extension-debug-checkbox");
ok(checkbox, "Extension debug setting checkbox exists");
is(checkbox.checked, isEnabledAtInitial, "The state of checkbox is correct");
assertInspectButtons(isEnabledAtInitial, document);
@ -90,7 +90,7 @@ function assertInspectButtons(shouldBeEnabled, document) {
function assertInspectButtonsOnCategory(shouldBeEnabled, category, document) {
const pane = getDebugTargetPane(category, document);
const buttons = pane.querySelectorAll(".js-debug-target-inspect-button");
const buttons = pane.querySelectorAll(".qa-debug-target-inspect-button");
ok([...buttons].every(b => b.disabled !== shouldBeEnabled),
`disabled attribute should be ${ !shouldBeEnabled } on ${ category }`);
}

Просмотреть файл

@ -32,9 +32,9 @@ add_task(async function() {
info("Check the status of extension debug setting checkbox and inspect buttons");
await connectToRuntime("Fancy Phone", document);
await selectRuntime("Fancy Phone", "Lorem ipsum", document);
ok(!document.querySelector(".js-extension-debug-checkbox"),
ok(!document.querySelector(".qa-extension-debug-checkbox"),
"Extension debug setting checkbox should not exist");
const buttons = document.querySelectorAll(".js-debug-target-inspect-button");
const buttons = document.querySelectorAll(".qa-debug-target-inspect-button");
ok([...buttons].every(b => !b.disabled), "All inspect buttons should be enabled");
await removeTab(tab);

Просмотреть файл

@ -19,7 +19,7 @@ add_task(async function() {
const { document, tab, window } = await openAboutDebugging();
await selectThisFirefoxPage(document, window.AboutDebugging.store);
const usbStatusElement = document.querySelector(".js-sidebar-usb-status");
const usbStatusElement = document.querySelector(".qa-sidebar-usb-status");
info("Install ADB");
adbAddon.install("internal");
@ -30,7 +30,7 @@ add_task(async function() {
await waitUntil(() => findDebugTargetByText(ABD_ADDON_NAME, document));
const adbExtensionItem = findDebugTargetByText(ABD_ADDON_NAME, document);
const manifestUrlElement = adbExtensionItem.querySelector(".js-manifest-url");
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");

Просмотреть файл

@ -47,7 +47,7 @@ add_task(async function() {
async function testAddonsOnMockedRemoteClient(remoteClient, firefoxClient, document) {
const extensionPane = getDebugTargetPane("Extensions", document);
info("Check an empty target pane message is displayed");
ok(extensionPane.querySelector(".js-debug-target-list-empty"),
ok(extensionPane.querySelector(".qa-debug-target-list-empty"),
"Extensions list is empty");
info("Add an extension to the remote client");
@ -56,7 +56,7 @@ async function testAddonsOnMockedRemoteClient(remoteClient, firefoxClient, docum
remoteClient._eventEmitter.emit("addonListChanged");
info("Wait until the extension appears");
await waitUntil(() => !extensionPane.querySelector(".js-debug-target-list-empty"));
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");

Просмотреть файл

@ -27,7 +27,7 @@ add_task(async function() {
info("Click on the reload button for the temporary extension");
const reloadButton =
originalTarget.querySelector(".js-temporary-extension-reload-button");
originalTarget.querySelector(".qa-temporary-extension-reload-button");
reloadButton.click();
info("Wait until the debug target with the original extension name disappears");
@ -41,7 +41,7 @@ add_task(async function() {
info("Click on the remove button for the temporary extension");
const removeButton =
updatedTarget.querySelector(".js-temporary-extension-remove-button");
updatedTarget.querySelector(".qa-temporary-extension-remove-button");
removeButton.click();
info("Wait until the debug target with the updated extension name disappears");
@ -63,10 +63,10 @@ add_task(async function() {
await waitUntil(() => findDebugTargetByText(PACKAGED_EXTENSION_NAME, document));
const target = findDebugTargetByText(PACKAGED_EXTENSION_NAME, document);
const reloadButton = target.querySelector(".js-temporary-extension-reload-button");
const reloadButton = target.querySelector(".qa-temporary-extension-reload-button");
ok(!reloadButton, "No reload button displayed for a regularly installed extension");
const removeButton = target.querySelector(".js-temporary-extension-remove-button");
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);

Просмотреть файл

@ -24,10 +24,10 @@ add_task(async function() {
const target = findDebugTargetByText(EXTENSION_NAME, document);
const message = target.querySelector(".js-temporary-id-message");
const message = target.querySelector(".qa-temporary-id-message");
ok(!!message, "Temporary id message is displayed for temporary extensions");
const link = target.querySelector(".js-temporary-id-link");
const link = target.querySelector(".qa-temporary-id-link");
ok(!!link, "Temporary id link is displayed for temporary extensions");
await removeTemporaryExtension(EXTENSION_NAME, document);
@ -48,7 +48,7 @@ add_task(async function() {
await waitUntil(() => findDebugTargetByText(PACKAGED_EXTENSION_NAME, document));
const target = findDebugTargetByText(PACKAGED_EXTENSION_NAME, document);
const tmpIdMessage = target.querySelector(".js-temporary-id-message");
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);

Просмотреть файл

@ -31,7 +31,7 @@ add_task(async function testInvalidJsonExtension() {
await installTemporaryExtension(EXTENSION_PATH, EXTENSION_NAME, document);
info("Wait until the error message disappears");
await waitUntil(() => !document.querySelector(".js-tmp-extension-install-error"));
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));
@ -62,9 +62,9 @@ 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(".js-temporary-extension-install-button").click();
document.querySelector(".qa-temporary-extension-install-button").click();
info("Wait until the install error message appears");
await waitUntil(() => document.querySelector(".js-tmp-extension-install-error"));
return document.querySelector(".js-tmp-extension-install-error");
await waitUntil(() => document.querySelector(".qa-tmp-extension-install-error"));
return document.querySelector(".qa-tmp-extension-install-error");
}

Просмотреть файл

@ -27,7 +27,7 @@ add_task(async function() {
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(".js-temporary-extension-reload-button");
const reloadButton = target.querySelector(".qa-temporary-extension-reload-button");
reloadButton.click();
await waitForError;
ok(target.querySelector(".qa-temporary-extension-reload-error"),
@ -43,7 +43,7 @@ add_task(async function() {
"The error message of reloading disappears");
info("Click on the remove button for the temporary extension");
const removeButton = target.querySelector(".js-temporary-extension-remove-button");
const removeButton = target.querySelector(".qa-temporary-extension-remove-button");
removeButton.click();
info("Wait until the debug target with the extension disappears");

Просмотреть файл

@ -27,7 +27,7 @@ add_task(async function() {
await waitUntil(() => findDebugTargetByText(EXTENSION_NAME, document));
const target = findDebugTargetByText(EXTENSION_NAME, document);
const warningMessage = target.querySelector(".js-message");
const warningMessage = target.querySelector(".qa-message");
ok(!!warningMessage, "A warning message is displayed for the installed addon");
const warningText = warningMessage.textContent;

Просмотреть файл

@ -16,7 +16,7 @@ add_task(async function() {
await selectConnectPage(document);
let networkLocations = document.querySelectorAll(".js-network-location");
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");
@ -26,13 +26,13 @@ add_task(async function() {
info("Wait until the new network location is visible in the list");
addNetworkLocation(TEST_NETWORK_LOCATION, document);
await waitUntil(() => document.querySelectorAll(".js-network-location").length === 1);
await waitUntil(() => document.querySelectorAll(".qa-network-location").length === 1);
await waitUntil(() =>
!document.querySelector(".qa-connect-page__network-form__error-message"));
networkLocations = document.querySelectorAll(".js-network-location");
networkLocations = document.querySelectorAll(".qa-network-location");
const networkLocationValue =
networkLocations[0].querySelector(".js-network-location-value");
networkLocations[0].querySelector(".qa-network-location-value");
is(networkLocationValue.textContent, TEST_NETWORK_LOCATION,
"Added network location has the expected value");
@ -43,7 +43,7 @@ add_task(async function() {
info("Wait until the new network location is removed from the list");
removeNetworkLocation(TEST_NETWORK_LOCATION, document);
await waitUntil(() => document.querySelectorAll(".js-network-location").length === 0);
await waitUntil(() => document.querySelectorAll(".qa-network-location").length === 0);
await removeTab(tab);
});
@ -51,14 +51,14 @@ add_task(async function() {
function addNetworkLocation(location, document) {
info("Setting a value in the network form input");
const networkLocationInput =
document.querySelector(".js-network-form-input");
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(".js-network-form-submit-button");
document.querySelector(".qa-network-form-submit-button");
networkLocationSubmitButton.click();
}
@ -68,14 +68,14 @@ function removeNetworkLocation(location, document) {
info("Click on the remove button for the provided network location");
const removeButton =
networkLocation.querySelector(".js-network-location-remove-button");
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(".js-network-location");
const networkLocations = document.querySelectorAll(".qa-network-location");
return [...networkLocations].find(element => {
return element.querySelector(".js-network-location-value").textContent === location;
return element.querySelector(".qa-network-location-value").textContent === location;
});
}

Просмотреть файл

@ -21,13 +21,13 @@ add_task(async function() {
await selectConnectPage(document);
info("Wait until Connect page is displayed");
await waitUntil(() => document.querySelector(".js-connect-page"));
await waitUntil(() => document.querySelector(".qa-connect-page"));
info("Check that by default USB devices are disabled");
const usbDisabledMessage = document.querySelector(".js-connect-usb-disabled-message");
const usbDisabledMessage = document.querySelector(".qa-connect-usb-disabled-message");
ok(usbDisabledMessage, "A message about enabling USB devices is rendered");
const usbToggleButton = document.querySelector(".js-connect-usb-toggle-button");
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");
@ -37,7 +37,7 @@ add_task(async function() {
info("Wait until the toggle button text is updated");
await waitUntil(() => usbToggleButton.textContent.includes("Disable"));
ok(!document.querySelector(".js-connect-usb-disabled-message"),
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");
@ -57,7 +57,7 @@ add_task(async function() {
info("Wait until the toggle button text is updated");
await waitUntil(() => usbToggleButton.textContent.includes("Enable"));
ok(document.querySelector(".js-connect-usb-disabled-message"),
ok(document.querySelector(".qa-connect-usb-disabled-message"),
"The message about enabling USB devices is rendered again");
await stopAdbProcess();

Просмотреть файл

@ -31,14 +31,14 @@ add_task(async function() {
info("Check whether connection prompt toggle button exists");
let connectionPromptToggleButton =
document.querySelector(".js-connection-prompt-toggle-button");
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(".js-connection-prompt-toggle-button");
document.querySelector(".qa-connection-prompt-toggle-button");
connectionPromptToggleButton.click();
info("Wait until the toggle button text is updated");
await waitUntil(() => connectionPromptToggleButton.textContent.includes("Enable"));

Просмотреть файл

@ -33,12 +33,12 @@ async function assertDebugTargetCollapsed(paneEl, title) {
info("Check debug target is collapsed");
// check list height
const targetEl = paneEl.querySelector(".js-debug-target-pane__collapsable");
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(".js-debug-target-pane-title");
const titleEl = paneEl.querySelector(".qa-debug-target-pane-title");
const expectedTitle =
`${ title } (${ targetEl.querySelectorAll(".js-debug-target-item").length })`;
`${ title } (${ targetEl.querySelectorAll(".qa-debug-target-item").length })`;
is(titleEl.textContent, expectedTitle, "Collapsed title is correct");
}
@ -46,12 +46,12 @@ async function assertDebugTargetExpanded(paneEl, title) {
info("Check debug target is expanded");
// check list height
const targetEl = paneEl.querySelector(".js-debug-target-pane__collapsable");
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(".js-debug-target-pane-title");
const titleEl = paneEl.querySelector(".qa-debug-target-pane-title");
const expectedTitle =
`${ title } (${ targetEl.querySelectorAll(".js-debug-target-item").length })`;
`${ title } (${ targetEl.querySelectorAll(".qa-debug-target-item").length })`;
is(titleEl.textContent, expectedTitle, "Expanded title is correct");
}

Просмотреть файл

@ -24,35 +24,35 @@ add_task(async function() {
info("Check that the temporary extensions pane is empty");
const temporaryExtensionPane = getDebugTargetPane("Temporary Extensions", document);
ok(!temporaryExtensionPane.querySelector(".js-debug-target-item"),
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(".js-debug-target-list-empty"),
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(".js-debug-target-item"));
await waitUntil(() => temporaryExtensionPane.querySelector(".qa-debug-target-item"));
info("Check the empty target pane message is no longer displayed");
ok(!temporaryExtensionPane.querySelector(".js-debug-target-list-empty"),
ok(!temporaryExtensionPane.querySelector(".qa-debug-target-list-empty"),
"The empty target list message is no longer displayed");
const temporaryExtensionItem =
temporaryExtensionPane.querySelector(".js-debug-target-item");
temporaryExtensionPane.querySelector(".qa-debug-target-item");
ok(temporaryExtensionItem, "Temporary Extensions pane now shows debug target");
info("Remove the temporary extension");
temporaryExtensionItem.querySelector(".js-temporary-extension-remove-button").click();
temporaryExtensionItem.querySelector(".qa-temporary-extension-remove-button").click();
info("Wait until the debug target item disappears");
await waitUntil(() => !temporaryExtensionPane.querySelector(".js-debug-target-item"));
await waitUntil(() => !temporaryExtensionPane.querySelector(".qa-debug-target-item"));
info("Check the empty target pane message is displayed again");
ok(temporaryExtensionPane.querySelector(".js-debug-target-list-empty"),
ok(temporaryExtensionPane.querySelector(".qa-debug-target-list-empty"),
"An empty target list message is displayed again");
await removeTab(tab);

Просмотреть файл

@ -18,7 +18,7 @@ add_task(async function() {
await selectThisFirefoxPage(document, window.AboutDebugging.store);
const connectSidebarItem = findSidebarItemByText("Setup", document);
const connectLink = connectSidebarItem.querySelector(".js-sidebar-link");
const connectLink = connectSidebarItem.querySelector(".qa-sidebar-link");
ok(connectSidebarItem, "Found the Connect sidebar item");
info("Open devtools on the current about:debugging tab");
@ -34,7 +34,7 @@ add_task(async function() {
await waitForDispatch(store, "UNWATCH_RUNTIME_SUCCESS");
info("Wait until Connect page is displayed");
await waitUntil(() => document.querySelector(".js-connect-page"));
await waitUntil(() => document.querySelector(".qa-connect-page"));
const markupViewElement = inspector.panelDoc.getElementById("markup-box");
ok(markupViewElement, "Inspector is still rendered");

Просмотреть файл

@ -60,7 +60,7 @@ add_task(async function() {
function clickInspectButton(inspectionTarget, doc) {
const target = findDebugTargetByText(inspectionTarget, doc);
const button = target.querySelector(".js-debug-target-inspect-button");
const button = target.querySelector(".qa-debug-target-inspect-button");
button.click();
}

Просмотреть файл

@ -14,14 +14,14 @@ add_task(async function() {
await selectThisFirefoxPage(document, window.AboutDebugging.store);
const { devtoolsDocument, devtoolsTab, devtoolsWindow } =
await openAboutDevtoolsToolbox(document, tab, window, "about:home");
const targetInfoHeader = devtoolsDocument.querySelector(".js-debug-target-info");
const targetInfoHeader = devtoolsDocument.querySelector(".qa-debug-target-info");
ok(targetInfoHeader.textContent.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(".js-error-page"));
await waitUntil(() => devtoolsWindow.document.querySelector(".qa-error-page"));
info("closing the toolbox");
await removeTab(devtoolsTab);

Просмотреть файл

@ -27,7 +27,7 @@ add_task(async function() {
await waitUntil(() => findDebugTargetByText(EXTENSION_NAME, document));
const target = findDebugTargetByText(EXTENSION_NAME, document);
const warningMessage = target.querySelector(".js-message");
const warningMessage = target.querySelector(".qa-message");
ok(!!warningMessage, "A warning message is displayed for the installed addon");
const button = warningMessage.querySelector(".qa-message-button-close");
@ -36,7 +36,7 @@ add_task(async function() {
info("Closing the message and waiting for it to disappear");
button.click();
await waitUntil(() => {
return target.querySelector(".js-message") === null;
return target.querySelector(".qa-message") === null;
});
await removeTemporaryExtension(EXTENSION_NAME, document);

Просмотреть файл

@ -23,12 +23,12 @@ add_task(async function() {
await selectThisFirefoxPage(document, AboutDebugging.store);
const connectSidebarItem = findSidebarItemByText("Setup", document);
const connectLink = connectSidebarItem.querySelector(".js-sidebar-link");
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(".js-sidebar-link");
const thisFirefoxLink = thisFirefoxSidebarItem.querySelector(".qa-sidebar-link");
ok(thisFirefoxSidebarItem, "Found the ThisFirefox sidebar item");
ok(isSidebarItemSelected(thisFirefoxSidebarItem),
"ThisFirefox sidebar item is selected by default");
@ -44,11 +44,11 @@ add_task(async function() {
connectLink.click();
info("Wait until Connect page is displayed");
await waitUntil(() => document.querySelector(".js-connect-page"));
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(".js-runtime-page"), "Runtime page no longer rendered");
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 });
@ -61,10 +61,10 @@ add_task(async function() {
await requestsSuccess;
info("Wait until ThisFirefox page is displayed");
await waitUntil(() => document.querySelector(".js-runtime-page"));
await waitUntil(() => document.querySelector(".qa-runtime-page"));
ok(isSidebarItemSelected(thisFirefoxSidebarItem),
"ThisFirefox sidebar item is selected again");
ok(!document.querySelector(".js-connect-page"), "Connect page no longer rendered");
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));
@ -87,5 +87,5 @@ add_task(async function() {
});
function isSidebarItemSelected(item) {
return item.classList.contains("js-sidebar-item-selected");
return item.classList.contains("qa-sidebar-item-selected");
}

Просмотреть файл

@ -56,12 +56,12 @@ async function testRemoteClientPersistConnection(mocks,
info("Wait until the remote runtime appears as connected");
await waitUntil(() => {
const sidebarItem = findSidebarItemByText(sidebarName, document);
return sidebarItem && !sidebarItem.querySelector(".js-connect-button");
return sidebarItem && !sidebarItem.querySelector(".qa-connect-button");
});
info("Wait until the remote runtime page is selected");
await waitUntil(() => {
const runtimeInfo = document.querySelector(".js-runtime-name");
const runtimeInfo = document.querySelector(".qa-runtime-name");
return runtimeInfo && runtimeInfo.textContent.includes(runtimeName);
});

Просмотреть файл

@ -25,9 +25,9 @@ add_task(async function() {
assertDialogVisible(document);
info("Click on the close button and wait until the dialog disappears");
const closeDialogButton = document.querySelector(".js-profiler-dialog-close");
const closeDialogButton = document.querySelector(".qa-profiler-dialog-close");
closeDialogButton.click();
await waitUntil(() => !document.querySelector(".js-profiler-dialog"));
await waitUntil(() => !document.querySelector(".qa-profiler-dialog"));
assertDialogHidden(document);
info("Open the profiler dialog again");
@ -35,9 +35,9 @@ add_task(async function() {
assertDialogVisible(document);
info("Click on the mask element and wait until the dialog disappears");
const mask = document.querySelector(".js-profiler-dialog-mask");
const mask = document.querySelector(".qa-profiler-dialog-mask");
EventUtils.synthesizeMouse(mask, 5, 5, {}, window);
await waitUntil(() => !document.querySelector(".js-profiler-dialog"));
await waitUntil(() => !document.querySelector(".qa-profiler-dialog"));
assertDialogHidden(document);
info("Open the profiler dialog again");
@ -46,7 +46,7 @@ add_task(async function() {
info("Navigate to this-firefox and wait until the dialog disappears");
document.location.hash = "#/runtime/this-firefox";
await waitUntil(() => !document.querySelector(".js-profiler-dialog"));
await waitUntil(() => !document.querySelector(".qa-profiler-dialog"));
assertDialogHidden(document);
info("Select the remote runtime again, check the dialog is still hidden");
@ -57,11 +57,11 @@ add_task(async function() {
});
function assertDialogVisible(doc) {
ok(doc.querySelector(".js-profiler-dialog"), "Dialog is displayed");
ok(doc.querySelector(".js-profiler-dialog-mask"), "Dialog mask is displayed");
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(".js-profiler-dialog"), "Dialog is removed");
ok(!document.querySelector(".js-profiler-dialog-mask"), "Dialog mask is removed");
ok(!document.querySelector(".qa-profiler-dialog"), "Dialog is removed");
ok(!document.querySelector(".qa-profiler-dialog-mask"), "Dialog mask is removed");
}

Просмотреть файл

@ -35,7 +35,7 @@ add_task(async function() {
await selectRuntime(sidebarInfo.deviceName, runtimeDetails.info.name, document);
info("Check that runtime info is properly displayed");
const runtimeInfo = document.querySelector(".js-runtime-name");
const runtimeInfo = document.querySelector(".qa-runtime-name");
ok(runtimeInfo, "Runtime info is displayed");
const runtimeInfoText = runtimeInfo.textContent;
ok(runtimeInfoText.includes(runtimeDetails.info.name),

Просмотреть файл

@ -25,8 +25,8 @@ add_task(async function() {
info("Check 'This Firefox' route");
document.location.hash = "#/runtime/this-firefox";
await waitUntil(() => document.querySelector(".js-runtime-page"));
const infoLabel = document.querySelector(".js-runtime-name").textContent;
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");
@ -38,7 +38,7 @@ add_task(async function() {
info("Check 'Setup' page");
document.location.hash = "#/setup";
await waitUntil(() => document.querySelector(".js-connect-page"));
await waitUntil(() => document.querySelector(".qa-connect-page"));
ok(true, "Setup page has been shown");
is(
document.title,
@ -56,8 +56,8 @@ add_task(async function() {
await connectToRuntime("Fancy Phone", document);
// navigate to it via URL
document.location.hash = "#/runtime/1337id";
await waitUntil(() => document.querySelector(".js-runtime-page"));
const runtimeLabel = document.querySelector(".js-runtime-name").textContent;
await waitUntil(() => document.querySelector(".qa-runtime-page"));
const runtimeLabel = document.querySelector(".qa-runtime-name").textContent;
is(
document.title,
"Debugging - Runtime / 1337id",
@ -77,11 +77,11 @@ add_task(async function() {
info("Waiting for a non setup page to load");
document.location.hash = "#/runtime/this-firefox";
await waitUntil(() => document.querySelector(".js-runtime-page"));
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(".js-connect-page"));
await waitUntil(() => document.querySelector(".qa-connect-page"));
is(
document.title,
"Debugging - Setup",
@ -103,11 +103,11 @@ add_task(async function testOldAboutDebuggingRoutes() {
for (const route of routes) {
info("Move to setup page before testing the route");
document.location.hash = "#/setup";
await waitUntil(() => document.querySelector(".js-connect-page"));
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(".js-runtime-page"));
await waitUntil(() => document.querySelector(".qa-runtime-page"));
is(document.location.hash, "#/runtime/this-firefox",
`${route} was redirected to This Firefox`);
}

Просмотреть файл

@ -36,23 +36,23 @@ add_task(async function() {
info("Select the compatible runtime and check that no warning is displayed");
await selectRuntime(COMPATIBLE_DEVICE, COMPATIBLE_RUNTIME, document);
ok(!document.querySelector(".js-compatibility-warning"),
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(".js-compatibility-warning-too-old"),
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(".js-compatibility-warning-too-recent"),
ok(document.querySelector(".qa-compatibility-warning-too-recent"),
"Expected compatibility warning is displayed (too-recent)");
info("Select the runtime incompatible with Fx 67 " +
"and check that the debugger 67 warning is displayed");
await selectRuntime(DEBUGGER_67_DEVICE, DEBUGGER_67_RUNTIME, document);
ok(document.querySelector(".js-compatibility-warning-too-old-67-debugger"));
ok(document.querySelector(".qa-compatibility-warning-too-old-67-debugger"));
await removeTab(tab);
});

Просмотреть файл

@ -39,7 +39,7 @@ add_task(async function() {
disconnectRemoteRuntimeButton.click();
info("Wait until the runtime is disconnected");
await waitUntil(() => document.querySelector(".js-connect-button"));
await waitUntil(() => document.querySelector(".qa-connect-button"));
is(document.location.hash, DEFAULT_PAGE,
"Redirection to the default page (this-firefox)");

Просмотреть файл

@ -22,9 +22,9 @@ add_task(async function() {
await selectThisFirefoxPage(document, window.AboutDebugging.store);
info("Checking This Firefox");
ok(!document.querySelector(".js-connection-prompt-toggle-button"),
ok(!document.querySelector(".qa-connection-prompt-toggle-button"),
"This Firefox does not contain the connection prompt button");
ok(!document.querySelector(".js-profile-runtime-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");
@ -33,9 +33,9 @@ add_task(async function() {
mocks.emitUSBUpdate();
await connectToRuntime(USB_DEVICE_NAME, document);
await selectRuntime(USB_DEVICE_NAME, USB_APP_NAME, document);
ok(!!document.querySelector(".js-connection-prompt-toggle-button"),
ok(!!document.querySelector(".qa-connection-prompt-toggle-button"),
"Runtime contains the connection prompt button");
ok(!!document.querySelector(".js-profile-runtime-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");

Просмотреть файл

@ -61,7 +61,7 @@ add_task(async function testUsbClientDisconnected() {
info("Wait until the connect button for this runtime appears");
await waitUntil(() => {
const item = findSidebarItemByText(USB_DEVICE_NAME, document);
return item && item.querySelector(".js-connect-button");
return item && item.querySelector(".qa-connect-button");
});
is(document.location.hash, `#/runtime/this-firefox`,
@ -91,7 +91,7 @@ add_task(async function testNetworkClientDisconnected() {
info("Wait until the connect button for this runtime appears");
await waitUntil(() => {
const item = findSidebarItemByText(NETWORK_RUNTIME_HOST, document);
return item && item.querySelector(".js-connect-button");
return item && item.querySelector(".qa-connect-button");
});
is(document.location.hash, `#/runtime/this-firefox`,

Просмотреть файл

@ -32,7 +32,7 @@ add_task(async function() {
await selectRuntime(NETWORK_RUNTIME_HOST, NETWORK_RUNTIME_APP_NAME, document);
info("Check that the network runtime mock is properly displayed");
const thisFirefoxRuntimeInfo = document.querySelector(".js-runtime-name");
const thisFirefoxRuntimeInfo = document.querySelector(".qa-runtime-name");
ok(thisFirefoxRuntimeInfo, "Runtime info for this-firefox runtime is displayed");
const runtimeInfoText = thisFirefoxRuntimeInfo.textContent;

Просмотреть файл

@ -46,7 +46,7 @@ add_task(async function() {
info("Go to This Firefox again");
const thisFirefoxString = getThisFirefoxString(window);
const thisFirefoxSidebarItem = findSidebarItemByText(thisFirefoxString, document);
const thisFirefoxLink = thisFirefoxSidebarItem.querySelector(".js-sidebar-link");
const thisFirefoxLink = thisFirefoxSidebarItem.querySelector(".qa-sidebar-link");
info("Click on the ThisFirefox item in the sidebar");
const requestsSuccess = waitForRequestsSuccess(window.AboutDebugging.store);
thisFirefoxLink.click();
@ -55,7 +55,7 @@ add_task(async function() {
await requestsSuccess;
info("Check that the runtime info is rendered for This Firefox");
const thisFirefoxRuntimeInfo = document.querySelector(".js-runtime-name");
const thisFirefoxRuntimeInfo = document.querySelector(".qa-runtime-name");
ok(thisFirefoxRuntimeInfo, "Runtime info for this-firefox runtime is displayed");
const text = thisFirefoxRuntimeInfo.textContent;

Просмотреть файл

@ -38,8 +38,8 @@ async function testServiceWorkerFetchStatus(doc, url, workerUrl, isListening) {
const targetElement = await waitForServiceWorkerRunning(workerUrl, doc);
const expectedClassName = isListening ?
".js-worker-fetch-listening" :
".js-worker-fetch-not-listening";
".qa-worker-fetch-listening" :
".qa-worker-fetch-not-listening";
const fetchStatus = targetElement.querySelector(expectedClassName);
ok(!!fetchStatus, "Found the expected fetch status: " + expectedClassName);

Просмотреть файл

@ -55,14 +55,14 @@ async function testDebuggingSW(enableMultiE10sFn, disableMultiE10sFn) {
info("Wait until the service worker appears and is running");
await waitUntil(() => {
const target = findDebugTargetByText(SERVICE_WORKER, document);
const status = target && target.querySelector(".js-worker-status");
const status = target && target.querySelector(".qa-worker-status");
return status && status.textContent === "Running";
});
let targetElement = findDebugTargetByText(SERVICE_WORKER, document);
let pushButton = targetElement.querySelector(".js-push-button");
let pushButton = targetElement.querySelector(".qa-push-button");
ok(!pushButton.disabled, "Push button is not disabled");
let inspectButton = targetElement.querySelector(".js-debug-target-inspect-button");
let inspectButton = targetElement.querySelector(".qa-debug-target-inspect-button");
ok(!inspectButton.disabled, "Inspect button is not disabled");
// enable multi e10s
@ -72,12 +72,12 @@ async function testDebuggingSW(enableMultiE10sFn, disableMultiE10sFn) {
info("Wait for debug target to re-render");
await waitUntil(() => {
targetElement = findDebugTargetByText(SERVICE_WORKER, document);
pushButton = targetElement.querySelector(".js-push-button");
pushButton = targetElement.querySelector(".qa-push-button");
return pushButton.disabled;
});
ok(pushButton.disabled, "Push button is disabled");
inspectButton = targetElement.querySelector(".js-debug-target-inspect-button");
inspectButton = targetElement.querySelector(".qa-debug-target-inspect-button");
ok(inspectButton.disabled, "Inspect button is disabled");
info("Unregister the service worker");

Просмотреть файл

@ -94,7 +94,7 @@ add_task(async function testRemoteRuntime() {
});
function assertWarningMessage(doc, expectedMessage) {
const hasMessage = !!doc.querySelector(".js-service-workers-warning");
const hasMessage = !!doc.querySelector(".qa-service-workers-warning");
ok(hasMessage === expectedMessage, expectedMessage ?
"Warning message is displayed" : "Warning message is not displayed");
}

Просмотреть файл

@ -30,7 +30,7 @@ add_task(async function() {
const targetElement = await waitForServiceWorkerRunning(SERVICE_WORKER, document);
// Retrieve the Push button for the worker.
const pushButton = targetElement.querySelector(".js-push-button");
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");

Просмотреть файл

@ -41,8 +41,8 @@ add_task(async function() {
});
info("Wait until the push service appears");
await waitUntil(() => targetElement.querySelector(".js-worker-push-service-value"));
const pushUrl = targetElement.querySelector(".js-worker-push-service-value");
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");
@ -53,7 +53,7 @@ add_task(async function() {
});
info("Wait until the push service disappears");
await waitUntil(() => !targetElement.querySelector(".js-worker-push-service-value"));
await waitUntil(() => !targetElement.querySelector(".qa-worker-push-service-value"));
info("Unregister the service worker");
await unregisterServiceWorker(swTab);

Просмотреть файл

@ -30,7 +30,7 @@ add_task(async function() {
// check that SW list is empty
info("Check that the SW pane is empty");
let swPane = getDebugTargetPane("Service Workers", document);
ok(!swPane.querySelector(".js-debug-target-item"),
ok(!swPane.querySelector(".qa-debug-target-item"),
"SW list is empty");
// open a tab and register service worker
@ -42,9 +42,9 @@ add_task(async function() {
await waitForServiceWorkerRunning(SW_URL, document);
swPane = getDebugTargetPane("Service Workers", document);
ok(swPane.querySelectorAll(".js-debug-target-item").length === 1,
ok(swPane.querySelectorAll(".qa-debug-target-item").length === 1,
"Service worker list has one element");
ok(swPane.querySelector(".js-debug-target-item").textContent.includes(SW_URL),
ok(swPane.querySelector(".qa-debug-target-item").textContent.includes(SW_URL),
"Service worker list is the one we registered");
// unregister the service worker
@ -54,7 +54,7 @@ add_task(async function() {
info("Wait for service worker to disappear");
await waitUntil(() => {
swPane = getDebugTargetPane("Service Workers", document);
return swPane.querySelectorAll(".js-debug-target-item").length === 0;
return swPane.querySelectorAll(".qa-debug-target-item").length === 0;
});
info("Remove tabs");

Просмотреть файл

@ -40,7 +40,7 @@ add_task(async function() {
const targetElement = await waitForServiceWorkerStopped(SW_URL, document);
// Retrieve the Start button for the worker.
const startButton = targetElement.querySelector(".js-start-button");
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");
@ -49,8 +49,8 @@ add_task(async function() {
const updatedTarget = await onServiceWorkerRunning;
// Check that the buttons are displayed as expected.
const hasInspectButton = updatedTarget.querySelector(".js-debug-target-inspect-button");
const hasStartButton = updatedTarget.querySelector(".js-start-button");
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");

Просмотреть файл

@ -58,10 +58,10 @@ add_task(async function() {
function checkButtons({ inspect, push, start, unregister }, workerText, document) {
const targetElement = findDebugTargetByText(SW_URL, document);
const inspectButton = targetElement.querySelector(".js-debug-target-inspect-button");
const pushButton = targetElement.querySelector(".js-push-button");
const startButton = targetElement.querySelector(".js-start-button");
const unregisterButton = targetElement.querySelector(".js-unregister-button");
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"));

Просмотреть файл

@ -90,10 +90,10 @@ add_task(async function() {
function getStartButton(workerText, doc) {
const target = findDebugTargetByText(workerText, doc);
return target ? target.querySelector(".js-start-button") : null;
return target ? target.querySelector(".qa-start-button") : null;
}
function getInspectButton(workerText, doc) {
const target = findDebugTargetByText(workerText, doc);
return target ? target.querySelector(".js-debug-target-inspect-button") : null;
return target ? target.querySelector(".qa-debug-target-inspect-button") : null;
}

Просмотреть файл

@ -29,7 +29,7 @@ add_task(async function() {
const targetElement = await waitForServiceWorkerRunning(SW_URL, document);
// Retrieve the Start button for the worker.
const unregisterButton = targetElement.querySelector(".js-unregister-button");
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");

Просмотреть файл

@ -32,7 +32,7 @@ add_task(async function() {
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(".js-connect-button");
const connectButton = usbRuntimeSidebarItem.querySelector(".qa-connect-button");
info("Simulate to happen connection error");
mocks.runtimeClientFactoryMock.createClientForRuntime = async (runtime) => {
@ -67,7 +67,7 @@ add_task(async function() {
info("Unblock the connection and check the message and connect button disappear");
resumeConnection();
await waitUntil(() => !usbRuntimeSidebarItem.querySelector(".js-connect-button"));
await waitUntil(() => !usbRuntimeSidebarItem.querySelector(".qa-connect-button"));
ok(!document.querySelector(".qa-connection-error"), "Error disappears");
ok(!document.querySelector(".qa-connection-not-responding"), "Warning disappears");
@ -98,7 +98,7 @@ add_task(async function() {
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(".js-connect-button");
const connectButton = usbRuntimeSidebarItem.querySelector(".qa-connect-button");
let resumeConnection;
const resumeConnectionPromise = new Promise(r => {

Просмотреть файл

@ -17,14 +17,14 @@ add_task(async function() {
const { document, tab } = await openAboutDebugging();
const noDevicesElement = document.querySelector(".js-sidebar-no-devices");
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(".js-sidebar-no-devices"));
waitUntil(() => !document.querySelector(".qa-sidebar-no-devices"));
ok(findSidebarItemByText("localhost:6080", document),
"Found a sidebar item for localhost:6080");
@ -32,7 +32,7 @@ add_task(async function() {
networkLocationsModule.removeNetworkLocation("localhost:6080");
info("Wait for 'no devices' element to reappear");
waitUntil(() => document.querySelector(".js-sidebar-no-devices"));
waitUntil(() => document.querySelector(".qa-sidebar-no-devices"));
ok(!findSidebarItemByText("localhost:6080", document),
"Sidebar item for localhost:6080 removed");

Просмотреть файл

@ -26,12 +26,12 @@ add_task(async function() {
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(".js-connect-button");
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(".js-connect-button"));
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");

Просмотреть файл

@ -33,13 +33,13 @@ add_task(async function() {
// adb.updateRuntimes should ultimately fire the "runtime-list-updated" event.
mocks.adbMock.adb.updateRuntimes = () => mocks.emitUSBUpdate();
document.querySelector(".js-refresh-devices-button").click();
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(".js-connect-button"),
ok(!sidebarItem.querySelector(".qa-connect-button"),
"Original USB runtime is still connected");
await removeTab(tab);

Просмотреть файл

@ -18,7 +18,7 @@ add_task(async function() {
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(".js-connect-button");
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");

Просмотреть файл

@ -16,7 +16,7 @@ add_task(async function() {
CHROME_URL_ROOT + "resources/test-adb-extension/adb-extension-#OS#.xpi");
const { document, tab } = await openAboutDebugging();
const usbStatusElement = document.querySelector(".js-sidebar-usb-status");
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");
@ -29,14 +29,14 @@ add_task(async function() {
info("Wait till the USB status element has 'enabled' content");
await waitUntil(() => {
const el = document.querySelector(".js-sidebar-usb-status");
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(".js-sidebar-usb-status");
const el = document.querySelector(".qa-sidebar-usb-status");
return el.textContent.includes("USB disabled");
});

Просмотреть файл

@ -28,10 +28,10 @@ add_task(async function() {
ok(usbRuntimeSidebarItem.querySelector(".qa-runtime-item-waiting-for-browser"),
"Sidebar item shows as `Waiting for browser`");
const hasConnectButton = usbRuntimeSidebarItem.querySelector(".js-connect-button");
const hasConnectButton = usbRuntimeSidebarItem.querySelector(".qa-connect-button");
ok(!hasConnectButton, "Connect button is not displayed");
const hasLink = usbRuntimeSidebarItem.querySelector(".js-sidebar-link");
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");
@ -47,7 +47,7 @@ add_task(async function() {
let updatedSidebarItem = null;
await waitUntil(() => {
updatedSidebarItem = findSidebarItemByText(DEVICE_NAME, document);
return updatedSidebarItem && updatedSidebarItem.querySelector(".js-connect-button");
return updatedSidebarItem && updatedSidebarItem.querySelector(".qa-connect-button");
});
ok(updatedSidebarItem.querySelector(".qa-runtime-item-standard"),

Просмотреть файл

@ -26,7 +26,7 @@ add_task(async function() {
await waitUntil(() => findDebugTargetByText("Favicon tab", document));
const faviconTabTarget = findDebugTargetByText("Favicon tab", document);
const faviconTabIcon = faviconTabTarget.querySelector(".js-debug-target-item-icon");
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

Просмотреть файл

@ -27,7 +27,7 @@ add_task(async function() {
await waitUntil(() => findDebugTargetByText("TEST_TAB", document));
const tabTarget = findDebugTargetByText("TEST_TAB", document);
const inspectButton = tabTarget.querySelector(".js-debug-target-inspect-button");
const inspectButton = tabTarget.querySelector(".qa-debug-target-inspect-button");
ok(inspectButton, "Inspect button for the tab is available");
info("Click on the inspect button for the test tab");

Просмотреть файл

@ -23,7 +23,7 @@ add_task(async function() {
info("Navigate to 'Connect' page");
document.location.hash = "#/connect";
await waitUntil(() => document.querySelector(".js-connect-page"));
await waitUntil(() => document.querySelector(".qa-connect-page"));
checkSelectPageEvent("connect", sessionId);
info("Navigate to 'USB device runtime' page");
@ -51,5 +51,5 @@ async function navigateToUSBRuntime(mocks, doc) {
await connectToRuntime("Fancy Phone", doc);
// navigate to it via URL
doc.location.hash = "#/runtime/1337id";
await waitUntil(() => doc.querySelector(".js-runtime-page"));
await waitUntil(() => doc.querySelector(".qa-runtime-page"));
}

Просмотреть файл

@ -42,7 +42,7 @@ add_task(async function testUsbRuntimeUpdates() {
const telemetryRuntimeId = runtimeAddedEvent.extras.runtime_id;
info("Click on the toggle button and wait until the text is updated");
const promptButton = document.querySelector(".js-connection-prompt-toggle-button");
const promptButton = document.querySelector(".qa-connection-prompt-toggle-button");
promptButton.click();
await waitUntil(() => promptButton.textContent.includes("Enable"));

Просмотреть файл

@ -44,14 +44,14 @@ add_task(async function testThisFirefoxWithoutLocalTab() {
async function checkThisFirefoxTargetPanes(doc, expectedTargetPanes) {
const win = doc.ownerGlobal;
// Check that the selected sidebar item is "This Firefox"/"This Nightly"/...
const selectedSidebarItem = doc.querySelector(".js-sidebar-item-selected");
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(".js-debug-target-pane-title");
const paneTitlesEls = doc.querySelectorAll(".qa-debug-target-pane-title");
is(paneTitlesEls.length, expectedTargetPanes.length,
"This Firefox has the expected number of debug target categories");

Просмотреть файл

@ -31,7 +31,7 @@ add_task(async function() {
await selectThisFirefoxPage(document, window.AboutDebugging.store);
info("Check that the 'This Firefox' mock is properly displayed");
const thisFirefoxRuntimeInfo = document.querySelector(".js-runtime-name");
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"),

Просмотреть файл

@ -81,7 +81,7 @@ async function testWorkerOnMockedRemoteClient(testData, remoteClient, firefoxCli
const workersPane = getDebugTargetPane(category, document);
info("Check an empty target pane message is displayed");
ok(workersPane.querySelector(".js-debug-target-list-empty"),
ok(workersPane.querySelector(".qa-debug-target-list-empty"),
"Workers list is empty");
info(`Add a worker of type [${propertyName}] to the remote client`);
@ -97,7 +97,7 @@ async function testWorkerOnMockedRemoteClient(testData, remoteClient, firefoxCli
remoteClient._eventEmitter.emit("workersUpdated");
info("Wait until the worker appears");
await waitUntil(() => !workersPane.querySelector(".js-debug-target-list-empty"));
await waitUntil(() => !workersPane.querySelector(".qa-debug-target-list-empty"));
const workerTarget = findDebugTargetByText(workerName, document);
ok(workerTarget, "Worker target appeared for the remote runtime");

Просмотреть файл

@ -62,7 +62,7 @@ async function openAboutDebugging({ enableWorkerUpdates, enableLocalTabs = true
const window = browser.contentWindow;
info("Wait until Connect page is displayed");
await waitUntil(() => document.querySelector(".js-connect-page"));
await waitUntil(() => document.querySelector(".qa-connect-page"));
return { tab, document, window };
}
@ -72,7 +72,7 @@ async function openAboutDevtoolsToolbox(doc, tab, win, targetText = "about:debug
info("Open about:devtools-toolbox page");
const target = findDebugTargetByText(targetText, doc);
ok(target, `${ targetText } tab target appeared`);
const inspectButton = target.querySelector(".js-debug-target-inspect-button");
const inspectButton = target.querySelector(".qa-debug-target-inspect-button");
ok(inspectButton, `Inspect button for ${ targetText } appeared`);
inspectButton.click();
await Promise.all([
@ -91,7 +91,7 @@ async function openAboutDevtoolsToolbox(doc, tab, win, targetText = "about:debug
if (!shouldWaitToolboxReady) {
// Wait for show error page.
await waitUntil(() =>
devtoolsBrowser.contentDocument.querySelector(".js-error-page"));
devtoolsBrowser.contentDocument.querySelector(".qa-error-page"));
}
return {
@ -206,26 +206,26 @@ async function selectThisFirefoxPage(doc, store) {
info("Wait for requests to be complete");
await onRequestSuccess;
info("Wait for runtime page to be rendered");
await waitUntil(() => doc.querySelector(".js-runtime-page"));
await waitUntil(() => doc.querySelector(".qa-runtime-page"));
}
/**
* Navigate to the Connect page. Resolves when the Connect page is rendered.
*/
async function selectConnectPage(doc) {
const sidebarItems = doc.querySelectorAll(".js-sidebar-item");
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(".js-sidebar-link");
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(".js-connect-page"));
await waitUntil(() => doc.querySelector(".qa-connect-page"));
}
function getDebugTargetPane(title, document) {
@ -235,31 +235,31 @@ function getDebugTargetPane(title, document) {
};
const targetTitle = sanitizeTitle(title);
for (const titleEl of document.querySelectorAll(".js-debug-target-pane-title")) {
for (const titleEl of document.querySelectorAll(".qa-debug-target-pane-title")) {
if (sanitizeTitle(titleEl.textContent) !== targetTitle) {
continue;
}
return titleEl.closest(".js-debug-target-pane");
return titleEl.closest(".qa-debug-target-pane");
}
return null;
}
function findDebugTargetByText(text, document) {
const targets = [...document.querySelectorAll(".js-debug-target-item")];
const targets = [...document.querySelectorAll(".qa-debug-target-item")];
return targets.find(target => target.textContent.includes(text));
}
function findSidebarItemByText(text, document) {
const sidebarItems = document.querySelectorAll(".js-sidebar-item");
const sidebarItems = document.querySelectorAll(".qa-sidebar-item");
return [...sidebarItems].find(element => {
return element.textContent.includes(text);
});
}
function findSidebarItemLinkByText(text, document) {
const links = document.querySelectorAll(".js-sidebar-link");
const links = document.querySelectorAll(".qa-sidebar-link");
return [...links].find(element => {
return element.textContent.includes(text);
});
@ -269,20 +269,20 @@ 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(".js-connect-button");
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(".js-connect-button"));
await waitUntil(() => !sidebarItem.querySelector(".qa-connect-button"));
}
async function selectRuntime(deviceName, name, document) {
const sidebarItem = findSidebarItemByText(deviceName, document);
sidebarItem.querySelector(".js-sidebar-link").click();
sidebarItem.querySelector(".qa-sidebar-link").click();
await waitUntil(() => {
const runtimeInfo = document.querySelector(".js-runtime-name");
const runtimeInfo = document.querySelector(".qa-runtime-name");
return runtimeInfo && runtimeInfo.textContent.includes(name);
});
}
@ -301,7 +301,7 @@ async function openProfilerDialog(client, doc) {
});
info("Click on the Profile Runtime button");
const profileButton = doc.querySelector(".js-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");

Просмотреть файл

@ -70,7 +70,7 @@ async function installTemporaryExtension(pathOrFile, name, document) {
});
// Trigger the file picker by clicking on the button
document.querySelector(".js-temporary-extension-install-button").click();
document.querySelector(".qa-temporary-extension-install-button").click();
info("Wait for addon to be installed");
await onAddonInstalled;
@ -136,7 +136,7 @@ async function installTemporaryExtensionFromXPI(xpiData, document) {
async function removeTemporaryExtension(name, document) {
info(`Remove the temporary extension with name: '${name}'`);
const temporaryExtensionItem = findDebugTargetByText(name, document);
temporaryExtensionItem.querySelector(".js-temporary-extension-remove-button").click();
temporaryExtensionItem.querySelector(".qa-temporary-extension-remove-button").click();
info("Wait until the debug target item disappears");
await waitUntil(() => !findDebugTargetByText(name, document));

Просмотреть файл

@ -40,7 +40,7 @@ function prepareCollapsibilitiesTest() {
/* exported prepareCollapsibilitiesTest */
async function toggleCollapsibility(debugTargetPane) {
debugTargetPane.querySelector(".js-debug-target-pane-title").click();
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));

Просмотреть файл

@ -37,7 +37,7 @@ async function openAboutDebuggingWithADB() {
const { adbAddon } = require("devtools/shared/adb/adb-addon");
adbAddon.install("internal");
const usbStatusElement = document.querySelector(".js-sidebar-usb-status");
const usbStatusElement = document.querySelector(".qa-sidebar-usb-status");
await waitUntil(() => usbStatusElement.textContent.includes("USB enabled"));
await waitForAdbStart();

Просмотреть файл

@ -43,7 +43,7 @@ function onTabMessage(tab, message) {
async function _waitForServiceWorkerStatus(workerText, status, document) {
await waitUntil(() => {
const target = findDebugTargetByText(workerText, document);
const statusElement = target && target.querySelector(".js-worker-status");
const statusElement = target && target.querySelector(".qa-worker-status");
return statusElement && statusElement.textContent === status;
});

Просмотреть файл

@ -25,7 +25,7 @@ class DebugTargetErrorPage extends PureComponent {
return dom.article(
{
className: "error-page js-error-page",
className: "error-page qa-error-page",
},
dom.h1(
{

Просмотреть файл

@ -135,7 +135,7 @@ class DebugTargetInfo extends PureComponent {
return dom.span(
{
className: "iconized-label js-connection-info",
className: "iconized-label qa-connection-info",
},
dom.img({ src: image, alt: `${connectionType} icon`}),
this.props.L10N.getStr(l10nId),
@ -171,7 +171,7 @@ class DebugTargetInfo extends PureComponent {
className: "iconized-label",
},
dom.img({ src: image, alt: this.props.L10N.getStr(l10nId)}),
title ? dom.b({ className: "devtools-ellipsis-text js-target-title"}, title) : null,
title ? dom.b({ className: "devtools-ellipsis-text qa-target-title"}, title) : null,
dom.span({ className: "devtools-ellipsis-text" }, url),
);
}
@ -179,7 +179,7 @@ class DebugTargetInfo extends PureComponent {
render() {
return dom.header(
{
className: "debug-target-info js-debug-target-info",
className: "debug-target-info qa-debug-target-info",
},
this.shallRenderConnection() ? this.renderConnection() : null,
this.renderRuntime(),

Просмотреть файл

@ -22,7 +22,7 @@ add_task(async function() {
await removeTab(tab);
async function assertErrorIsShown(doc) {
await waitUntil(() => doc.querySelector(".js-error-page"));
ok(doc.querySelector(".js-error-page"), "Error page is rendered");
await waitUntil(() => doc.querySelector(".qa-error-page"));
ok(doc.querySelector(".qa-error-page"), "Error page is rendered");
}
});

Просмотреть файл

@ -2,10 +2,10 @@
exports[`DebugTargetInfo component Connection info renders the expected snapshot for USB Release target 1`] = `
<header
className="debug-target-info js-debug-target-info"
className="debug-target-info qa-debug-target-info"
>
<span
className="iconized-label js-connection-info"
className="iconized-label qa-connection-info"
>
<img
alt="usb icon"
@ -39,7 +39,7 @@ exports[`DebugTargetInfo component Connection info renders the expected snapshot
src="chrome://devtools/skin/images/globe.svg"
/>
<b
className="devtools-ellipsis-text js-target-title"
className="devtools-ellipsis-text qa-target-title"
>
Test Tab Name
</b>
@ -54,10 +54,10 @@ exports[`DebugTargetInfo component Connection info renders the expected snapshot
exports[`DebugTargetInfo component Target icon renders the expected snapshot for a process target 1`] = `
<header
className="debug-target-info js-debug-target-info"
className="debug-target-info qa-debug-target-info"
>
<span
className="iconized-label js-connection-info"
className="iconized-label qa-connection-info"
>
<img
alt="usb icon"
@ -91,7 +91,7 @@ exports[`DebugTargetInfo component Target icon renders the expected snapshot for
src="chrome://devtools/skin/images/settings.svg"
/>
<b
className="devtools-ellipsis-text js-target-title"
className="devtools-ellipsis-text qa-target-title"
>
Test Tab Name
</b>
@ -106,10 +106,10 @@ exports[`DebugTargetInfo component Target icon renders the expected snapshot for
exports[`DebugTargetInfo component Target icon renders the expected snapshot for a tab target 1`] = `
<header
className="debug-target-info js-debug-target-info"
className="debug-target-info qa-debug-target-info"
>
<span
className="iconized-label js-connection-info"
className="iconized-label qa-connection-info"
>
<img
alt="usb icon"
@ -143,7 +143,7 @@ exports[`DebugTargetInfo component Target icon renders the expected snapshot for
src="chrome://devtools/skin/images/globe.svg"
/>
<b
className="devtools-ellipsis-text js-target-title"
className="devtools-ellipsis-text qa-target-title"
>
Test Tab Name
</b>
@ -158,10 +158,10 @@ exports[`DebugTargetInfo component Target icon renders the expected snapshot for
exports[`DebugTargetInfo component Target icon renders the expected snapshot for a worker target 1`] = `
<header
className="debug-target-info js-debug-target-info"
className="debug-target-info qa-debug-target-info"
>
<span
className="iconized-label js-connection-info"
className="iconized-label qa-connection-info"
>
<img
alt="usb icon"
@ -195,7 +195,7 @@ exports[`DebugTargetInfo component Target icon renders the expected snapshot for
src="chrome://devtools/skin/images/debugging-workers.svg"
/>
<b
className="devtools-ellipsis-text js-target-title"
className="devtools-ellipsis-text qa-target-title"
>
Test Tab Name
</b>
@ -210,10 +210,10 @@ exports[`DebugTargetInfo component Target icon renders the expected snapshot for
exports[`DebugTargetInfo component Target icon renders the expected snapshot for an extension target 1`] = `
<header
className="debug-target-info js-debug-target-info"
className="debug-target-info qa-debug-target-info"
>
<span
className="iconized-label js-connection-info"
className="iconized-label qa-connection-info"
>
<img
alt="usb icon"
@ -247,7 +247,7 @@ exports[`DebugTargetInfo component Target icon renders the expected snapshot for
src="chrome://devtools/skin/images/debugging-addons.svg"
/>
<b
className="devtools-ellipsis-text js-target-title"
className="devtools-ellipsis-text qa-target-title"
>
Test Tab Name
</b>
@ -262,7 +262,7 @@ exports[`DebugTargetInfo component Target icon renders the expected snapshot for
exports[`DebugTargetInfo component Target title renders the expected snapshot for This Firefox target 1`] = `
<header
className="debug-target-info js-debug-target-info"
className="debug-target-info qa-debug-target-info"
>
<span
className="iconized-label"
@ -288,7 +288,7 @@ exports[`DebugTargetInfo component Target title renders the expected snapshot fo
src="chrome://devtools/skin/images/globe.svg"
/>
<b
className="devtools-ellipsis-text js-target-title"
className="devtools-ellipsis-text qa-target-title"
>
Test Tab Name
</b>
@ -303,7 +303,7 @@ exports[`DebugTargetInfo component Target title renders the expected snapshot fo
exports[`DebugTargetInfo component Target title renders the expected snapshot for a Toolbox with an unnamed target 1`] = `
<header
className="debug-target-info js-debug-target-info"
className="debug-target-info qa-debug-target-info"
>
<span
className="iconized-label"

Просмотреть файл

@ -87,7 +87,7 @@ describe("DebugTargetInfo component", () => {
describe("Connection info", () => {
it("displays connection info for USB Release target", () => {
const component = renderer.create(DebugTargetInfo(USB_TARGET_INFO));
expect(findByClassName(component.root, "js-connection-info").length).toEqual(1);
expect(findByClassName(component.root, "qa-connection-info").length).toEqual(1);
});
it("renders the expected snapshot for USB Release target", () => {
@ -97,14 +97,14 @@ describe("DebugTargetInfo component", () => {
it("hides the connection info for This Firefox target", () => {
const component = renderer.create(DebugTargetInfo(THIS_FIREFOX_TARGET_INFO));
expect(findByClassName(component.root, "js-connection-info").length).toEqual(0);
expect(findByClassName(component.root, "qa-connection-info").length).toEqual(0);
});
});
describe("Target title", () => {
it("displays the target title if the target of the Toolbox has a name", () => {
const component = renderer.create(DebugTargetInfo(THIS_FIREFOX_TARGET_INFO));
expect(findByClassName(component.root, "js-target-title").length).toEqual(1);
expect(findByClassName(component.root, "qa-target-title").length).toEqual(1);
});
it("renders the expected snapshot for This Firefox target", () => {
@ -114,7 +114,7 @@ describe("DebugTargetInfo component", () => {
it("doesn't display the target title if the target of the Toolbox has no name", () => {
const component = renderer.create(DebugTargetInfo(THIS_FIREFOX_NO_NAME_TARGET_INFO));
expect(findByClassName(component.root, "js-target-title").length).toEqual(0);
expect(findByClassName(component.root, "qa-target-title").length).toEqual(0);
});
it("renders the expected snapshot for a Toolbox with an unnamed target", () => {

Просмотреть файл

@ -3452,11 +3452,7 @@ already_AddRefed<Animation> Element::Animate(
// Animation constructor follows the standard Xray calling convention and
// needs to be called in the target element's realm.
Maybe<JSAutoRealm> ar;
if (js::GetContextCompartment(aContext) !=
js::GetObjectCompartment(ownerGlobal->GetGlobalJSObject())) {
ar.emplace(aContext, ownerGlobal->GetGlobalJSObject());
}
JSAutoRealm ar(aContext, global.Get());
AnimationTimeline* timeline = referenceElement->OwnerDoc()->Timeline();
RefPtr<Animation> animation = Animation::Constructor(

Просмотреть файл

@ -185,7 +185,7 @@ PopupBlocker::PopupControlState PopupBlocker::GetEventPopupControlState(
case eBasicEventClass:
// For these following events only allow popups if they're
// triggered while handling user input. See
// nsPresShell::HandleEventInternal() for details.
// PresShell::EventHandler::PrepareToDispatchEvent() for details.
if (EventStateManager::IsHandlingUserInput()) {
abuse = PopupBlocker::openBlocked;
switch (aEvent->mMessage) {
@ -207,7 +207,7 @@ PopupBlocker::PopupControlState PopupBlocker::GetEventPopupControlState(
case eEditorInputEventClass:
// For this following event only allow popups if it's triggered
// while handling user input. See
// nsPresShell::HandleEventInternal() for details.
// PresShell::EventHandler::PrepareToDispatchEvent() for details.
if (EventStateManager::IsHandlingUserInput()) {
abuse = PopupBlocker::openBlocked;
switch (aEvent->mMessage) {
@ -224,7 +224,7 @@ PopupBlocker::PopupControlState PopupBlocker::GetEventPopupControlState(
case eInputEventClass:
// For this following event only allow popups if it's triggered
// while handling user input. See
// nsPresShell::HandleEventInternal() for details.
// PresShell::EventHandler::PrepareToDispatchEvent() for details.
if (EventStateManager::IsHandlingUserInput()) {
abuse = PopupBlocker::openBlocked;
switch (aEvent->mMessage) {
@ -370,7 +370,7 @@ PopupBlocker::PopupControlState PopupBlocker::GetEventPopupControlState(
case eFormEventClass:
// For these following events only allow popups if they're
// triggered while handling user input. See
// nsPresShell::HandleEventInternal() for details.
// PresShell::EventHandler::PrepareToDispatchEvent() for details.
if (EventStateManager::IsHandlingUserInput()) {
abuse = PopupBlocker::openBlocked;
switch (aEvent->mMessage) {

Просмотреть файл

@ -1140,7 +1140,7 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget,
// All accesses to this field should be guarded by a check of mIsChrome.
struct ChromeFields {
nsCOMPtr<nsIBrowserDOMWindow> mBrowserDOMWindow;
// A weak pointer to the nsPresShell that we are doing fullscreen for.
// A weak pointer to the PresShell that we are doing fullscreen for.
// The pointer being set indicates we've set the IsInFullscreenChange
// flag on this pres shell.
nsWeakPtr mFullscreenPresShell;

Просмотреть файл

@ -25,6 +25,7 @@
#include "mozilla/gfx/Matrix.h"
#include "WebGL2Context.h"
#include "nsIScriptError.h"
#include "nsIScriptObjectPrincipal.h"
#include "nsIPermissionManager.h"
#include "nsIObserverService.h"
@ -80,17 +81,11 @@ bool IsImageExtractionAllowed(Document* aDocument, JSContext* aCx,
return true;
}
// Get calling script file and line for logging.
// Don't show canvas prompt for PDF.js
JS::AutoFilename scriptFile;
unsigned scriptLine = 0;
bool isScriptKnown = false;
if (JS::DescribeScriptedCaller(aCx, &scriptFile, &scriptLine)) {
isScriptKnown = true;
// Don't show canvas prompt for PDF.js
if (scriptFile.get() &&
strcmp(scriptFile.get(), "resource://pdf.js/build/pdf.js") == 0) {
return true;
}
if (JS::DescribeScriptedCaller(aCx, &scriptFile) && scriptFile.get() &&
strcmp(scriptFile.get(), "resource://pdf.js/build/pdf.js") == 0) {
return true;
}
Document* topLevelDocument = aDocument->GetTopLevelContentDocument();
@ -112,14 +107,12 @@ bool IsImageExtractionAllowed(Document* aDocument, JSContext* aCx,
rv = thirdPartyUtil->IsThirdPartyURI(topLevelDocURI, docURI, &isThirdParty);
NS_ENSURE_SUCCESS(rv, false);
if (isThirdParty) {
nsAutoCString message;
message.AppendPrintf(
"Blocked third party %s in page %s from extracting canvas data.",
docURISpec.get(), topLevelDocURISpec.get());
if (isScriptKnown) {
message.AppendPrintf(" %s:%u.", scriptFile.get(), scriptLine);
}
nsContentUtils::LogMessageToConsole(message.get());
nsAutoString message;
message.AppendPrintf("Blocked third party %s from extracting canvas data.",
docURISpec.get());
nsContentUtils::ReportToConsoleNonLocalized(
message, nsIScriptError::warningFlag, NS_LITERAL_CSTRING("Security"),
aDocument);
return false;
}
@ -153,26 +146,23 @@ bool IsImageExtractionAllowed(Document* aDocument, JSContext* aCx,
!EventStateManager::IsHandlingUserInput();
if (isAutoBlockCanvas) {
nsAutoCString message;
nsAutoString message;
message.AppendPrintf(
"Blocked %s in page %s from extracting canvas data because no user "
"input was detected.",
docURISpec.get(), topLevelDocURISpec.get());
if (isScriptKnown) {
message.AppendPrintf(" %s:%u.", scriptFile.get(), scriptLine);
}
nsContentUtils::LogMessageToConsole(message.get());
"Blocked %s from extracting canvas data because no user input was "
"detected.",
docURISpec.get());
nsContentUtils::ReportToConsoleNonLocalized(
message, nsIScriptError::warningFlag, NS_LITERAL_CSTRING("Security"),
aDocument);
} else {
// It was in response to user input, so log and display the prompt.
nsAutoCString message;
nsAutoString message;
message.AppendPrintf(
"Blocked %s in page %s from extracting canvas data, but prompting the "
"user.",
docURISpec.get(), topLevelDocURISpec.get());
if (isScriptKnown) {
message.AppendPrintf(" %s:%u.", scriptFile.get(), scriptLine);
}
nsContentUtils::LogMessageToConsole(message.get());
"Blocked %s from extracting canvas data, but prompting the user.",
docURISpec.get());
nsContentUtils::ReportToConsoleNonLocalized(
message, nsIScriptError::warningFlag, NS_LITERAL_CSTRING("Security"),
aDocument);
}
// Prompt the user (asynchronous).

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше