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

This commit is contained in:
Tiberius Oros 2018-10-11 01:12:20 +03:00
Родитель f97ab0ad0a f9b1b2831d
Коммит 3315c9957a
76 изменённых файлов: 1266 добавлений и 717 удалений

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

@ -119,6 +119,9 @@ jobs:
mozilla-release:
- {hour: 7, minute: 0}
- {hour: 19, minute: 0}
mozilla-esr60:
- {hour: 7, minute: 0}
- {hour: 19, minute: 0}
- name: periodic-update
job:

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

@ -23,6 +23,7 @@ skip-if = !e10s
run-if = debug || devedition || nightly_build # Requires startupRecorder.js, which isn't shipped everywhere by default
[browser_tabclose_grow.js]
[browser_tabclose.js]
skip-if = (os == 'win' && bits == 32) # Bug 1488537
[browser_tabopen.js]
skip-if = (verify && (os == 'mac'))
[browser_tabopen_squeeze.js]

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

@ -22,6 +22,7 @@ def configure_error(message):
# A wrapper to obtain a process' output and return code.
# Returns a tuple (retcode, stdout, stderr).
@imports('os')
@imports(_from='__builtin__', _import='unicode')
@imports('subprocess')
@imports(_from='mozbuild.shellutil', _import='quote')
@ -44,7 +45,13 @@ def get_cmd_output(*args, **kwargs):
log.debug('Executing: `%s`', quote(*args))
proc = subprocess.Popen(args, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, **kwargs)
stderr=subprocess.PIPE,
# On Python 2 on Windows, close_fds prevents the
# process from inheriting stdout/stderr.
# Elsewhere, it simply prevents it from inheriting
# extra file descriptors, which is what we want.
close_fds=os.name != 'nt',
**kwargs)
stdout, stderr = proc.communicate()
return proc.wait(), stdout, stderr

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

@ -624,6 +624,7 @@ support-files =
examples/doc-pause-points.html
examples/doc-return-values.html
examples/doc-wasm-sourcemaps.html
examples/doc_global-method-override.html
examples/asm.js
examples/async.js
examples/bogus-map.js
@ -686,6 +687,8 @@ skip-if = (os == "win" && ccov) # Bug 1424154
[browser_dbg-ember-quickstart.js]
[browser_dbg-expressions.js]
[browser_dbg-expressions-error.js]
[browser_dbg_global-method-override.js]
skip-if = e10s && debug
[browser_dbg-iframes.js]
[browser_dbg-inline-cache.js]
[browser_dbg-keyboard-navigation.js]

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

@ -0,0 +1,18 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests that scripts that override properties of the global object, like
* toString, don't break the debugger. The test page used to cause the debugger
* to throw when trying to attach to the thread actor.
*/
"use strict";
add_task(async function() {
const dbg = await initDebugger("doc_global-method-override.html");
ok(dbg, "Should have a debugger available.");
is(dbg.toolbox.threadClient.state, "attached", "Debugger should be attached.");
});

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

@ -6,8 +6,6 @@ tags = devtools
subsuite = devtools
skip-if = (os == 'linux' && debug && bits == 32)
support-files =
addon1.xpi
addon2.xpi
addon4.xpi
addon5.xpi
addon-webext-contentscript.xpi
@ -70,7 +68,6 @@ support-files =
doc_function-display-name.html
doc_function-jump.html
doc_function-search.html
doc_global-method-override.html
doc_iframes.html
doc_included-script.html
doc_inline-debugger-statement.html
@ -147,10 +144,6 @@ skip-if = e10s && debug
skip-if = e10s && debug
[browser_dbg_bug-896139.js]
skip-if = e10s && debug
[browser_dbg_chrome-create.js]
skip-if = (e10s && debug) || (verify && os == "linux") # Exit code mismatch with verify
[browser_dbg_chrome-debugging.js]
skip-if = e10s && debug
[browser_dbg_clean-exit.js]
skip-if = true # Bug 1044985 (racy test)
[browser_dbg_closure-inspection.js]
@ -193,10 +186,6 @@ skip-if = e10s && debug
skip-if = e10s && debug
[browser_dbg_file-reload.js]
skip-if = e10s && debug
[browser_dbg_global-method-override.js]
skip-if = e10s && debug
[browser_dbg_globalactor.js]
skip-if = e10s
[browser_dbg_host-layout.js]
skip-if = e10s && debug
[browser_dbg_jump-to-function-definition.js]
@ -205,15 +194,4 @@ skip-if = e10s && debug
skip-if = e10s # TODO
[browser_dbg_interrupts.js]
skip-if = e10s && debug
[browser_dbg_listaddons.js]
skip-if = e10s && debug
tags = addons
[browser_dbg_listtabs-01.js]
[browser_dbg_listtabs-02.js]
skip-if = true # Never worked for remote frames, needs a mock DebuggerServerConnection
[browser_dbg_listtabs-03.js]
skip-if = e10s && debug
[browser_dbg_listworkers.js]
[browser_dbg_multiple-windows.js]
[browser_dbg_navigation.js]
skip-if = e10s && debug

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

@ -6,8 +6,6 @@ tags = devtools
subsuite = devtools
skip-if = (os == 'linux' && debug && bits == 32)
support-files =
addon1.xpi
addon2.xpi
addon4.xpi
addon5.xpi
addon-webext-contentscript.xpi
@ -70,7 +68,6 @@ support-files =
doc_function-display-name.html
doc_function-jump.html
doc_function-search.html
doc_global-method-override.html
doc_iframes.html
doc_included-script.html
doc_inline-debugger-statement.html
@ -159,28 +156,14 @@ uses-unsafe-cpows = true
skip-if = e10s && debug
[browser_dbg_split-console-paused-reload.js]
skip-if = true # Bug 1288348 - previously e10s && debug
[browser_dbg_target-scoped-actor-01.js]
[browser_dbg_target-scoped-actor-02.js]
[browser_dbg_terminate-on-tab-close.js]
uses-unsafe-cpows = true
skip-if = e10s && debug
[browser_dbg_worker-console-01.js]
skip-if = true # bug 1368569
[browser_dbg_worker-console-02.js]
skip-if = e10s && debug
[browser_dbg_worker-console-03.js]
skip-if = debug # bug 1334683
[browser_dbg_worker-console-04.js]
skip-if = e10s && debug
[browser_dbg_worker-source-map.js]
uses-unsafe-cpows = true
skip-if = e10s && debug
[browser_dbg_worker-window.js]
skip-if = (e10s && debug) || true # Bug 1486974
[browser_dbg_WorkerTargetActor.attach.js]
skip-if = e10s && debug
[browser_dbg_WorkerTargetActor.attachThread.js]
skip-if = e10s && debug
[browser_dbg_split-console-keypress.js]
uses-unsafe-cpows = true
skip-if = (debug || os == "linux") # Bug 1214439

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

@ -1,100 +0,0 @@
var TAB_URL = EXAMPLE_URL + "doc_WorkerTargetActor.attachThread-tab.html";
var WORKER_URL = "code_WorkerTargetActor.attachThread-worker.js";
function test() {
Task.spawn(function* () {
DebuggerServer.init();
DebuggerServer.registerAllActors();
let client1 = new DebuggerClient(DebuggerServer.connectPipe());
yield connect(client1);
let client2 = new DebuggerClient(DebuggerServer.connectPipe());
yield connect(client2);
let tab = yield addTab(TAB_URL);
let { tabs: tabs1 } = yield listTabs(client1);
let [, tabClient1] = yield attachTarget(client1, findTab(tabs1, TAB_URL));
let { tabs: tabs2 } = yield listTabs(client2);
let [, tabClient2] = yield attachTarget(client2, findTab(tabs2, TAB_URL));
yield listWorkers(tabClient1);
yield listWorkers(tabClient2);
yield createWorkerInTab(tab, WORKER_URL);
let { workers: workers1 } = yield listWorkers(tabClient1);
let [, workerClient1] = yield attachWorker(tabClient1,
findWorker(workers1, WORKER_URL));
let { workers: workers2 } = yield listWorkers(tabClient2);
let [, workerClient2] = yield attachWorker(tabClient2,
findWorker(workers2, WORKER_URL));
let location = { line: 5 };
let [, threadClient1] = yield attachThread(workerClient1);
let sources1 = yield getSources(threadClient1);
let sourceClient1 = threadClient1.source(findSource(sources1,
EXAMPLE_URL + WORKER_URL));
let [, breakpointClient1] = yield setBreakpoint(sourceClient1, location);
yield resume(threadClient1);
let [, threadClient2] = yield attachThread(workerClient2);
let sources2 = yield getSources(threadClient2);
let sourceClient2 = threadClient2.source(findSource(sources2,
EXAMPLE_URL + WORKER_URL));
let [, breakpointClient2] = yield setBreakpoint(sourceClient2, location);
yield resume(threadClient2);
let packet = yield source(sourceClient1);
let text = (yield new Promise(function (resolve) {
let request = new XMLHttpRequest();
request.open("GET", EXAMPLE_URL + WORKER_URL, true);
request.send();
request.onload = function () {
resolve(request.responseText);
};
}));
is(packet.source, text);
postMessageToWorkerInTab(tab, WORKER_URL, "ping");
yield Promise.all([
waitForPause(threadClient1).then((packet) => {
is(packet.type, "paused");
let why = packet.why;
is(why.type, "breakpoint");
is(why.actors.length, 1);
is(why.actors[0], breakpointClient1.actor);
let frame = packet.frame;
let where = frame.where;
is(where.source.actor, sourceClient1.actor);
is(where.line, location.line);
let variables = frame.environment.bindings.variables;
is(variables.a.value, 1);
is(variables.b.value.type, "undefined");
is(variables.c.value.type, "undefined");
return resume(threadClient1);
}),
waitForPause(threadClient2).then((packet) => {
is(packet.type, "paused");
let why = packet.why;
is(why.type, "breakpoint");
is(why.actors.length, 1);
is(why.actors[0], breakpointClient2.actor);
let frame = packet.frame;
let where = frame.where;
is(where.source.actor, sourceClient2.actor);
is(where.line, location.line);
let variables = frame.environment.bindings.variables;
is(variables.a.value, 1);
is(variables.b.value.type, "undefined");
is(variables.c.value.type, "undefined");
return resume(threadClient2);
}),
]);
terminateWorkerInTab(tab, WORKER_URL);
yield waitForWorkerClose(workerClient1);
yield waitForWorkerClose(workerClient2);
yield close(client1);
yield close(client2);
finish();
});
}

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

@ -1,70 +0,0 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests that a chrome debugger can be created in a new process.
*/
// There are shutdown issues for which multiple rejections are left uncaught.
// See bug 1018184 for resolving these issues.
const { PromiseTestUtils } = scopedCuImport("resource://testing-common/PromiseTestUtils.jsm");
PromiseTestUtils.whitelistRejectionsGlobally(/File closed/);
PromiseTestUtils.whitelistRejectionsGlobally(/NS_ERROR_FAILURE/);
var gProcess;
function test() {
// Windows XP and 8.1 test slaves are terribly slow at this test.
requestLongerTimeout(5);
Services.prefs.setBoolPref("devtools.chrome.enabled", true);
Services.prefs.setBoolPref("devtools.debugger.remote-enabled", true);
initChromeDebugger(aOnClose).then(aProcess => {
gProcess = aProcess;
info("Starting test...");
performTest();
});
}
function performTest() {
ok(gProcess._dbgProcess,
"The remote debugger process wasn't created properly!");
ok(gProcess._dbgProcess.exitCode == null,
"The remote debugger process isn't running!");
is(typeof gProcess._dbgProcess.pid, "number",
"The remote debugger process doesn't have a pid (?!)");
info("process location: " + gProcess._dbgProcess.location);
info("process pid: " + gProcess._dbgProcess.pid);
info("process name: " + gProcess._dbgProcess.processName);
info("process sig: " + gProcess._dbgProcess.processSignature);
ok(gProcess._dbgProfilePath,
"The remote debugger profile wasn't created properly!");
is(gProcess._dbgProfilePath, OS.Path.join(OS.Constants.Path.profileDir, "chrome_debugger_profile"),
"The remote debugger profile isn't where we expect it!");
info("profile path: " + gProcess._dbgProfilePath);
gProcess.close();
}
function aOnClose() {
is(gProcess._dbgProcess.exitCode, (Services.appinfo.OS == "WINNT" ? -9 : -15),
"The remote debugger process didn't die cleanly.");
info("process exit value: " + gProcess._dbgProcess.exitValue);
info("profile path: " + gProcess._dbgProfilePath);
finish();
}
registerCleanupFunction(function () {
Services.prefs.clearUserPref("devtools.chrome.enabled");
Services.prefs.clearUserPref("devtools.debugger.remote-enabled");
gProcess = null;
});

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

@ -1,89 +0,0 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests that chrome debugging works.
*/
const TAB_URL = EXAMPLE_URL + "doc_inline-debugger-statement.html";
var gClient, gThreadClient;
var gAttached = promise.defer();
var gNewChromeSource = promise.defer();
var { DevToolsLoader } = ChromeUtils.import("resource://devtools/shared/Loader.jsm", {});
var customLoader = new DevToolsLoader();
customLoader.invisibleToDebugger = true;
var { DebuggerServer } = customLoader.require("devtools/server/main");
function test() {
DebuggerServer.init();
DebuggerServer.registerAllActors();
DebuggerServer.allowChromeProcess = true;
let transport = DebuggerServer.connectPipe();
gClient = new DebuggerClient(transport);
gClient.connect().then(([aType, aTraits]) => {
is(aType, "browser",
"Root actor should identify itself as a browser.");
promise.all([gAttached.promise, gNewChromeSource.promise])
.then(resumeAndCloseConnection)
.then(finish)
.catch(aError => {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
testParentProcessTargetActor();
});
}
function testParentProcessTargetActor() {
gClient.getProcess().then(aResponse => {
let actor = aResponse.form.actor;
gClient.attachTarget(actor).then(([response, tabClient]) => {
tabClient.attachThread(null).then(([aResponse, aThreadClient]) => {
gThreadClient = aThreadClient;
gThreadClient.addListener("newSource", onNewSource);
if (aResponse.error) {
ok(false, "Couldn't attach to the chrome debugger.");
gAttached.reject();
} else {
ok(true, "Attached to the chrome debugger.");
gAttached.resolve();
// Ensure that a new chrome global will be created.
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, "about:mozilla");
}
});
});
});
}
function onNewSource(aEvent, aPacket) {
if (aPacket.source.url.startsWith("chrome:")) {
ok(true, "Received a new chrome source: " + aPacket.source.url);
gThreadClient.removeListener("newSource", onNewSource);
gNewChromeSource.resolve();
}
}
function resumeAndCloseConnection() {
let deferred = promise.defer();
gThreadClient.resume(() => deferred.resolve(gClient.close()));
return deferred.promise;
}
registerCleanupFunction(function () {
gClient = null;
gThreadClient = null;
gAttached = null;
gNewChromeSource = null;
customLoader = null;
DebuggerServer = null;
});

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

@ -1,26 +0,0 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests that scripts that override properties of the global object, like
* toString don't break the debugger. The test page used to cause the debugger
* to throw when trying to attach to the thread actor.
*/
const TAB_URL = EXAMPLE_URL + "doc_global-method-override.html";
function test() {
let options = {
source: TAB_URL,
line: 1
};
initDebugger(TAB_URL, options).then(([aTab, aPanel]) => {
let gDebugger = aPanel.panelWin;
ok(gDebugger, "Should have a debugger available.");
is(gDebugger.gThreadClient.state, "attached", "Debugger should be attached.");
closeDebuggerAndFinish(aPanel);
});
}

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

@ -1,110 +0,0 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Make sure the listAddons request works as specified.
*/
const ADDON1_ID = "jid1-oBAwBoE5rSecNg@jetpack";
const ADDON1_PATH = "addon1.xpi";
const ADDON2_ID = "jid1-qjtzNGV8xw5h2A@jetpack";
const ADDON2_PATH = "addon2.xpi";
var gAddon1, gAddon1Actor, gAddon2, gAddon2Actor, gClient;
function test() {
DebuggerServer.init();
DebuggerServer.registerAllActors();
let transport = DebuggerServer.connectPipe();
gClient = new DebuggerClient(transport);
gClient.connect().then(([aType, aTraits]) => {
is(aType, "browser",
"Root actor should identify itself as a browser.");
promise.resolve(null)
.then(testFirstAddon)
.then(testSecondAddon)
.then(testRemoveFirstAddon)
.then(testRemoveSecondAddon)
.then(() => gClient.close())
.then(finish)
.catch(aError => {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
});
}
function testFirstAddon() {
let addonListChanged = false;
gClient.addOneTimeListener("addonListChanged", () => {
addonListChanged = true;
});
return addTemporaryAddon(ADDON1_PATH).then(aAddon => {
gAddon1 = aAddon;
return getAddonActorForId(gClient, ADDON1_ID).then(aGrip => {
ok(!addonListChanged, "Should not yet be notified that list of addons changed.");
ok(aGrip, "Should find an addon actor for addon1.");
gAddon1Actor = aGrip.actor;
});
});
}
function testSecondAddon() {
let addonListChanged = false;
gClient.addOneTimeListener("addonListChanged", function () {
addonListChanged = true;
});
return addTemporaryAddon(ADDON2_PATH).then(aAddon => {
gAddon2 = aAddon;
return getAddonActorForId(gClient, ADDON1_ID).then(aFirstGrip => {
return getAddonActorForId(gClient, ADDON2_ID).then(aSecondGrip => {
ok(addonListChanged, "Should be notified that list of addons changed.");
is(aFirstGrip.actor, gAddon1Actor, "First addon's actor shouldn't have changed.");
ok(aSecondGrip, "Should find a addon actor for the second addon.");
gAddon2Actor = aSecondGrip.actor;
});
});
});
}
function testRemoveFirstAddon() {
let addonListChanged = false;
gClient.addOneTimeListener("addonListChanged", function () {
addonListChanged = true;
});
return removeAddon(gAddon1).then(() => {
return getAddonActorForId(gClient, ADDON1_ID).then(aGrip => {
ok(addonListChanged, "Should be notified that list of addons changed.");
ok(!aGrip, "Shouldn't find a addon actor for the first addon anymore.");
});
});
}
function testRemoveSecondAddon() {
let addonListChanged = false;
gClient.addOneTimeListener("addonListChanged", function () {
addonListChanged = true;
});
return removeAddon(gAddon2).then(() => {
return getAddonActorForId(gClient, ADDON2_ID).then(aGrip => {
ok(addonListChanged, "Should be notified that list of addons changed.");
ok(!aGrip, "Shouldn't find a addon actor for the second addon anymore.");
});
});
}
registerCleanupFunction(function () {
gAddon1 = null;
gAddon1Actor = null;
gAddon2 = null;
gAddon2Actor = null;
gClient = null;
});

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

@ -1,96 +0,0 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Make sure the listTabs request works as specified.
*/
const TAB1_URL = EXAMPLE_URL + "doc_empty-tab-01.html";
const TAB2_URL = EXAMPLE_URL + "doc_empty-tab-02.html";
var gTab1, gTab1Actor, gTab2, gTab2Actor, gClient;
function test() {
DebuggerServer.init();
DebuggerServer.registerAllActors();
let transport = DebuggerServer.connectPipe();
gClient = new DebuggerClient(transport);
gClient.connect().then(([aType, aTraits]) => {
is(aType, "browser",
"Root actor should identify itself as a browser.");
promise.resolve(null)
.then(testFirstTab)
.then(testSecondTab)
.then(testRemoveTab)
.then(testAttachRemovedTab)
.then(() => gClient.close())
.then(finish)
.catch(aError => {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
});
}
function testFirstTab() {
return addTab(TAB1_URL).then(aTab => {
gTab1 = aTab;
return getTargetActorForUrl(gClient, TAB1_URL).then(aGrip => {
ok(aGrip, "Should find a target actor for the first tab.");
gTab1Actor = aGrip.actor;
});
});
}
function testSecondTab() {
return addTab(TAB2_URL).then(aTab => {
gTab2 = aTab;
return getTargetActorForUrl(gClient, TAB1_URL).then(aFirstGrip => {
return getTargetActorForUrl(gClient, TAB2_URL).then(aSecondGrip => {
is(aFirstGrip.actor, gTab1Actor, "First tab's actor shouldn't have changed.");
ok(aSecondGrip, "Should find a target actor for the second tab.");
gTab2Actor = aSecondGrip.actor;
});
});
});
}
function testRemoveTab() {
return removeTab(gTab1).then(() => {
return getTargetActorForUrl(gClient, TAB1_URL).then(aGrip => {
ok(!aGrip, "Shouldn't find a target actor for the first tab anymore.");
});
});
}
function testAttachRemovedTab() {
return removeTab(gTab2).then(() => {
let deferred = promise.defer();
gClient.addListener("paused", (aEvent, aPacket) => {
ok(false, "Attaching to an exited target actor shouldn't generate a pause.");
deferred.reject();
});
gClient.request({ to: gTab2Actor, type: "attach" }, aResponse => {
is(aResponse.error, "connectionClosed",
"Connection is gone since the tab was removed.");
deferred.resolve();
});
return deferred.promise;
});
}
registerCleanupFunction(function () {
gTab1 = null;
gTab1Actor = null;
gTab2 = null;
gTab2Actor = null;
gClient = null;
});

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

@ -19,6 +19,7 @@ support-files =
[browser_computed_browser-styles.js]
[browser_computed_cycle_color.js]
[browser_computed_default_tab.js]
[browser_computed_getNodeInfo.js]
[browser_computed_keybindings_01.js]
[browser_computed_keybindings_02.js]

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

@ -0,0 +1,36 @@
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test that the computed view is initialized when the computed view is the default tab
// for the inspector.
const TEST_URI = `
<style type="text/css">
#matches {
color: #F00;
}
</style>
<span id="matches">Some styled text</span>
`;
add_task(async function() {
await pushPref("devtools.inspector.activeSidebar", "computedview");
await addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
const {inspector, view} = await openComputedView();
await selectNode("#matches", inspector);
is(isPropertyVisible("color", view), true, "span #matches color property is visible");
});
function isPropertyVisible(name, view) {
info("Checking property visibility for " + name);
const propertyViews = view.propertyViews;
for (const propView of propertyViews) {
if (propView.name == name) {
return propView.visible;
}
}
return false;
}

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

@ -755,11 +755,6 @@ Inspector.prototype = {
async addRuleView({ defaultTab = "ruleview", skipQueue = false } = {}) {
const ruleViewSidebar = this.sidebarSplitBox.startPanelContainer;
if (this.is3PaneModeEnabled || defaultTab === "ruleview") {
// Force the rule view panel creation by calling getPanel
this.getPanel("ruleview");
}
if (this.is3PaneModeEnabled) {
// Convert to 3 pane mode by removing the rule view from the inspector sidebar
// and adding the rule view to the middle (in landscape/horizontal mode) or
@ -768,6 +763,9 @@ Inspector.prototype = {
this.setSidebarSplitBoxState();
// Force the rule view panel creation by calling getPanel
this.getPanel("ruleview");
await this.sidebar.removeTab("ruleview");
this.ruleViewSideBar.addExistingTab(
@ -866,6 +864,7 @@ Inspector.prototype = {
};
this.sidebar = new ToolSidebar(sidebar, this, "inspector", options);
this.sidebar.on("select", this.onSidebarSelect);
const ruleSideBar = this.panelDoc.getElementById("inspector-rules-sidebar");
this.ruleViewSideBar = new ToolSidebar(ruleSideBar, this, "inspector", {
@ -986,7 +985,6 @@ Inspector.prototype = {
this.sidebar.addAllQueuedTabs();
// Persist splitter state in preferences.
this.sidebar.on("select", this.onSidebarSelect);
this.sidebar.on("show", this.onSidebarShown);
this.sidebar.on("hide", this.onSidebarHidden);
this.sidebar.on("destroy", this.onSidebarHidden);

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

@ -2,9 +2,17 @@
tags = devtools
subsuite = devtools
support-files =
addon1.xpi
addon2.xpi
browser_devices.json
code_WorkerTargetActor.attach-worker1.js
code_WorkerTargetActor.attach-worker2.js
code_WorkerTargetActor.attachThread-worker.js
code_frame-script.js
doc_cubic-bezier-01.html
doc_cubic-bezier-02.html
doc_empty-tab-01.html
doc_empty-tab-02.html
doc_filter-editor-01.html
doc_html_tooltip-02.xul
doc_html_tooltip-03.xul
@ -21,23 +29,30 @@ support-files =
doc_layoutHelpers-getBoxQuads.html
doc_layoutHelpers.html
doc_options-view.xul
doc_script-switching-01.html
doc_script-switching-02.html
doc_spectrum.html
doc_tableWidget_basic.html
doc_tableWidget_keyboard_interaction.xul
doc_tableWidget_mouse_interaction.xul
doc_templater_basic.html
doc_WorkerTargetActor.attach-tab1.html
doc_WorkerTargetActor.attach-tab2.html
doc_WorkerTargetActor.attachThread-tab.html
dummy.html
frame-script-utils.js
head.js
helper_color_data.js
helper_html_tooltip.js
helper_inplace_editor.js
helper_workers.js
leakhunt.js
shared-head.js
shared-redux-head.js
telemetry-test-helpers.js
test-actor-registry.js
test-actor.js
testactors.js
!/devtools/client/responsive.html/test/browser/devices.json
[browser_autocomplete_popup.js]
@ -50,6 +65,8 @@ support-files =
[browser_cubic-bezier-05.js]
[browser_cubic-bezier-06.js]
[browser_cubic-bezier-07.js]
[browser_dbg_globalactor.js]
skip-if = e10s
[browser_filter-editor-01.js]
[browser_filter-editor-02.js]
[browser_filter-editor-03.js]
@ -204,3 +221,26 @@ skip-if = !e10s || os == "win" # RDM only works for remote tabs, Win: bug 140419
[browser_devices.js]
skip-if = verify
[browser_theme_switching.js]
[browser_dbg_listaddons.js]
skip-if = e10s && debug
tags = addons
[browser_dbg_listtabs-01.js]
[browser_dbg_listtabs-02.js]
skip-if = true # Never worked for remote frames, needs a mock DebuggerServerConnection
[browser_dbg_listtabs-03.js]
skip-if = e10s && debug
[browser_dbg_multiple-windows.js]
[browser_dbg_navigation.js]
skip-if = e10s && debug
[browser_dbg_target-scoped-actor-01.js]
[browser_dbg_target-scoped-actor-02.js]
[browser_dbg_worker-console-01.js]
skip-if = true # bug 1368569
[browser_dbg_worker-console-02.js]
skip-if = e10s && debug
[browser_dbg_worker-console-03.js]
skip-if = debug # bug 1334683
[browser_dbg_worker-console-04.js]
skip-if = e10s && debug
[browser_dbg_WorkerTargetActor.attach.js]
skip-if = e10s && debug

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

@ -1,3 +1,19 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Check to make sure that a worker can be attached to a toolbox
// and that the console works.
// Import helpers for the workers
/* import-globals-from helper_workers.js */
Services.scriptloader.loadSubScript(
"chrome://mochitests/content/browser/devtools/client/shared/test/helper_workers.js",
this);
var MAX_TOTAL_VIEWERS = "browser.sessionhistory.max_total_viewers";
var TAB1_URL = EXAMPLE_URL + "doc_WorkerTargetActor.attach-tab1.html";
@ -7,18 +23,18 @@ var WORKER2_URL = "code_WorkerTargetActor.attach-worker2.js";
function test() {
Task.spawn(function* () {
let oldMaxTotalViewers = SpecialPowers.getIntPref(MAX_TOTAL_VIEWERS);
const oldMaxTotalViewers = SpecialPowers.getIntPref(MAX_TOTAL_VIEWERS);
SpecialPowers.setIntPref(MAX_TOTAL_VIEWERS, 10);
DebuggerServer.init();
DebuggerServer.registerAllActors();
let client = new DebuggerClient(DebuggerServer.connectPipe());
const client = new DebuggerClient(DebuggerServer.connectPipe());
yield connect(client);
let tab = yield addTab(TAB1_URL);
let { tabs } = yield listTabs(client);
let [, tabClient] = yield attachTarget(client, findTab(tabs, TAB1_URL));
const tab = yield addTab(TAB1_URL);
const { tabs } = yield listTabs(client);
const [, tabClient] = yield attachTarget(client, findTab(tabs, TAB1_URL));
yield listWorkers(tabClient);
// If a page still has pending network requests, it will not be moved into
@ -40,7 +56,7 @@ function test() {
yield createWorkerInTab(tab, WORKER2_URL);
({ workers } = yield listWorkers(tabClient));
let [, workerClient2] = yield attachWorker(tabClient,
const [, workerClient2] = yield attachWorker(tabClient,
findWorker(workers, WORKER2_URL));
is(workerClient2.isClosed, false, "worker in tab 2 should not be closed");

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

@ -7,7 +7,13 @@
* Check extension-added global actor API.
*/
const ACTORS_URL = CHROME_URL + "testactors.js";
"use strict";
var { DebuggerServer } = require("devtools/server/main");
var { ActorRegistry } = require("devtools/server/actors/utils/actor-registry");
var { DebuggerClient } = require("devtools/shared/client/debugger-client");
const ACTORS_URL = EXAMPLE_URL + "testactors.js";
add_task(async function() {
DebuggerServer.init();
@ -43,7 +49,7 @@ add_task(async function() {
for (const connID of Object.getOwnPropertyNames(DebuggerServer._connections)) {
const conn = DebuggerServer._connections[connID];
const actorPrefix = conn._prefix + "testOne";
for (let pool of conn._extraPools) {
for (const pool of conn._extraPools) {
for (const actor of pool.poolChildren()) {
if (actor.actorID.startsWith(actorPrefix)) {
count++;

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

@ -0,0 +1,165 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
var { DebuggerServer } = require("devtools/server/main");
var { DebuggerClient } = require("devtools/shared/client/debugger-client");
const chromeRegistry =
Cc["@mozilla.org/chrome/chrome-registry;1"].getService(Ci.nsIChromeRegistry);
const DEBUGGER_CHROME_URL = "chrome://mochitests/content/browser/devtools/client/shared/test/";
const DEBUGGER_CHROME_URI = Services.io.newURI(DEBUGGER_CHROME_URL);
var { AddonManager } = ChromeUtils.import("resource://gre/modules/AddonManager.jsm", {});
/**
* Make sure the listAddons request works as specified.
*/
const ADDON1_ID = "jid1-oBAwBoE5rSecNg@jetpack";
const ADDON1_PATH = "addon1.xpi";
const ADDON2_ID = "jid1-qjtzNGV8xw5h2A@jetpack";
const ADDON2_PATH = "addon2.xpi";
var gAddon1, gAddon1Actor, gAddon2, gClient;
function test() {
DebuggerServer.init();
DebuggerServer.registerAllActors();
const transport = DebuggerServer.connectPipe();
gClient = new DebuggerClient(transport);
gClient.connect().then(([aType, aTraits]) => {
is(aType, "browser",
"Root actor should identify itself as a browser.");
promise.resolve(null)
.then(testFirstAddon)
.then(testSecondAddon)
.then(testRemoveFirstAddon)
.then(testRemoveSecondAddon)
.then(() => gClient.close())
.then(finish)
.catch(error => {
ok(false, "Got an error: " + error.message + "\n" + error.stack);
});
});
}
function testFirstAddon() {
let addonListChanged = false;
gClient.addOneTimeListener("addonListChanged", () => {
addonListChanged = true;
});
return addTemporaryAddon(ADDON1_PATH).then(addon => {
gAddon1 = addon;
return getAddonActorForId(gClient, ADDON1_ID).then(grip => {
ok(!addonListChanged, "Should not yet be notified that list of addons changed.");
ok(grip, "Should find an addon actor for addon1.");
gAddon1Actor = grip.actor;
});
});
}
function testSecondAddon() {
let addonListChanged = false;
gClient.addOneTimeListener("addonListChanged", function() {
addonListChanged = true;
});
return addTemporaryAddon(ADDON2_PATH).then(addon => {
gAddon2 = addon;
return getAddonActorForId(gClient, ADDON1_ID).then(fistGrip => {
return getAddonActorForId(gClient, ADDON2_ID).then(secondGrip => {
ok(addonListChanged, "Should be notified that list of addons changed.");
is(fistGrip.actor, gAddon1Actor, "First addon's actor shouldn't have changed.");
ok(secondGrip, "Should find a addon actor for the second addon.");
});
});
});
}
function testRemoveFirstAddon() {
let addonListChanged = false;
gClient.addOneTimeListener("addonListChanged", function() {
addonListChanged = true;
});
return removeAddon(gAddon1).then(() => {
return getAddonActorForId(gClient, ADDON1_ID).then(grip => {
ok(addonListChanged, "Should be notified that list of addons changed.");
ok(!grip, "Shouldn't find a addon actor for the first addon anymore.");
});
});
}
function testRemoveSecondAddon() {
let addonListChanged = false;
gClient.addOneTimeListener("addonListChanged", function() {
addonListChanged = true;
});
return removeAddon(gAddon2).then(() => {
return getAddonActorForId(gClient, ADDON2_ID).then(grip => {
ok(addonListChanged, "Should be notified that list of addons changed.");
ok(!grip, "Shouldn't find a addon actor for the second addon anymore.");
});
});
}
registerCleanupFunction(function() {
gAddon1 = null;
gAddon1Actor = null;
gAddon2 = null;
gClient = null;
});
function getAddonURIFromPath(path) {
const chromeURI = Services.io.newURI(path, null, DEBUGGER_CHROME_URI);
return chromeRegistry.convertChromeURL(chromeURI).QueryInterface(Ci.nsIFileURL);
}
function addTemporaryAddon(path) {
const addonFile = getAddonURIFromPath(path).file;
info("Installing addon: " + addonFile.path);
return AddonManager.installTemporaryAddon(addonFile);
}
function getAddonActorForId(client, addonId) {
info("Get addon actor for ID: " + addonId);
const deferred = promise.defer();
client.listAddons().then(response => {
const addonTargetActor = response.addons.filter(grip => grip.id == addonId).pop();
info("got addon actor for ID: " + addonId);
deferred.resolve(addonTargetActor);
});
return deferred.promise;
}
function removeAddon(addon) {
info("Removing addon.");
const deferred = promise.defer();
const listener = {
onUninstalled: function(uninstalledAddon) {
if (uninstalledAddon != addon) {
return;
}
AddonManager.removeAddonListener(listener);
deferred.resolve();
}
};
AddonManager.addAddonListener(listener);
addon.uninstall();
return deferred.promise;
}

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

@ -0,0 +1,112 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Make sure the listTabs request works as specified.
*/
var { DebuggerServer } = require("devtools/server/main");
var { DebuggerClient } = require("devtools/shared/client/debugger-client");
const TAB1_URL = EXAMPLE_URL + "doc_empty-tab-01.html";
const TAB2_URL = EXAMPLE_URL + "doc_empty-tab-02.html";
var gTab1, gTab1Actor, gTab2, gTab2Actor, gClient;
function test() {
DebuggerServer.init();
DebuggerServer.registerAllActors();
const transport = DebuggerServer.connectPipe();
gClient = new DebuggerClient(transport);
gClient.connect().then(([aType, aTraits]) => {
is(aType, "browser",
"Root actor should identify itself as a browser.");
promise.resolve(null)
.then(testFirstTab)
.then(testSecondTab)
.then(testRemoveTab)
.then(testAttachRemovedTab)
.then(() => gClient.close())
.then(finish)
.catch(error => {
ok(false, "Got an error: " + error.message + "\n" + error.stack);
});
});
}
function testFirstTab() {
return addTab(TAB1_URL).then(tab => {
gTab1 = tab;
return getTargetActorForUrl(gClient, TAB1_URL).then(grip => {
ok(grip, "Should find a target actor for the first tab.");
gTab1Actor = grip.actor;
});
});
}
function testSecondTab() {
return addTab(TAB2_URL).then(tab => {
gTab2 = tab;
return getTargetActorForUrl(gClient, TAB1_URL).then(firstGrip => {
return getTargetActorForUrl(gClient, TAB2_URL).then(secondGrip => {
is(firstGrip.actor, gTab1Actor, "First tab's actor shouldn't have changed.");
ok(secondGrip, "Should find a target actor for the second tab.");
gTab2Actor = secondGrip.actor;
});
});
});
}
function testRemoveTab() {
return removeTab(gTab1).then(() => {
return getTargetActorForUrl(gClient, TAB1_URL).then(grip => {
ok(!grip, "Shouldn't find a target actor for the first tab anymore.");
});
});
}
function testAttachRemovedTab() {
return removeTab(gTab2).then(() => {
const deferred = promise.defer();
gClient.addListener("paused", () => {
ok(false, "Attaching to an exited target actor shouldn't generate a pause.");
deferred.reject();
});
gClient.request({ to: gTab2Actor, type: "attach" }, response => {
is(response.error, "connectionClosed",
"Connection is gone since the tab was removed.");
deferred.resolve();
});
return deferred.promise;
});
}
registerCleanupFunction(function() {
gTab1 = null;
gTab1Actor = null;
gTab2 = null;
gTab2Actor = null;
gClient = null;
});
function getTargetActorForUrl(client, url) {
const deferred = promise.defer();
client.listTabs().then(response => {
const targetActor = response.tabs.filter(grip => grip.url == url).pop();
deferred.resolve(targetActor);
});
return deferred.promise;
}

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

@ -8,6 +8,7 @@
*/
var { BrowserTabList } = require("devtools/server/actors/webbrowser");
var { DebuggerServer } = require("devtools/server/main");
var gTestPage = "data:text/html;charset=utf-8," + encodeURIComponent(
"<title>JS Debugger BrowserTabList test page</title><body>Yo.</body>");
@ -54,14 +55,18 @@ function checkSingleTab() {
return gTabList.getList().then(targetActors => {
is(targetActors.length, 1, "initial tab list: contains initial tab");
gFirstActor = targetActors[0];
is(gFirstActor.url, "about:blank", "initial tab list: initial tab URL is 'about:blank'");
is(
gFirstActor.url,
"about:blank",
"initial tab list: initial tab URL is 'about:blank'"
);
is(gFirstActor.title, "New Tab", "initial tab list: initial tab title is 'New Tab'");
});
}
function addTabA() {
return addTab(gTestPage).then(aTab => {
gTabA = aTab;
return addTab(gTestPage).then(tab => {
gTabA = tab;
});
}
@ -76,13 +81,17 @@ function testTabA() {
info("actors: " + [...targetActors].map(a => a.url));
gActorA = [...targetActors].filter(a => a !== gFirstActor)[0];
ok(gActorA.url.match(/^data:text\/html;/), "gTabA opened: new tab URL");
is(gActorA.title, "JS Debugger BrowserTabList test page", "gTabA opened: new tab title");
is(
gActorA.title,
"JS Debugger BrowserTabList test page",
"gTabA opened: new tab title"
);
});
}
function addTabB() {
return addTab(gTestPage).then(aTab => {
gTabB = aTab;
return addTab(gTestPage).then(tab => {
gTabB = tab;
});
}
@ -96,10 +105,10 @@ function testTabB() {
}
function removeTabA() {
let deferred = promise.defer();
const deferred = promise.defer();
once(gBrowser.tabContainer, "TabClose").then(aEvent => {
ok(!aEvent.detail.adoptedBy, "This was a normal tab close");
once(gBrowser.tabContainer, "TabClose").then(event => {
ok(!event.detail.adoptedBy, "This was a normal tab close");
// Let the actor's TabClose handler finish first.
executeSoon(deferred.resolve);
@ -120,13 +129,17 @@ function testTabClosed() {
info("actors: " + [...targetActors].map(a => a.url));
gActorA = [...targetActors].filter(a => a !== gFirstActor)[0];
ok(gActorA.url.match(/^data:text\/html;/), "gTabA closed: new tab URL");
is(gActorA.title, "JS Debugger BrowserTabList test page", "gTabA closed: new tab title");
is(
gActorA.title,
"JS Debugger BrowserTabList test page",
"gTabA closed: new tab title"
);
});
}
function addTabC() {
return addTab(gTestPage).then(aTab => {
gTabC = aTab;
return addTab(gTestPage).then(tab => {
gTabC = tab;
});
}
@ -140,10 +153,10 @@ function testTabC() {
}
function removeTabC() {
let deferred = promise.defer();
const deferred = promise.defer();
once(gBrowser.tabContainer, "TabClose").then(aEvent => {
ok(aEvent.detail.adoptedBy, "This was a tab closed by moving");
once(gBrowser.tabContainer, "TabClose").then(event => {
ok(event.detail.adoptedBy, "This was a tab closed by moving");
// Let the actor's TabClose handler finish first.
executeSoon(deferred.resolve);
@ -164,15 +177,19 @@ function testNewWindow() {
info("actors: " + [...targetActors].map(a => a.url));
gActorA = [...targetActors].filter(a => a !== gFirstActor)[0];
ok(gActorA.url.match(/^data:text\/html;/), "gTabC closed: new tab URL");
is(gActorA.title, "JS Debugger BrowserTabList test page", "gTabC closed: new tab title");
is(
gActorA.title,
"JS Debugger BrowserTabList test page",
"gTabC closed: new tab title"
);
});
}
function removeNewWindow() {
let deferred = promise.defer();
const deferred = promise.defer();
once(gNewWindow, "unload").then(aEvent => {
ok(!aEvent.detail, "This was a normal window close");
once(gNewWindow, "unload").then(event => {
ok(!event.detail, "This was a normal window close");
// Let the actor's TabClose handler finish first.
executeSoon(deferred.resolve);
@ -193,15 +210,19 @@ function testWindowClosed() {
info("actors: " + [...targetActors].map(a => a.url));
gActorA = [...targetActors].filter(a => a !== gFirstActor)[0];
ok(gActorA.url.match(/^data:text\/html;/), "gNewWindow closed: new tab URL");
is(gActorA.title, "JS Debugger BrowserTabList test page", "gNewWindow closed: new tab title");
is(
gActorA.title,
"JS Debugger BrowserTabList test page",
"gNewWindow closed: new tab title"
);
});
}
function removeTabB() {
let deferred = promise.defer();
const deferred = promise.defer();
once(gBrowser.tabContainer, "TabClose").then(aEvent => {
ok(!aEvent.detail.adoptedBy, "This was a normal tab close");
once(gBrowser.tabContainer, "TabClose").then(event => {
ok(!event.detail.adoptedBy, "This was a normal tab close");
// Let the actor's TabClose handler finish first.
executeSoon(deferred.resolve);

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

@ -3,28 +3,34 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Make sure the listTabs request works as specified.
*/
var { DebuggerServer } = require("devtools/server/main");
var { DebuggerClient } = require("devtools/shared/client/debugger-client");
var { Task } = require("devtools/shared/task");
const TAB1_URL = EXAMPLE_URL + "doc_empty-tab-01.html";
var gTab1, gTab1Actor, gTab2, gTab2Actor, gClient;
var gClient;
function test() {
DebuggerServer.init();
DebuggerServer.registerAllActors();
let transport = DebuggerServer.connectPipe();
const transport = DebuggerServer.connectPipe();
gClient = new DebuggerClient(transport);
gClient.connect().then(Task.async(function* ([aType, aTraits]) {
is(aType, "browser",
"Root actor should identify itself as a browser.");
let tab = yield addTab(TAB1_URL);
const tab = yield addTab(TAB1_URL);
let { tabs } = yield gClient.listTabs();
is(tabs.length, 2, "Should be two tabs");
let tabGrip = tabs.filter(a => a.url == TAB1_URL).pop();
const tabGrip = tabs.filter(a => a.url == TAB1_URL).pop();
ok(tabGrip, "Should have an actor for the tab");
let response = yield gClient.request({ to: tabGrip.actor, type: "attach" });
@ -36,7 +42,7 @@ function test() {
response = yield gClient.request({ to: tabGrip.actor, type: "detach" });
is(response.type, "detached", "Should have detached");
let newGrip = tabs.filter(a => a.url == TAB1_URL).pop();
const newGrip = tabs.filter(a => a.url == TAB1_URL).pop();
is(newGrip.actor, tabGrip.actor, "Should have the same actor for the same tab");
response = yield gClient.request({ to: tabGrip.actor, type: "attach" });
@ -50,10 +56,6 @@ function test() {
}));
}
registerCleanupFunction(function () {
gTab1 = null;
gTab1Actor = null;
gTab2 = null;
gTab2Actor = null;
registerCleanupFunction(function() {
gClient = null;
});

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

@ -3,11 +3,16 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Make sure that the debugger attaches to the right tab when multiple windows
* are open.
*/
var { DebuggerServer } = require("devtools/server/main");
var { DebuggerClient } = require("devtools/shared/client/debugger-client");
const TAB1_URL = EXAMPLE_URL + "doc_script-switching-01.html";
const TAB2_URL = EXAMPLE_URL + "doc_script-switching-02.html";
@ -87,8 +92,7 @@ async function testRemoveTab(client, win, tab) {
await continue_remove_tab(client, tab);
}
async function continue_remove_tab(client, tab)
{
async function continue_remove_tab(client, tab) {
removeTab(tab);
const response = await client.listTabs();
@ -100,3 +104,12 @@ async function continue_remove_tab(client, tab)
is(response.selected, 0, "The original tab is selected.");
}
function addWindow(url) {
info("Adding window: " + url);
return promise.resolve(getChromeWindow(window.open(url)));
}
function getChromeWindow(win) {
return win.docShell.rootTreeItem.domWindow;
}

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

@ -3,12 +3,18 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Check tab attach/navigation.
*/
var { DebuggerServer } = require("devtools/server/main");
var { DebuggerClient } = require("devtools/shared/client/debugger-client");
const TAB1_URL = EXAMPLE_URL + "doc_empty-tab-01.html";
const TAB2_URL = EXAMPLE_URL + "doc_empty-tab-02.html";
const TAB2_FILE = "doc_empty-tab-02.html";
const TAB2_URL = EXAMPLE_URL + TAB2_FILE;
var gClient;
@ -16,7 +22,7 @@ function test() {
DebuggerServer.init();
DebuggerServer.registerAllActors();
let transport = DebuggerServer.connectPipe();
const transport = DebuggerServer.connectPipe();
gClient = new DebuggerClient(transport);
gClient.connect().then(([aType, aTraits]) => {
is(aType, "browser",
@ -27,20 +33,23 @@ function test() {
.then(testNavigate)
.then(testDetach)
.then(finish)
.catch(aError => {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
.catch(error => {
ok(false, "Got an error: " + error.message + "\n" + error.stack);
});
});
}
function testNavigate([aGrip, aResponse]) {
let outstanding = [promise.defer(), promise.defer()];
const outstanding = [promise.defer(), promise.defer()];
gClient.addListener("tabNavigated", function onTabNavigated(aEvent, aPacket) {
is(aPacket.url, TAB2_URL,
gClient.addListener("tabNavigated", function onTabNavigated(event, packet) {
is(packet.url.split("/").pop(), TAB2_FILE,
"Got a tab navigation notification.");
if (aPacket.state == "start") {
info(JSON.stringify(packet));
info(JSON.stringify(event));
if (packet.state == "start") {
ok(true, "Tab started to navigate.");
outstanding[0].resolve();
} else {
@ -55,12 +64,12 @@ function testNavigate([aGrip, aResponse]) {
.then(() => aGrip.actor);
}
function testDetach(aActor) {
let deferred = promise.defer();
function testDetach(actor) {
const deferred = promise.defer();
gClient.addOneTimeListener("tabDetached", (aType, aPacket) => {
gClient.addOneTimeListener("tabDetached", (type, packet) => {
ok(true, "Got a tab detach notification.");
is(aPacket.from, aActor, "tab detach message comes from the expected actor");
is(packet.from, actor, "tab detach message comes from the expected actor");
deferred.resolve(gClient.close());
});
@ -68,6 +77,23 @@ function testDetach(aActor) {
return deferred.promise;
}
registerCleanupFunction(function () {
registerCleanupFunction(function() {
gClient = null;
});
async function attachTargetActorForUrl(client, url) {
const grip = await getTargetActorForUrl(client, url);
const [ response ] = await client.attachTarget(grip.actor);
return [grip, response];
}
function getTargetActorForUrl(client, url) {
const deferred = promise.defer();
client.listTabs().then(response => {
const targetActor = response.tabs.filter(grip => grip.url == url).pop();
deferred.resolve(targetActor);
});
return deferred.promise;
}

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

@ -3,11 +3,16 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Check target-scoped actor lifetimes.
*/
const ACTORS_URL = CHROME_URL + "testactors.js";
var { DebuggerServer } = require("devtools/server/main");
var { DebuggerClient } = require("devtools/shared/client/debugger-client");
const ACTORS_URL = EXAMPLE_URL + "testactors.js";
const TAB_URL = EXAMPLE_URL + "doc_empty-tab-01.html";
add_task(async function test() {
@ -42,3 +47,20 @@ async function testTargetScopedActor(client, grip) {
const response = await client.request({ to: grip.testOneActor, type: "ping" });
is(response.pong, "pong", "Actor should respond to requests.");
}
async function attachTargetActorForUrl(client, url) {
const grip = await getTargetActorForUrl(client, url);
const [ response ] = await client.attachTarget(grip.actor);
return [grip, response];
}
function getTargetActorForUrl(client, url) {
const deferred = promise.defer();
client.listTabs().then(response => {
const targetActor = response.tabs.filter(grip => grip.url == url).pop();
deferred.resolve(targetActor);
});
return deferred.promise;
}

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

@ -3,11 +3,16 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/**
* Check target-scoped actor lifetimes.
*/
const ACTORS_URL = CHROME_URL + "testactors.js";
var { DebuggerServer } = require("devtools/server/main");
var { DebuggerClient } = require("devtools/shared/client/debugger-client");
const ACTORS_URL = EXAMPLE_URL + "testactors.js";
const TAB_URL = EXAMPLE_URL + "doc_empty-tab-01.html";
add_task(async function() {
@ -53,3 +58,20 @@ async function closeTab(client, grip) {
`can't be sent as the connection just closed.`,
"testOneActor went away.");
}
async function attachTargetActorForUrl(client, url) {
const grip = await getTargetActorForUrl(client, url);
const [ response ] = await client.attachTarget(grip.actor);
return [grip, response];
}
function getTargetActorForUrl(client, url) {
const deferred = promise.defer();
client.listTabs().then(response => {
const targetActor = response.tabs.filter(grip => grip.url == url).pop();
deferred.resolve(targetActor);
});
return deferred.promise;
}

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

@ -1,15 +1,28 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Check to make sure that a worker can be attached to a toolbox
// and that the console works.
// Import helpers for the workers
/* import-globals-from helper_workers.js */
Services.scriptloader.loadSubScript(
"chrome://mochitests/content/browser/devtools/client/shared/test/helper_workers.js",
this);
var TAB_URL = EXAMPLE_URL + "doc_WorkerTargetActor.attachThread-tab.html";
var WORKER_URL = "code_WorkerTargetActor.attachThread-worker.js";
add_task(async function testNormalExecution() {
let {client, tab, tabClient, workerClient, toolbox, gDebugger} =
const {client, tab, workerClient, toolbox} =
await initWorkerDebugger(TAB_URL, WORKER_URL);
let jsterm = await getSplitConsole(toolbox);
let executed = await jsterm.execute("this.location.toString()");
const jsterm = await getSplitConsole(toolbox);
const executed = await jsterm.execute("this.location.toString()");
ok(executed.textContent.includes(WORKER_URL),
"Evaluating the global's location works");

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

@ -1,35 +1,41 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Check to make sure that a worker can be attached to a toolbox
// and that the console works.
// Import helpers for the workers
/* import-globals-from helper_workers.js */
Services.scriptloader.loadSubScript(
"chrome://mochitests/content/browser/devtools/client/shared/test/helper_workers.js",
this);
var TAB_URL = EXAMPLE_URL + "doc_WorkerTargetActor.attachThread-tab.html";
var WORKER_URL = "code_WorkerTargetActor.attachThread-worker.js";
add_task(async function testWhilePaused() {
let {client, tab, tabClient, workerClient, toolbox, gDebugger} =
await initWorkerDebugger(TAB_URL, WORKER_URL);
let gTarget = gDebugger.gTarget;
let gResumeButton = gDebugger.document.getElementById("resume");
let gResumeKey = gDebugger.document.getElementById("resumeKey");
const dbg = await initWorkerDebugger(TAB_URL, WORKER_URL);
const {client, tab, workerClient, toolbox} = dbg;
// Execute some basic math to make sure evaluations are working.
let jsterm = await getSplitConsole(toolbox);
const jsterm = await getSplitConsole(toolbox);
let executed = await jsterm.execute("10000+1");
ok(executed.textContent.includes("10001"), "Text for message appeared correct");
// Pause the worker by waiting for next execution and then sending a message to
// it from the main thread.
let oncePaused = gTarget.once("thread-paused");
EventUtils.sendMouseEvent({ type: "mousedown" }, gResumeButton, gDebugger);
once(gDebugger.gClient, "willInterrupt").then(() => {
await clickElement(dbg, "pause");
once(dbg.client, "willInterrupt").then(() => {
info("Posting message to worker, then waiting for a pause");
postMessageToWorkerInTab(tab, WORKER_URL, "ping");
});
await oncePaused;
await waitForPaused(dbg);
let command1 = jsterm.execute("10000+2");
let command2 = jsterm.execute("10000+3");
let command3 = jsterm.execute("foobar"); // throw an error
const command1 = jsterm.execute("10000+2");
const command2 = jsterm.execute("10000+3");
const command3 = jsterm.execute("foobar"); // throw an error
info("Trying to get the result of command1");
executed = await command1;
@ -46,9 +52,7 @@ add_task(async function testWhilePaused() {
ok(executed.textContent.includes("ReferenceError: foobar is not defined"),
"command3 executed successfully");
let onceResumed = gTarget.once("thread-resumed");
EventUtils.sendMouseEvent({ type: "mousedown" }, gResumeButton, gDebugger);
await onceResumed;
await resume(dbg);
terminateWorkerInTab(tab, WORKER_URL);
await waitForWorkerClose(workerClient);

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

@ -1,38 +1,45 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Check to make sure that a worker can be attached to a toolbox
// and that the console works.
// Import helpers for the workers
/* import-globals-from helper_workers.js */
Services.scriptloader.loadSubScript(
"chrome://mochitests/content/browser/devtools/client/shared/test/helper_workers.js",
this);
var TAB_URL = EXAMPLE_URL + "doc_WorkerTargetActor.attachThread-tab.html";
var WORKER_URL = "code_WorkerTargetActor.attachThread-worker.js";
// Test to see if creating the pause from the console works.
add_task(async function testPausedByConsole() {
let {client, tab, tabClient, workerClient, toolbox, gDebugger} =
await initWorkerDebugger(TAB_URL, WORKER_URL);
const dbg = await initWorkerDebugger(TAB_URL, WORKER_URL);
const {client, tab, workerClient, toolbox} = dbg;
let gTarget = gDebugger.gTarget;
let gResumeButton = gDebugger.document.getElementById("resume");
let gResumeKey = gDebugger.document.getElementById("resumeKey");
let jsterm = await getSplitConsole(toolbox);
const jsterm = await getSplitConsole(toolbox);
let executed = await jsterm.execute("10000+1");
ok(executed.textContent.includes("10001"),
"Text for message appeared correct");
let oncePaused = gTarget.once("thread-paused");
EventUtils.sendMouseEvent({ type: "mousedown" }, gResumeButton, gDebugger);
let pausedExecution = jsterm.execute("10000+2");
await clickElement(dbg, "pause");
const pausedExecution = jsterm.execute("10000+2");
info("Executed a command with 'break on next' active, waiting for pause");
await oncePaused;
await waitForPaused(dbg);
executed = await jsterm.execute("10000+3");
ok(executed.textContent.includes("10003"),
"Text for message appeared correct");
info("Waiting for a resume");
let onceResumed = gTarget.once("thread-resumed");
EventUtils.sendMouseEvent({ type: "mousedown" }, gResumeButton, gDebugger);
await onceResumed;
await clickElement(dbg, "resume");
executed = await pausedExecution;
ok(executed.textContent.includes("10002"),

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

@ -1,3 +1,19 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Check to make sure that a worker can be attached to a toolbox
// and that the console works.
// Import helpers for the workers
/* import-globals-from helper_workers.js */
Services.scriptloader.loadSubScript(
"chrome://mochitests/content/browser/devtools/client/shared/test/helper_workers.js",
this);
// Check that the date and regexp previewers work in the console of a worker debugger.
"use strict";
@ -11,11 +27,11 @@ const TAB_URL = EXAMPLE_URL + "doc_WorkerTargetActor.attachThread-tab.html";
const WORKER_URL = "code_WorkerTargetActor.attachThread-worker.js";
add_task(async function testPausedByConsole() {
let {client, tab, workerClient, toolbox} =
const {client, tab, workerClient, toolbox} =
await initWorkerDebugger(TAB_URL, WORKER_URL);
info("Check Date objects can be used in the console");
let jsterm = await getSplitConsole(toolbox);
const jsterm = await getSplitConsole(toolbox);
let executed = await jsterm.execute("new Date(0)");
ok(executed.textContent.includes("1970-01-01T00:00:00.000Z"),
"Text for message appeared correct");

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

@ -0,0 +1,5 @@
"use strict";
self.onmessage = function() {};
postMessage("load");

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

@ -0,0 +1,5 @@
"use strict";
self.onmessage = function() {};
postMessage("load");

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

@ -0,0 +1,18 @@
"use strict";
function f() {
const a = 1;
const b = 2;
const c = 3;
return [a, b, c];
}
self.onmessage = function(event) {
if (event.data == "ping") {
f();
postMessage("pong");
}
};
postMessage("load");

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

@ -0,0 +1,105 @@
/* eslint-disable */
"use strict";
const { loadSubScript } = Cc["@mozilla.org/moz/jssubscript-loader;1"].
getService(Ci.mozIJSSubScriptLoader);
// Set up a dummy environment so that EventUtils works. We need to be careful to
// pass a window object into each EventUtils method we call rather than having
// it rely on the |window| global.
const EventUtils = {};
EventUtils.window = content;
EventUtils.parent = EventUtils.window;
EventUtils._EU_Ci = Ci;
EventUtils._EU_Cc = Cc;
EventUtils.navigator = content.navigator;
EventUtils.KeyboardEvent = content.KeyboardEvent;
loadSubScript("chrome://mochikit/content/tests/SimpleTest/EventUtils.js", EventUtils);
dump("Frame script loaded.\n");
var workers = {};
this.call = function(name, args) {
dump("Calling function with name " + name + ".\n");
dump("args " + JSON.stringify(args) + "\n");
return XPCNativeWrapper
.unwrap(content)[name]
.apply(undefined, Cu.cloneInto(args, content));
};
this._eval = function(string) {
dump("Evalling string.\n");
return content.eval(string);
};
this.generateMouseClick = function(path) {
dump("Generating mouse click.\n");
const target = eval(path);
EventUtils.synthesizeMouseAtCenter(target, {},
target.ownerDocument.defaultView);
};
this.createWorker = function(url) {
dump("Creating worker with url '" + url + "'.\n");
return new Promise(function(resolve, reject) {
const worker = new content.Worker(url);
worker.addEventListener("message", function() {
workers[url] = worker;
resolve();
}, {once: true});
});
};
this.terminateWorker = function(url) {
dump("Terminating worker with url '" + url + "'.\n");
workers[url].terminate();
delete workers[url];
};
this.postMessageToWorker = function(url, message) {
dump("Posting message to worker with url '" + url + "'.\n");
return new Promise(function(resolve) {
const worker = workers[url];
worker.postMessage(message);
worker.addEventListener("message", function() {
resolve();
}, {once: true});
});
};
addMessageListener("jsonrpc", function({ data: { method, params, id } }) {
method = this[method];
Promise.resolve().then(function() {
return method.apply(undefined, params);
}).then(function(result) {
sendAsyncMessage("jsonrpc", {
result: result,
error: null,
id: id
});
}, function(error) {
sendAsyncMessage("jsonrpc", {
result: null,
error: error.message.toString(),
id: id
});
});
});
addMessageListener("test:postMessageToWorker", function(message) {
dump("Posting message '" + message.data.message + "' to worker with url '" +
message.data.url + "'.\n");
let worker = workers[message.data.url];
worker.postMessage(message.data.message);
worker.addEventListener("message", function() {
sendAsyncMessage("test:postMessageToWorker");
}, {once: true});
});

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

@ -0,0 +1,8 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
</head>
<body>
</body>
</html>

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

@ -0,0 +1,8 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
</head>
<body>
</body>
</html>

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

@ -0,0 +1,8 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
</head>
<body>
</body>
</html>

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

@ -0,0 +1,14 @@
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>Empty test page 1</title>
</head>
<body>
</body>
</html>

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

@ -0,0 +1,14 @@
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>Empty test page 2</title>
</head>
<body>
</body>
</html>

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

@ -0,0 +1,18 @@
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>Debugger test page</title>
</head>
<body>
<button onclick="firstCall()">Click me!</button>
<script type="text/javascript" src="code_script-switching-01.js"></script>
<script type="text/javascript" src="code_script-switching-02.js"></script>
</body>
</html>

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

@ -0,0 +1,18 @@
<!-- Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ -->
<!doctype html>
<html>
<head>
<meta charset="utf-8"/>
<title>Debugger test page</title>
</head>
<body>
<button onclick="firstCall()">Click me!</button>
<script type="text/javascript" src="code_script-switching-01.js"></script>
<script type="text/javascript" src="code_script-switching-02.js?foo=bar,baz|lol"></script>
</body>
</html>

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

@ -16,6 +16,8 @@ const {Hosts} = require("devtools/client/framework/toolbox-hosts");
const TEST_URI_ROOT = "http://example.com/browser/devtools/client/shared/test/";
const OPTIONS_VIEW_URL = TEST_URI_ROOT + "doc_options-view.xul";
const EXAMPLE_URL = "chrome://mochitests/content/browser/devtools/client/shared/test/";
function catchFail(func) {
return function() {
try {

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

@ -0,0 +1,227 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/* eslint no-unused-vars: [2, {"vars": "local", "args": "none"}] */
"use strict";
/* import-globals-from ../../debugger/new/test/mochitest/helpers.js */
/* import-globals-from ../../debugger/new/test/mochitest/helpers/context.js */
Services.scriptloader.loadSubScript(
"chrome://mochitests/content/browser/devtools/client/debugger/new/test/mochitest/helpers.js",
this);
var { DebuggerServer } = require("devtools/server/main");
var { DebuggerClient } = require("devtools/shared/client/debugger-client");
var { Toolbox } = require("devtools/client/framework/toolbox");
const FRAME_SCRIPT_URL = getRootDirectory(gTestPath) + "code_frame-script.js";
var nextId = 0;
function getDeferredPromise() {
// Override promise with deprecated-sync-thenables
const promise = require("devtools/shared/deprecated-sync-thenables");
return promise;
}
function jsonrpc(tab, method, params) {
return new Promise(function(resolve, reject) {
const currentId = nextId++;
const messageManager = tab.linkedBrowser.messageManager;
messageManager.sendAsyncMessage("jsonrpc", {
method: method,
params: params,
id: currentId
});
messageManager.addMessageListener("jsonrpc", function listener(res) {
const { data: { result, error, id } } = res;
if (id !== currentId) {
return;
}
messageManager.removeMessageListener("jsonrpc", listener);
if (error != null) {
reject(error);
}
resolve(result);
});
});
}
function createWorkerInTab(tab, url) {
info("Creating worker with url '" + url + "' in tab.");
return jsonrpc(tab, "createWorker", [url]);
}
function terminateWorkerInTab(tab, url) {
info("Terminating worker with url '" + url + "' in tab.");
return jsonrpc(tab, "terminateWorker", [url]);
}
function postMessageToWorkerInTab(tab, url, message) {
info("Posting message to worker with url '" + url + "' in tab.");
return jsonrpc(tab, "postMessageToWorker", [url, message]);
}
function connect(client) {
info("Connecting client.");
return client.connect();
}
function close(client) {
info("Waiting for client to close.\n");
return client.close();
}
function listTabs(client) {
info("Listing tabs.");
return client.listTabs();
}
function findTab(tabs, url) {
info("Finding tab with url '" + url + "'.");
for (const tab of tabs) {
if (tab.url === url) {
return tab;
}
}
return null;
}
function attachTarget(client, tab) {
info("Attaching to tab with url '" + tab.url + "'.");
return client.attachTarget(tab.actor);
}
function listWorkers(tabClient) {
info("Listing workers.");
return tabClient.listWorkers();
}
function findWorker(workers, url) {
info("Finding worker with url '" + url + "'.");
for (const worker of workers) {
if (worker.url === url) {
return worker;
}
}
return null;
}
function attachWorker(tabClient, worker) {
info("Attaching to worker with url '" + worker.url + "'.");
return tabClient.attachWorker(worker.actor);
}
function attachThread(workerClient, options) {
info("Attaching to thread.");
return workerClient.attachThread(options);
}
function waitForWorkerClose(workerClient) {
info("Waiting for worker to close.");
return new Promise(function(resolve) {
workerClient.addOneTimeListener("close", function() {
info("Worker did close.");
resolve();
});
});
}
// Return a promise with a reference to jsterm, opening the split
// console if necessary. This cleans up the split console pref so
// it won't pollute other tests.
function getSplitConsole(toolbox, win) {
if (!win) {
win = toolbox.win;
}
if (!toolbox.splitConsole) {
EventUtils.synthesizeKey("VK_ESCAPE", {}, win);
}
return new Promise(resolve => {
toolbox.getPanelWhenReady("webconsole").then(() => {
ok(toolbox.splitConsole, "Split console is shown.");
const jsterm = toolbox.getPanel("webconsole").hud.jsterm;
resolve(jsterm);
});
});
}
async function initWorkerDebugger(TAB_URL, WORKER_URL) {
DebuggerServer.init();
DebuggerServer.registerAllActors();
const client = new DebuggerClient(DebuggerServer.connectPipe());
await connect(client);
const tab = await addTab(TAB_URL);
const { tabs } = await listTabs(client);
const [, tabClient] = await attachTarget(client, findTab(tabs, TAB_URL));
await createWorkerInTab(tab, WORKER_URL);
const { workers } = await listWorkers(tabClient);
const [, workerClient] = await attachWorker(tabClient,
findWorker(workers, WORKER_URL));
const toolbox = await gDevTools.showToolbox(TargetFactory.forWorker(workerClient),
"jsdebugger",
Toolbox.HostType.WINDOW);
const debuggerPanel = toolbox.getCurrentPanel();
const gDebugger = debuggerPanel.panelWin;
const context = createDebuggerContext(toolbox);
return { ...context, client, tab, tabClient, workerClient, toolbox, gDebugger};
}
// Override addTab/removeTab as defined by shared-head, since these have
// an extra window parameter and add a frame script
this.addTab = function addTab(url, win) {
info("Adding tab: " + url);
const deferred = getDeferredPromise().defer();
const targetWindow = win || window;
const targetBrowser = targetWindow.gBrowser;
targetWindow.focus();
const tab = targetBrowser.selectedTab = BrowserTestUtils.addTab(targetBrowser, url);
const linkedBrowser = tab.linkedBrowser;
info("Loading frame script with url " + FRAME_SCRIPT_URL + ".");
linkedBrowser.messageManager.loadFrameScript(FRAME_SCRIPT_URL, false);
BrowserTestUtils.browserLoaded(linkedBrowser)
.then(function() {
info("Tab added and finished loading: " + url);
deferred.resolve(tab);
});
return deferred.promise;
};
this.removeTab = function removeTab(tab, win) {
info("Removing tab.");
const deferred = getDeferredPromise().defer();
const targetWindow = win || window;
const targetBrowser = targetWindow.gBrowser;
const tabContainer = targetBrowser.tabContainer;
tabContainer.addEventListener("TabClose", function() {
info("Tab removed and finished closing.");
deferred.resolve();
}, {once: true});
targetBrowser.removeTab(tab);
return deferred.promise;
};

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

@ -0,0 +1,27 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
function TestActor1(connection, tab) {
this.conn = connection;
this.tab = tab;
}
TestActor1.prototype = {
actorPrefix: "testOne",
grip: function TA1_grip() {
return { actor: this.actorID,
test: "TestActor1" };
},
onPing: function TA1_onPing() {
return { pong: "pong" };
}
};
TestActor1.prototype.requestTypes = {
"ping": TestActor1.prototype.onPing
};
exports.TestActor1 = TestActor1;

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

@ -44,6 +44,7 @@
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/ContentChild.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/FeaturePolicyUtils.h"
#include "mozilla/dom/File.h"
#include "mozilla/dom/MediaStreamBinding.h"
#include "mozilla/dom/MediaStreamTrackBinding.h"
@ -2685,6 +2686,11 @@ MediaManager::GetUserMedia(nsPIDOMWindowInner* aWindow,
return NS_ERROR_FAILURE;
}
nsIDocument* doc = aWindow->GetExtantDoc();
if (NS_WARN_IF(!doc)) {
return NS_ERROR_FAILURE;
}
// This principal needs to be sent to different threads and so via IPC.
// For this reason it's better to convert it to PrincipalInfo right now.
ipc::PrincipalInfo principalInfo;
@ -2875,25 +2881,38 @@ MediaManager::GetUserMedia(nsPIDOMWindowInner* aWindow,
uint32_t audioPerm = nsIPermissionManager::UNKNOWN_ACTION;
if (IsOn(c.mAudio)) {
if (audioType == MediaSourceEnum::Microphone &&
Preferences::GetBool("media.getusermedia.microphone.deny", false)) {
audioPerm = nsIPermissionManager::DENY_ACTION;
if (audioType == MediaSourceEnum::Microphone) {
if (Preferences::GetBool("media.getusermedia.microphone.deny", false) ||
!dom::FeaturePolicyUtils::IsFeatureAllowed(doc,
NS_LITERAL_STRING("microphone"))) {
audioPerm = nsIPermissionManager::DENY_ACTION;
} else {
rv = permManager->TestExactPermissionFromPrincipal(
principal, "microphone", &audioPerm);
NS_ENSURE_SUCCESS(rv, rv);
}
} else {
rv = permManager->TestExactPermissionFromPrincipal(
principal, "microphone", &audioPerm);
principal, "screen", &audioPerm);
NS_ENSURE_SUCCESS(rv, rv);
}
}
uint32_t videoPerm = nsIPermissionManager::UNKNOWN_ACTION;
if (IsOn(c.mVideo)) {
if (videoType == MediaSourceEnum::Camera &&
Preferences::GetBool("media.getusermedia.camera.deny", false)) {
videoPerm = nsIPermissionManager::DENY_ACTION;
if (videoType == MediaSourceEnum::Camera) {
if (Preferences::GetBool("media.getusermedia.camera.deny", false) ||
!dom::FeaturePolicyUtils::IsFeatureAllowed(doc,
NS_LITERAL_STRING("camera"))) {
videoPerm = nsIPermissionManager::DENY_ACTION;
} else {
rv = permManager->TestExactPermissionFromPrincipal(
principal, "camera", &videoPerm);
NS_ENSURE_SUCCESS(rv, rv);
}
} else {
rv = permManager->TestExactPermissionFromPrincipal(
principal, videoType == MediaSourceEnum::Camera ? "camera" : "screen",
&videoPerm);
principal, "screen", &videoPerm);
NS_ENSURE_SUCCESS(rv, rv);
}
}
@ -4128,6 +4147,17 @@ MediaManager::IsActivelyCapturingOrHasAPermission(uint64_t aWindowId)
if (NS_WARN_IF(!window) || NS_WARN_IF(!window->GetPrincipal())) {
return false;
}
nsIDocument* doc = window->GetExtantDoc();
if (NS_WARN_IF(!doc)) {
return false;
}
nsIPrincipal* principal = window->GetPrincipal();
if (NS_WARN_IF(!principal)) {
return false;
}
// Check if this site has persistent permissions.
nsresult rv;
nsCOMPtr<nsIPermissionManager> mgr =
@ -4139,14 +4169,23 @@ MediaManager::IsActivelyCapturingOrHasAPermission(uint64_t aWindowId)
uint32_t audio = nsIPermissionManager::UNKNOWN_ACTION;
uint32_t video = nsIPermissionManager::UNKNOWN_ACTION;
{
auto* principal = window->GetPrincipal();
rv = mgr->TestExactPermissionFromPrincipal(principal, "microphone", &audio);
if (NS_WARN_IF(NS_FAILED(rv))) {
return false;
if (!dom::FeaturePolicyUtils::IsFeatureAllowed(doc, NS_LITERAL_STRING("microphone"))) {
audio = nsIPermissionManager::DENY_ACTION;
} else {
rv = mgr->TestExactPermissionFromPrincipal(principal, "microphone", &audio);
if (NS_WARN_IF(NS_FAILED(rv))) {
return false;
}
}
rv = mgr->TestExactPermissionFromPrincipal(principal, "camera", &video);
if (NS_WARN_IF(NS_FAILED(rv))) {
return false;
if (!dom::FeaturePolicyUtils::IsFeatureAllowed(doc,
NS_LITERAL_STRING("camera"))) {
video = nsIPermissionManager::DENY_ACTION;
} else {
rv = mgr->TestExactPermissionFromPrincipal(principal, "camera", &video);
if (NS_WARN_IF(NS_FAILED(rv))) {
return false;
}
}
}
return audio == nsIPermissionManager::ALLOW_ACTION ||

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

@ -26,12 +26,10 @@ struct FeatureMap {
*/
static FeatureMap sSupportedFeatures[] = {
{ "autoplay", FeatureMap::eAll },
// TODO: not supported yet!!!
{ "camera", FeatureMap::eAll },
{ "encrypted-media", FeatureMap::eAll },
{ "fullscreen", FeatureMap::eAll },
{ "geolocation", FeatureMap::eAll },
// TODO: not supported yet!!!
{ "microphone", FeatureMap::eAll },
{ "midi", FeatureMap::eAll },
{ "payment", FeatureMap::eAll },

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

@ -30,7 +30,7 @@
#include "gfxVRPuppet.h"
#include "ipc/VRLayerParent.h"
#if defined(XP_WIN) || defined(XP_MACOSX) || (defined(XP_LINUX) && !defined(MOZ_WIDGET_ANDROID))
#if !defined(MOZ_WIDGET_ANDROID)
#include "service/VRService.h"
#endif
@ -99,7 +99,7 @@ VRManager::VRManager()
* to support everyone else.
*/
#if defined(XP_WIN) || defined(XP_MACOSX) || (defined(XP_LINUX) && !defined(MOZ_WIDGET_ANDROID))
#if !defined(MOZ_WIDGET_ANDROID)
// The VR Service accesses all hardware from a separate process
// and replaces the other VRSystemManager when enabled.
if (!gfxPrefs::VRProcessEnabled()) {
@ -167,7 +167,7 @@ VRManager::Destroy()
for (uint32_t i = 0; i < mManagers.Length(); ++i) {
mManagers[i]->Destroy();
}
#if defined(XP_WIN) || defined(XP_MACOSX) || (defined(XP_LINUX) && !defined(MOZ_WIDGET_ANDROID))
#if !defined(MOZ_WIDGET_ANDROID)
if (mVRService) {
mVRService->Stop();
mVRService = nullptr;
@ -184,7 +184,7 @@ VRManager::Shutdown()
for (uint32_t i = 0; i < mManagers.Length(); ++i) {
mManagers[i]->Shutdown();
}
#if defined(XP_WIN) || defined(XP_MACOSX) || (defined(XP_LINUX) && !defined(MOZ_WIDGET_ANDROID))
#if !defined(MOZ_WIDGET_ANDROID)
if (mVRService) {
mVRService->Stop();
}
@ -546,7 +546,7 @@ VRManager::RefreshVRDisplays(bool aMustDispatch)
* or interrupt other VR activities.
*/
if (mVRDisplaysRequested || aMustDispatch) {
#if defined(XP_WIN) || defined(XP_MACOSX) || (defined(XP_LINUX) && !defined(MOZ_WIDGET_ANDROID))
#if !defined(MOZ_WIDGET_ANDROID)
// Tell VR process to start VR service.
if (gfxPrefs::VRProcessEnabled() && !mVRServiceStarted) {
RefPtr<Runnable> task = NS_NewRunnableFunction(

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

@ -24,7 +24,7 @@ namespace gfx {
class VRLayerParent;
class VRManagerParent;
class VRDisplayHost;
#if defined(XP_WIN) || defined(XP_MACOSX) || (defined(XP_LINUX) && !defined(MOZ_WIDGET_ANDROID))
#if !defined(MOZ_WIDGET_ANDROID)
class VRService;
#endif
class VRSystemManagerPuppet;
@ -108,7 +108,7 @@ private:
double mAccumulator100ms;
RefPtr<VRSystemManagerPuppet> mPuppetManager;
RefPtr<VRSystemManagerExternal> mExternalManager;
#if defined(XP_WIN) || defined(XP_MACOSX) || (defined(XP_LINUX) && !defined(MOZ_WIDGET_ANDROID))
#if !defined(MOZ_WIDGET_ANDROID)
RefPtr<VRService> mVRService;
#endif
bool mVRDisplaysRequested;

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

@ -26,7 +26,7 @@ VRGPUParent::VRGPUParent(ProcessId aChildProcessId)
void
VRGPUParent::ActorDestroy(ActorDestroyReason aWhy)
{
#if defined(XP_WIN) || defined(XP_MACOSX) || (defined(XP_LINUX) && !defined(MOZ_WIDGET_ANDROID))
#if !defined(MOZ_WIDGET_ANDROID)
if (mVRService) {
mVRService->Stop();
mVRService = nullptr;
@ -72,7 +72,7 @@ VRGPUParent::Bind(Endpoint<PVRGPUParent>&& aEndpoint)
mozilla::ipc::IPCResult
VRGPUParent::RecvStartVRService()
{
#if defined(XP_WIN) || defined(XP_MACOSX) || (defined(XP_LINUX) && !defined(MOZ_WIDGET_ANDROID))
#if !defined(MOZ_WIDGET_ANDROID)
mVRService = VRService::Create();
MOZ_ASSERT(mVRService);
@ -85,7 +85,7 @@ VRGPUParent::RecvStartVRService()
mozilla::ipc::IPCResult
VRGPUParent::RecvStopVRService()
{
#if defined(XP_WIN) || defined(XP_MACOSX) || (defined(XP_LINUX) && !defined(MOZ_WIDGET_ANDROID))
#if !defined(MOZ_WIDGET_ANDROID)
if (mVRService) {
mVRService->Stop();
mVRService = nullptr;

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

@ -32,7 +32,7 @@ private:
void DeferredDestroy();
RefPtr<VRGPUParent> mSelfRef;
#if defined(XP_WIN) || defined(XP_MACOSX) || (defined(XP_LINUX) && !defined(MOZ_WIDGET_ANDROID))
#if !defined(MOZ_WIDGET_ANDROID)
RefPtr<VRService> mVRService;
#endif
};
@ -40,4 +40,4 @@ private:
} // namespace gfx
} // namespace mozilla
#endif // GFX_VR_CONTENT_PARENT_H
#endif // GFX_VR_CONTENT_PARENT_H

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

@ -65,7 +65,6 @@ SOURCES += [
if CONFIG['OS_TARGET'] in ('WINNT', 'Linux', 'Darwin'):
DIRS += [
'openvr',
'service',
]
SOURCES += [
'gfxVROpenVR.cpp',
@ -78,6 +77,10 @@ if CONFIG['OS_TARGET'] == 'WINNT':
if CONFIG['OS_TARGET'] == 'Android':
LOCAL_INCLUDES += ['/widget/android']
else:
DIRS += [
'service',
]
IPDL_SOURCES = [
'ipc/PVR.ipdl',

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

@ -11,6 +11,8 @@
#if defined(XP_WIN) || defined(XP_MACOSX) || (defined(XP_LINUX) && !defined(MOZ_WIDGET_ANDROID))
#include "OpenVRSession.h"
#endif
#if !defined(MOZ_WIDGET_ANDROID)
#include "OSVRSession.h"
#endif
@ -220,6 +222,8 @@ VRService::ServiceInitialize()
session = nullptr;
}
}
#endif
#if !defined(MOZ_WIDGET_ANDROID)
// Try OSVR
if (!session) {
session = MakeUnique<OSVRSession>();

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

@ -8,6 +8,7 @@
#define GFX_VR_SERVICE_VRSERVICE_H
#include "mozilla/Atomics.h"
#include "base/process.h" // for ProcessHandle
#include "moz_external_vr.h"

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

@ -8,20 +8,20 @@
if CONFIG['OS_TARGET'] != 'Android':
UNIFIED_SOURCES += [
'OSVRSession.cpp',
'VRService.cpp',
'VRSession.cpp',
]
include('/ipc/chromium/chromium-config.mozbuild')
# Build OpenVR on Windows, Linux, and macOS desktop targets
if CONFIG['OS_TARGET'] in ('WINNT', 'Linux', 'Darwin'):
UNIFIED_SOURCES += [
'OpenVRSession.cpp',
'VRService.cpp',
'VRSession.cpp',
]
LOCAL_INCLUDES += [
'/dom/base',
'/gfx/layers/d3d11',
'/gfx/thebes',
]
include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'

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

@ -66,7 +66,7 @@ void main(void) {
// effect. We can tidy this up as we move
// more items to be brush shaders.
#ifdef WR_FEATURE_ALPHA_PASS
init_transform_vs(vec4(vec2(-1000000.0), vec2(1000000.0)));
init_transform_vs(vec4(vec2(-1.0e16), vec2(1.0e16)));
#endif
} else {
bvec4 edge_mask = notEqual(edge_flags & ivec4(1, 2, 4, 8), ivec4(0));

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

@ -1 +1 @@
69fddc3faf1a379a560106f12687d08cbbe304dd
1396114d80fb19df2295a40b0b14abc8f24afa03

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

@ -1,4 +1,4 @@
// |jit-test| error: TypeError; skip-if !('gczeal' in this)
// |jit-test| error: TypeError; skip-if: !('gczeal' in this)
var g = newGlobal();
gczeal(10, 2)
var dbg = Debugger(g);

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

@ -33,7 +33,7 @@ fuzzy(0-26,0-3610) fuzzy-if(d2d,0-26,0-5910) == boxshadow-rotated.html boxshadow
== boxshadow-inset-large-border-radius.html boxshadow-inset-large-border-radius-ref.html
# fuzzy due to blur going inside, but as long as it's essentially black instead of a light gray its ok.
fuzzy(0-13,0-9445) fuzzy-if(d2d,0-13,0-10926) fails-if(webrender) == boxshadow-inset-large-offset.html boxshadow-inset-large-offset-ref.html
fuzzy(0-13,0-9445) fuzzy-if(d2d,0-13,0-10926) fuzzy-if(webrender,14-15,11263-13267) == boxshadow-inset-large-offset.html boxshadow-inset-large-offset-ref.html
== overflow-not-scrollable-1.html overflow-not-scrollable-1-ref.html
== overflow-not-scrollable-1.html overflow-not-scrollable-1-ref2.html

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

@ -305,7 +305,7 @@ fuzzy-if(Android,0-3,0-50) fuzzy-if(skiaContent,0-1,0-133) == 273681-1.html 2736
== 283686-2.html 283686-2-ref.html
== 283686-3.html about:blank
== 289384-1.xhtml 289384-ref.xhtml
fails-if(webrender) random-if(d2d) fuzzy-if(Android,0-8,0-1439) HTTP == 289480.html#top 289480-ref.html # basically-verbatim acid2 test, HTTP for a 404 page -- bug 578114 for the d2d failures
fails-if(webrender&&!winWidget) random-if(d2d) fuzzy-if(Android,0-8,0-1439) HTTP == 289480.html#top 289480-ref.html # basically-verbatim acid2 test, HTTP for a 404 page -- bug 578114 for the d2d failures
== 290129-1.html 290129-1-ref.html
== 291078-1.html 291078-1-ref.html
== 291078-2.html 291078-2-ref.html
@ -1164,13 +1164,13 @@ random == 445004-1.html 445004-1-ref.html # bug 472268
== 445142-1c.html 445142-1-ref.html
== 445142-2a.html 445142-2-ref.html
== 445142-2b.html 445142-2-ref.html
fails-if(usesRepeatResampling) fails-if(webrender) == 446100-1a.html about:blank
fails-if(Android) fails-if(usesRepeatResampling) fails-if(webrender) == 446100-1b.html about:blank
fails-if(Android) fails-if(usesRepeatResampling) fails-if(webrender) == 446100-1c.html about:blank
fails-if(usesRepeatResampling) fails-if(webrender) == 446100-1d.html about:blank
fails-if(usesRepeatResampling) fails-if(webrender) == 446100-1e.html about:blank
fails-if(usesRepeatResampling) fails-if(webrender&&!winWidget) == 446100-1a.html about:blank
fails-if(Android) fails-if(usesRepeatResampling) fails-if(webrender&&!winWidget) == 446100-1b.html about:blank
fails-if(Android) fails-if(usesRepeatResampling) fails-if(webrender&&!winWidget) == 446100-1c.html about:blank
fails-if(usesRepeatResampling) fails-if(webrender&&!winWidget) == 446100-1d.html about:blank
fails-if(usesRepeatResampling) fails-if(webrender&&!winWidget) == 446100-1e.html about:blank
== 446100-1f.html about:blank
fails-if(usesRepeatResampling) fails-if(Android) fails-if(webrender) == 446100-1g.html about:blank
fails-if(usesRepeatResampling) fails-if(Android) fails-if(webrender&&!winWidget) == 446100-1g.html about:blank
== 446100-1h.html about:blank
== 447749-1.html 447749-1-ref.html
fuzzy(0-127,0-2) == 448193.html 448193-ref.html
@ -1999,8 +1999,8 @@ fuzzy-if(Android,0-27,0-874) fuzzy-if(!Android,0-14,0-43) == 1313772.xhtml 13137
fuzzy(0-2,0-320000) == 1315113-1.html 1315113-1-ref.html
fuzzy(0-2,0-20000) == 1315113-2.html 1315113-2-ref.html
== 1315632-1.html 1315632-1-ref.html
fuzzy(0-2,0-40000) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-13,0-40000) fails-if(webrender) == 1316719-1a.html 1316719-1-ref.html
fuzzy(0-13,0-40000) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-13,0-40000) fails-if(webrender) == 1316719-1b.html 1316719-1-ref.html
fuzzy(0-2,0-40000) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-13,0-40000) == 1316719-1a.html 1316719-1-ref.html
fuzzy(0-13,0-40000) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-13,0-40000) == 1316719-1b.html 1316719-1-ref.html
fuzzy(0-13,0-40000) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-13,0-40000) == 1316719-1c.html 1316719-1-ref.html
skip-if(Android) != 1318769-1.html 1318769-1-ref.html
== 1322512-1.html 1322512-1-ref.html

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

@ -44,8 +44,8 @@ pref(layout.animated-image-layers.enabled,true) skip-if(Android||gtkWidget) == t
== filter-userspace-offset.svg?offsetContainer=rect&filter=matrix-fillPaint-boundingBox filter-userspace-offset.svg
== filter-userspace-offset.svg?offsetContainer=rect&filter=matrix-fillPaint-userSpace-at100 filter-userspace-offset.svg
fails-if(webrender) fails-if(!Android) != scroll-inactive-layers.html about:blank # bug 1494110 for the fails-if(!Android) (Android is a false pass, no doubt)
fails-if(webrender) fails-if(!Android) != scroll-inactive-layers-2.html about:blank # bug 1494110 for the fails-if(!Android) (Android is a false pass, no doubt)
fails-if(!Android) != scroll-inactive-layers.html about:blank # bug 1494110 for the fails-if(!Android) (Android is a false pass, no doubt)
fails-if(!Android) != scroll-inactive-layers-2.html about:blank # bug 1494110 for the fails-if(!Android) (Android is a false pass, no doubt)
!= inactive-layertree-visible-region-1.html about:blank
!= inactive-layertree-visible-region-2.html about:blank
!= transform-floating-point-invalidation.html about:blank

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

@ -25,8 +25,8 @@ fuzzy-if(webrender,5-7,19040-22652) == blur-zoomed-page.html blur-zoomed-page-re
== contrast-reduce.html contrast-reduce-ref.html
== contrast-zero.html contrast-zero-ref.html
fuzzy-if(webrender,9-9,2625-3002) == drop-shadow.html drop-shadow-ref.html
fuzzy-if(webrender,9-9,2625-3002) fails-if(webrender&&winWidget) == drop-shadow-default-color.html drop-shadow-default-color-ref.html
fuzzy-if(webrender,9-9,2625-3002) fails-if(webrender&&winWidget) == drop-shadow-negative-offset.html drop-shadow-negative-offset-ref.html
fuzzy-if(webrender,9-9,2625-3002) == drop-shadow-default-color.html drop-shadow-default-color-ref.html
fuzzy-if(webrender,9-9,2625-3002) == drop-shadow-negative-offset.html drop-shadow-negative-offset-ref.html
== filter-on-huge-bbox.html pass.svg
== filter-on-outer-svg.html pass.svg
fuzzy-if(webrender,0-1,0-10000) fuzzy-if(d2d,0-1,0-10000) == grayscale.html grayscale-ref.html

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

@ -2,7 +2,7 @@
[browser_bug685470.js]
[browser_bug703210.js]
skip-if = os == 'linux' && debug || (verify && (os == 'linux')) # Bug 1382428
skip-if = os == 'linux' || (verify && (os == 'linux')) # Bug 1382428
[browser_bug706743.js]
skip-if = (os == 'linux') || e10s # Bug 1157576
[browser_bug1163304.js]

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

@ -51,6 +51,7 @@ jobs:
by-project:
mozilla-beta: LATEST_FIREFOX_RELEASED_DEVEL_VERSION
mozilla-release: LATEST_FIREFOX_VERSION
mozilla-esr60: FIREFOX_ESR
default: LATEST_FIREFOX_DEVEL_VERSION
products-url: https://product-details.mozilla.org/1.0/firefox_versions.json
treeherder:

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

@ -40,7 +40,7 @@ def generate_upstream_artifacts(job, release_history, platform, locale=None):
# considered smaller than Firefox 56
if version is None or version >= '56'
],
"formats": ["autograph_mar384"],
"formats": ["autograph_hash_only_mar384"],
}]
old_mar_upstream_artifacts = {
@ -103,7 +103,7 @@ def make_task_description(config, jobs):
build_platform, is_nightly, config
)
scopes = [signing_cert_scope, 'project:releng:signing:format:autograph_mar384']
scopes = [signing_cert_scope, 'project:releng:signing:format:autograph_hash_only_mar384']
if any("mar" in upstream_details["formats"] for upstream_details in upstream_artifacts):
scopes.append('project:releng:signing:format:mar')

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

@ -36,7 +36,7 @@ repackage_signing_description_schema = Schema({
})
SIGNING_FORMATS = {
'target.complete.mar': ["autograph_mar384"],
'target.complete.mar': ["autograph_hash_only_mar384"],
'target.bz2.complete.mar': ["mar"],
"target.installer.exe": ["sha2signcode"],
"target.stub-installer.exe": ["sha2signcodestub"],

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

@ -40,6 +40,7 @@ Documentation
* [C# API](https://seleniumhq.github.io/selenium/docs/api/dotnet/)
* [JavaScript API](https://seleniumhq.github.io/selenium/docs/api/javascript/)
* [Java API](https://seleniumhq.github.io/selenium/docs/api/java/)
* [Perl API](https://metacpan.org/pod/Selenium::Remote::Driver)
* [Python API](https://seleniumhq.github.io/selenium/docs/api/py/)
* [Ruby API](https://seleniumhq.github.io/selenium/docs/api/rb/)

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

@ -28,12 +28,13 @@ As these are functional integration tests and pop up Firefox windows
sporadically, a helpful tip is to surpress the window whilst you
are running them by using Firefox [headless mode]:
% MOZ_HEADLESS=1 ./mach wpt testing/web-platform/tests/webdriver
% ./mach wpt --headless testing/web-platform/tests/webdriver
In addition to the `MOZ_HEADLESS` output variable there is also
`MOZ_HEADLESS_WIDTH` and `MOZ_HEADLESS_HEIGHT` to control the
The `--headless` flag is equivalent to setting the `MOZ_HEADLESS`
output variable. In addition to `MOZ_HEADLESS` there is also
`MOZ_HEADLESS_WIDTH` and `MOZ_HEADLESS_HEIGHT` for controlling the
dimensions of the no-op virtual display. This is similar to using
xvfb(1) which you may know from the X windowing system, but has
Xvfb(1) which you may know from the X windowing system, but has
the additional benefit of also working on macOS and Windows.
As you get in to development of geckodriver and Marionette you will

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

@ -65,12 +65,12 @@ and a helpful tip is to suppress the window can be to use Firefox
% ./mach marionette test -z TEST
`-z` is an alias for `--headless` and equivalent to setting the
`MOZ_HEADLESS` output variable. In addition to `MOZ_HEADLESS` there
is also `MOZ_HEADLESS_WIDTH` and `MOZ_HEADLESS_HEIGHT` for controlling
the dimensions of the no-op virtual display. This is similar to
using xvfb(1) which you may know from the X windowing system, but
has the additional benefit of also working on macOS and Windows.
`-z` is an alias for the `--headless` flag and equivalent to setting
the `MOZ_HEADLESS` output variable. In addition to `MOZ_HEADLESS`
there is also `MOZ_HEADLESS_WIDTH` and `MOZ_HEADLESS_HEIGHT` for
controlling the dimensions of the no-op virtual display. This is
similar to using Xvfb(1) which you may know from the X windowing system,
but has the additional benefit of also working on macOS and Windows.
### Android

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

@ -101,6 +101,18 @@ class BouncerCheck(BaseScript, VirtualenvMixin):
def check_url(self, session, url):
from redo import retry
try:
from urllib.parse import urlparse
except ImportError:
# Python 2
from urlparse import urlparse
mozilla_locations = [
'download-installer.cdn.mozilla.net',
'download.cdn.mozilla.net',
'download.mozilla.org',
'archive.mozilla.org',
]
def do_check_url():
self.log("Checking {}".format(url))
@ -111,6 +123,13 @@ class BouncerCheck(BaseScript, VirtualenvMixin):
self.warning("FAIL: {}, status: {}".format(url, r.status_code))
raise
final_url = urlparse(r.url)
if final_url.scheme != 'https':
self.warning('FAIL: URL scheme is not https: {}'.format(r.url))
if final_url.netloc not in mozilla_locations:
self.warning('FAIL: host not in allowed locations: {}'.format(r.url))
retry(do_check_url, sleeptime=3, max_sleeptime=10, attempts=3)
def get_urls(self):

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

@ -2,38 +2,20 @@
[Default "microphone" feature policy ["self"\] disallows cross-origin iframes.]
expected: FAIL
[Feature policy "microphone" can be enabled in cross-origin iframes using "allow" attribute.]
expected: FAIL
[Default "camera" feature policy ["self"\] disallows cross-origin iframes.]
expected: FAIL
[Feature policy "camera" can be enabled in cross-origin iframes using "allow" attribute.]
expected: FAIL
[Default "camera; microphone" feature policy ["self"\] disallows cross-origin iframes.]
expected: FAIL
[Feature policy "camera; microphone" can be enabled in cross-origin iframes using "allow" attribute.]
expected: FAIL
[MediaStream-default-feature-policy.https.html]
[Default "microphone" feature policy ["self"\] disallows cross-origin iframes.]
expected: FAIL
[Feature policy "microphone" can be enabled in cross-origin iframes using "allow" attribute.]
expected: FAIL
[Default "camera" feature policy ["self"\] disallows cross-origin iframes.]
expected: FAIL
[Feature policy "camera" can be enabled in cross-origin iframes using "allow" attribute.]
expected: FAIL
[Default "camera; microphone" feature policy ["self"\] disallows cross-origin iframes.]
expected: FAIL
[Feature policy "camera; microphone" can be enabled in cross-origin iframes using "allow" attribute.]
expected: FAIL

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

@ -1,2 +1,2 @@
prefs: [media.navigator.permission.disabled:true, media.navigator.streams.fake:true]
prefs: [media.navigator.permission.disabled:true, media.navigator.streams.fake:true, dom.security.featurePolicy.enabled:true]
lsan-allowed: [Alloc, NewEmptyScopeData, XPCWrappedNative::GetNewOrUsed, js_new, mozilla::BasePrincipal::CreateCodebasePrincipal, mozilla::dom::ChromeUtils::GenerateQI, nsStringBuffer::Alloc]

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

@ -140,6 +140,7 @@ support-files = window_navigate_persist.html
[test_menulist_position.xul]
[test_mousescroll.xul]
[test_notificationbox.xul]
skip-if = (os == 'linux' && debug) || (os == 'win') # Bug 1429649
[test_panel.xul]
[test_panel_anchoradjust.xul]
[test_panelfrommenu.xul]