Commit c5bc5672 authored by Dorel Luca's avatar Dorel Luca
Browse files

Backed out 4 changesets (bug 1314057) for devtool failures. a=backout

Backed out changeset f46426835026 (bug 1314057)
Backed out changeset 90480b4b4c43 (bug 1314057)
Backed out changeset fa0d46e77437 (bug 1314057)
Backed out changeset 241f876d557f (bug 1314057)

--HG--
rename : devtools/client/shared/test/addon1.xpi => devtools/client/debugger/test/mochitest/addon1.xpi
rename : devtools/client/shared/test/addon2.xpi => devtools/client/debugger/test/mochitest/addon2.xpi
rename : devtools/client/debugger/new/test/mochitest/browser_dbg_global-method-override.js => devtools/client/debugger/test/mochitest/browser_dbg_global-method-override.js
rename : devtools/client/shared/test/browser_dbg_globalactor.js => devtools/client/debugger/test/mochitest/browser_dbg_globalactor.js
rename : devtools/client/shared/test/browser_dbg_listaddons.js => devtools/client/debugger/test/mochitest/browser_dbg_listaddons.js
rename : devtools/client/shared/test/browser_dbg_listtabs-01.js => devtools/client/debugger/test/mochitest/browser_dbg_listtabs-01.js
rename : devtools/client/shared/test/browser_dbg_listtabs-02.js => devtools/client/debugger/test/mochitest/browser_dbg_listtabs-02.js
rename : devtools/client/shared/test/browser_dbg_listtabs-03.js => devtools/client/debugger/test/mochitest/browser_dbg_listtabs-03.js
rename : devtools/client/shared/test/browser_dbg_multiple-windows.js => devtools/client/debugger/test/mochitest/browser_dbg_multiple-windows.js
rename : devtools/client/shared/test/browser_dbg_navigation.js => devtools/client/debugger/test/mochitest/browser_dbg_navigation.js
rename : devtools/client/shared/test/browser_dbg_target-scoped-actor-01.js => devtools/client/debugger/test/mochitest/browser_dbg_target-scoped-actor-01.js
rename : devtools/client/shared/test/browser_dbg_target-scoped-actor-02.js => devtools/client/debugger/test/mochitest/browser_dbg_target-scoped-actor-02.js
rename : devtools/client/debugger/new/test/mochitest/examples/doc_global-method-override.html => devtools/client/debugger/test/mochitest/doc_global-method-override.html
parent fa375662
......@@ -624,7 +624,6 @@ 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
......@@ -687,8 +686,6 @@ 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]
......
......@@ -6,6 +6,8 @@ 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
......@@ -68,6 +70,7 @@ 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
......@@ -144,6 +147,10 @@ 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]
......@@ -186,6 +193,10 @@ 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]
......@@ -194,4 +205,15 @@ 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,6 +6,8 @@ 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
......@@ -68,6 +70,7 @@ 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
......@@ -156,6 +159,8 @@ 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
......
/* -*- 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;
});
/* -*- 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;
});
......@@ -5,14 +5,22 @@
/**
* 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
* 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";
const TAB_URL = EXAMPLE_URL + "doc_global-method-override.html";
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.");
});
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);
});
}
......@@ -7,13 +7,7 @@
* Check extension-added global actor API.
*/
"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";
const ACTORS_URL = CHROME_URL + "testactors.js";
add_task(async function() {
DebuggerServer.init();
......@@ -49,7 +43,7 @@ add_task(async function() {
for (const connID of Object.getOwnPropertyNames(DebuggerServer._connections)) {
const conn = DebuggerServer._connections[connID];
const actorPrefix = conn._prefix + "testOne";
for (const pool of conn._extraPools) {
for (let pool of conn._extraPools) {
for (const actor of pool.poolChildren()) {
if (actor.actorID.startsWith(actorPrefix)) {
count++;
......
......@@ -3,16 +3,6 @@
/* 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);
/**
* Make sure the listAddons request works as specified.
*/
......@@ -21,13 +11,13 @@ const ADDON1_PATH = "addon1.xpi";
const ADDON2_ID = "jid1-qjtzNGV8xw5h2A@jetpack";
const ADDON2_PATH = "addon2.xpi";
var gAddon1, gAddon1Actor, gAddon2, gClient;
var gAddon1, gAddon1Actor, gAddon2, gAddon2Actor, gClient;
function test() {
DebuggerServer.init();
DebuggerServer.registerAllActors();
const transport = DebuggerServer.connectPipe();
let transport = DebuggerServer.connectPipe();
gClient = new DebuggerClient(transport);
gClient.connect().then(([aType, aTraits]) => {
is(aType, "browser",
......@@ -40,8 +30,8 @@ function test() {
.then(testRemoveSecondAddon)
.then(() => gClient.close())
.then(finish)
.catch(error => {
ok(false, "Got an error: " + error.message + "\n" + error.stack);
.catch(aError => {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
});
}
......@@ -52,31 +42,32 @@ function testFirstAddon() {
addonListChanged = true;
});
return addTemporaryAddon(ADDON1_PATH).then(addon => {
gAddon1 = addon;
return addTemporaryAddon(ADDON1_PATH).then(aAddon => {
gAddon1 = aAddon;
return getAddonActorForId(gClient, ADDON1_ID).then(grip => {
return getAddonActorForId(gClient, ADDON1_ID).then(aGrip => {
ok(!addonListChanged, "Should not yet be notified that list of addons changed.");
ok(grip, "Should find an addon actor for addon1.");
gAddon1Actor = grip.actor;
ok(aGrip, "Should find an addon actor for addon1.");
gAddon1Actor = aGrip.actor;
});
});
}
function testSecondAddon() {
let addonListChanged = false;
gClient.addOneTimeListener("addonListChanged", function() {
gClient.addOneTimeListener("addonListChanged", function () {
addonListChanged = true;
});
return addTemporaryAddon(ADDON2_PATH).then(addon => {
gAddon2 = addon;
return addTemporaryAddon(ADDON2_PATH).then(aAddon => {
gAddon2 = aAddon;
return getAddonActorForId(gClient, ADDON1_ID).then(fistGrip => {
return getAddonActorForId(gClient, ADDON2_ID).then(secondGrip => {
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(fistGrip.actor, gAddon1Actor, "First addon's actor shouldn't have changed.");
ok(secondGrip, "Should find a addon actor for the second addon.");
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;
});
});
});
......@@ -84,80 +75,36 @@ function testSecondAddon() {
function testRemoveFirstAddon() {
let addonListChanged = false;
gClient.addOneTimeListener("addonListChanged", function() {
gClient.addOneTimeListener("addonListChanged", function () {
addonListChanged = true;
});
return removeAddon(gAddon1).then(() => {
return getAddonActorForId(gClient, ADDON1_ID).then(grip => {
return getAddonActorForId(gClient, ADDON1_ID).then(aGrip => {
ok(addonListChanged, "Should be notified that list of addons changed.");
ok(!grip, "Shouldn't find a addon actor for the first addon anymore.");
ok(!aGrip, "Shouldn't find a addon actor for the first addon anymore.");
});
});
}
function testRemoveSecondAddon() {
let addonListChanged = false;
gClient.addOneTimeListener("addonListChanged", function() {
gClient.addOneTimeListener("addonListChanged", function () {
addonListChanged = true;
});
return removeAddon(gAddon2).then(() => {
return getAddonActorForId(gClient, ADDON2_ID).then(grip => {
return getAddonActorForId(gClient, ADDON2_ID).then(aGrip => {
ok(addonListChanged, "Should be notified that list of addons changed.");
ok(!grip, "Shouldn't find a addon actor for the second addon anymore.");
ok(!aGrip, "Shouldn't find a addon actor for the second addon anymore.");
});
});
}
registerCleanupFunction(function() {
registerCleanupFunction(function () {
gAddon1 = null;
gAddon1Actor = null;
gAddon2 = null;
gAddon2Actor = 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(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;
}
......@@ -3,15 +3,10 @@
/* 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";
......@@ -21,7 +16,7 @@ function test() {
DebuggerServer.init();
DebuggerServer.registerAllActors();
const transport = DebuggerServer.connectPipe();
let transport = DebuggerServer.connectPipe();
gClient = new DebuggerClient(transport);
gClient.connect().then(([aType, aTraits]) => {
is(aType, "browser",
......@@ -34,32 +29,32 @@ function test() {
.then(testAttachRemovedTab)
.then(() => gClient.close())
.then(finish)
.catch(error => {
ok(false, "Got an error: " + error.message + "\n" + error.stack);
.catch(aError => {
ok(false, "Got an error: " + aError.message + "\n" + aError.stack);
});
});
}
function testFirstTab() {
return addTab(TAB1_URL).then(tab => {
gTab1 = tab;
return addTab(TAB1_URL).then(aTab => {
gTab1 = aTab;
return getTargetActorForUrl(gClient, TAB1_URL).then(grip => {
ok(grip, "Should find a target actor for the first tab.");
gTab1Actor = grip.actor;
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(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;
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;
});
});
});
......@@ -67,23 +62,23 @@ function testSecondTab() {
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.");
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(() => {
const deferred = promise.defer();
let deferred = promise.defer();