Bug 1495388 - Fix test failures associated with async inspector initalization; r=ochameau

Depends on D8707

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
yulia 2018-10-30 14:51:40 +00:00
Родитель d11d6e404d
Коммит 19c4784940
42 изменённых файлов: 84 добавлений и 114 удалений

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

@ -2754,7 +2754,7 @@ Toolbox.prototype = {
}
this._destroyingInspector = (async function() {
if (!this._inspector) {
if (!this._inspector && !this._initInspector) {
return;
}

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

@ -85,13 +85,13 @@ add_task(async function test() {
async function runTests() {
const target = await TargetFactory.forTab(gBrowser.selectedTab);
await target.attach();
inspector = target.getFront("inspector");
const walker = await inspector.getWalker();
inspector = await target.getInspector();
const walker = inspector.walker;
completer = new CSSCompleter({walker: walker,
cssProperties: getClientCssProperties()});
await checkStateAndMoveOn();
await completer.walker.release();
inspector.destroy();
await target.destroy();
inspector = null;
completer = null;
}

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

@ -15,8 +15,8 @@ add_task(async function() {
async function runTests() {
const target = await TargetFactory.forTab(gBrowser.selectedTab);
await target.attach();
const inspector = target.getFront("inspector");
const walker = await inspector.getWalker();
const inspector = await target.getInspector();
const walker = inspector.walker;
const {ed, win, edWin} = await setup(null, {
autocomplete: true,
mode: Editor.modes.css,

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

@ -78,8 +78,8 @@ async function initLayoutFrontForUrl(url) {
async function initAccessibilityFrontForUrl(url) {
const target = await addTabTarget(url);
const inspector = target.getFront("inspector");
const walker = await inspector.getWalker();
const inspector = await target.getInspector();
const walker = inspector.walker;
const accessibility = target.getFront("accessibility");
await accessibility.bootstrap();
@ -110,8 +110,8 @@ async function initPerfFront() {
async function initInspectorFront(url) {
const target = await addTabTarget(url);
const inspector = target.getFront("inspector");
const walker = await inspector.getWalker();
const inspector = await target.getInspector();
const walker = inspector.walker;
return {inspector, walker, target};
}

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

@ -25,10 +25,9 @@ window.onload = function() {
const url = document.getElementById("animationContent").href;
const { target } = await attachURL(url);
const inspector = target.getInspector();
const inspector = await target.getInspector();
animationsFront = target.getFront("animations");
gWalker = await inspector.getWalker();
ok(gWalker, "getWalker() should return an actor.");
gWalker = inspector.walker;
runNextTest();
});

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

@ -35,10 +35,8 @@ window.onload = function() {
const url = document.getElementById("inspectorContent").href;
const { target, doc } = await attachURL(url);
gInspectee = doc;
const inspector = target.getInspector();
const walker = await inspector.getWalker();
ok(walker, "getWalker() should return an actor.");
gWalker = walker;
const inspector = await target.getInspector();
gWalker = inspector.walker;
runNextTest();
});

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

@ -25,9 +25,8 @@ addTest(async function setup() {
const url = document.getElementById("inspectorContent").href;
const { target, doc } = await attachURL(url);
gInspectee = doc;
const inspector = target.getInspector();
gWalker = await inspector.getWalker();
ok(gWalker, "getWalker() should return an actor.");
const inspector = await target.getInspector();
gWalker = inspector.walker;
runNextTest();
});

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

@ -25,10 +25,8 @@ addTest(async function setup() {
const url = document.getElementById("inspectorContent").href;
const { target, doc } = await attachURL(url);
gInspectee = doc;
const inspector = target.getInspector();
const walker = await inspector.getWalker();
ok(walker, "getWalker() should return an actor.");
gWalker = walker;
const inspector = await target.getInspector();
gWalker = inspector.walker;
runNextTest();
});

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

@ -25,8 +25,8 @@ addAsyncTest(async function() {
const url = document.getElementById("inspectorContent").href;
const { target, doc } = await attachURL(url);
gDoc = doc;
const inspector = target.getInspector();
gWalker = await inspector.getWalker();
const inspector = await target.getInspector();
gWalker = inspector.walker;
runNextTest();
});

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

@ -23,8 +23,8 @@ var gWalker;
addTest(async function setup() {
const url = document.getElementById("inspectorContent").href;
const { target } = await attachURL(url);
const inspector = target.getInspector();
gWalker = await inspector.getWalker();
const inspector = await target.getInspector();
gWalker = inspector.walker;
runNextTest();
});

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

@ -23,9 +23,8 @@ let gWalker = null;
addTest(async function setup() {
const url = document.getElementById("inspectorContent").href;
const { target } = await attachURL(url);
const inspector = target.getInspector();
gWalker = await inspector.getWalker();
ok(gWalker, "getWalker() should return an actor.");
const inspector = await target.getInspector();
gWalker = inspector.walker;
runNextTest();
});

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

@ -24,10 +24,9 @@ let gInspectee = null;
addTest(async function setup() {
const url = document.getElementById("inspectorContent").href;
const { target, doc } = await attachURL(url);
const inspector = target.getInspector();
const inspector = await target.getInspector();
gInspectee = doc;
gWalker = await inspector.getWalker();
ok(gWalker, "getWalker() should return an actor.");
gWalker = inspector.walker;
runNextTest();
});

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

@ -27,10 +27,8 @@ addTest(async function setup() {
const url = document.getElementById("inspectorContent").href;
const { target, doc } = await attachURL(url);
gInspectee = doc;
const inspector = target.getInspector();
const walker = await inspector.getWalker();
ok(walker, "getWalker() should return an actor.");
gWalker = walker;
const inspector = await target.getInspector();
gWalker = inspector.walker;
runNextTest();
});

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

@ -26,10 +26,9 @@ let attrFront;
addTest(async function setup() {
const url = document.getElementById("inspectorContent").href;
const { target, doc } = await attachURL(url);
const inspector = target.getInspector();
const inspector = await target.getInspector();
gInspectee = doc;
gWalker = await inspector.getWalker();
ok(gWalker, "getWalker() should return an actor.");
gWalker = inspector.walker;
runNextTest();
});

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

@ -25,9 +25,8 @@ async function setup(callback) {
const url = document.getElementById("inspectorContent").href;
const { target, doc } = await attachURL(url);
gInspectee = doc;
const inspector = target.getInspector();
gWalker = await inspector.getWalker();
ok(gWalker, "getWalker() should return an actor.");
const inspector = await target.getInspector();
gWalker = inspector.walker;
callback();
}

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

@ -30,9 +30,8 @@ window.onload = function() {
const url = document.getElementById("inspectorContent").href;
const { target, doc } = await attachURL(url);
inspectee = doc;
inspector = target.getInspector();
walker = await inspector.getWalker();
ok(walker, "getWalker() should return an actor.");
inspector = await target.getInspector();
walker = inspector.walker;
runNextTest();
});

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

@ -27,8 +27,8 @@ async function setup(callback) {
const { target, doc } = await attachURL(url);
gInspectee = doc;
gTarget = target;
const inspector = target.getInspector();
gWalker = await inspector.getWalker();
const inspector = await target.getInspector();
gWalker = inspector.walker;
await callback();
}

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

@ -38,10 +38,9 @@ var shortString2 = "str2";
addTest(async function setup() {
const url = document.getElementById("inspectorContent").href;
const { target, doc } = await attachURL(url);
const inspector = target.getInspector();
const inspector = await target.getInspector();
gInspectee = doc;
gWalker = await inspector.getWalker();
ok(gWalker, "getWalker() should return an actor.");
gWalker = inspector.walker;
runNextTest();
});

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

@ -26,7 +26,7 @@ window.onload = function() {
const url = document.getElementById("inspectorContent").href;
const { target, doc } = await attachURL(url);
inspector = target.getInspector();
inspector = await target.getInspector();
win = doc.defaultView;
runNextTest();
});

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

@ -29,10 +29,9 @@ async function setup(callback) {
const url = document.getElementById("inspectorContent").href;
const { target, doc } = await attachURL(url);
gInspectee = doc;
const inspector = target.getInspector();
const walker = await inspector.getWalker();
ok(walker, "getWalker() should return an actor.");
gWalker = walker;
const inspector = await target.getInspector();
ok(inspector.walker, "getWalker() should return an actor.");
gWalker = inspector.walker;
runNextTest();
}

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

@ -28,10 +28,9 @@ function assertOwnership() {
addTest(async function setup() {
const url = document.getElementById("inspectorContent").href;
const { target } = await attachURL(url);
const inspector = target.getInspector();
const inspector = await target.getInspector();
gTarget = target;
gWalker = await inspector.getWalker();
ok(gWalker, "getWalker() should return an actor.");
gWalker = inspector.walker;
runNextTest();
});

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

@ -24,11 +24,9 @@ let gWalker = null;
addTest(async function setup() {
const url = document.getElementById("inspectorContent").href;
const { target, doc } = await attachURL(url);
const inspector = target.getInspector();
const inspector = await target.getInspector();
gInspectee = doc;
const walker = await inspector.getWalker();
ok(walker, "getWalker() should return an actor.");
dump(walker.actorID + "\n");
const walker = inspector.walker;
gWalker = await inspector.getWalker();
ok(walker === gWalker, "getWalker() twice should return the same walker.");
runNextTest();

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

@ -36,9 +36,8 @@ addTest(async function setup() {
const url = document.getElementById("inspectorContent").href;
const { target, doc } = await attachURL(url);
gInspectee = doc;
const inspector = target.getInspector();
gWalker = await inspector.getWalker();
ok(gWalker, "getWalker() should return an actor.");
const inspector = await target.getInspector();
gWalker = inspector.walker;
gTarget = target;
runNextTest();
});

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

@ -25,13 +25,13 @@ window.onload = function() {
const url = document.getElementById("inspectorContent").href;
const { target, doc } = await attachURL(url);
inspector = target.getInspector();
inspector = await target.getInspector();
win = doc.defaultView;
runNextTest();
});
addAsyncTest(async function() {
const walker = await inspector.getWalker();
const walker = inspector.walker;
// We can't receive events from the walker if we haven't first executed a
// method on the actor to initialize it.

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

@ -24,7 +24,7 @@ let gDoc;
addTest(async function() {
const url = document.getElementById("inspectorContent").href;
const { target, doc } = await attachURL(url);
gInspector = target.getInspector();
gInspector = await target.getInspector();
gDoc = doc;
runNextTest();
});

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

@ -28,9 +28,9 @@ function assertOwnership() {
addTest(async function setup() {
const url = document.getElementById("inspectorContent").href;
const { target, doc } = await attachURL(url);
const inspector = target.getInspector();
const inspector = await target.getInspector();
gInspectee = doc;
gWalker = await inspector.getWalker();
gWalker = inspector.walker;
runNextTest();
});

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

@ -25,9 +25,8 @@ addTest(async function setup() {
const url = document.getElementById("inspectorContent").href;
const { target, doc } = await attachURL(url);
gInspectee = doc;
const inspector = target.getInspector();
gWalker = await inspector.getWalker();
ok(gWalker, "getWalker() should return an actor.");
const inspector = await target.getInspector();
gWalker = inspector.walker;
runNextTest();
});

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

@ -29,9 +29,8 @@ window.onload = function() {
const url = document.getElementById("inspectorContent").href;
const { target } = await attachURL(url);
inspector = target.getInspector();
walkerFront = await inspector.getWalker();
ok(walkerFront, "getWalker() should return an actor.");
inspector = await target.getInspector();
walkerFront = inspector.walker;
runNextTest();
});

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

@ -35,10 +35,9 @@ window.onload = function() {
const { target, doc } = await attachURL(url);
inspectee = doc;
inspector = target.getInspector();
inspector = await target.getInspector();
const walkerFront = await inspector.getWalker();
ok(walkerFront, "getWalker() should return an actor.");
const walkerFront = inspector.walker;
walkerActor = DebuggerServer.searchAllConnectionsForActor(walkerFront.actorID);
ok(walkerActor,

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

@ -23,8 +23,8 @@ window.onload = function() {
const url = document.getElementById("inspectorContent").href;
const { target } = await attachURL(url);
const inspector = target.getInspector();
gWalker = await inspector.getWalker();
const inspector = await target.getInspector();
gWalker = inspector.walker;
runNextTest();
});

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

@ -29,11 +29,10 @@ function assertOwnership() {
addTest(async function setup() {
const url = document.getElementById("inspectorContent").href;
const { target, doc } = await attachURL(url);
const inspector = target.getInspector();
const inspector = await target.getInspector();
gInspectee = doc;
gTarget = target;
gWalker = await inspector.getWalker();
ok(gWalker, "getWalker() should return an actor.");
gWalker = inspector.walker;
runNextTest();
});

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

@ -44,8 +44,8 @@ let gWalker = null;
addTest(async function setup() {
const url = document.getElementById("inspectorContent").href;
const { target, doc } = await attachURL(url);
const inspector = target.getInspector();
gWalker = await inspector.getWalker();
const inspector = await target.getInspector();
gWalker = inspector.walker;
gNodeFront = await gWalker.querySelector(gWalker.rootNode, "img.custom");
gImg = doc.querySelector("img.custom");
ok(gNodeFront, "Got the image NodeFront.");

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

@ -23,8 +23,8 @@ let gWalker = null;
addTest(async function setup() {
const url = document.getElementById("inspectorContent").href;
const { target } = await attachURL(url);
const inspector = target.getInspector();
gWalker = await inspector.getWalker();
const inspector = await target.getInspector();
gWalker = inspector.walker;
runNextTest();
});

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

@ -41,7 +41,7 @@ let gInspector = null;
addTest(async function setup() {
const url = document.getElementById("inspectorContent").href;
const { target } = await attachURL(url);
gInspector = target.getInspector();
gInspector = await target.getInspector();
runNextTest();
});

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

@ -23,9 +23,8 @@ let gWalker;
addTest(async function() {
const url = document.getElementById("inspectorContent").href;
const { target } = await attachURL(url);
const inspector = target.getInspector();
gWalker = await inspector.getWalker();
ok(gWalker, "getWalker() should return an actor.");
const inspector = await target.getInspector();
gWalker = inspector.walker;
runNextTest();
});

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

@ -25,8 +25,8 @@ var gBodyNode;
addTest(async function setup() {
const url = document.getElementById("inspectorContent").href;
const { target } = await attachURL(url);
const inspector = target.getInspector();
gWalker = await inspector.getWalker();
const inspector = await target.getInspector();
gWalker = inspector.walker;
gBodyNode = await gWalker.querySelector(gWalker.rootNode, "body");
gHTMLNode = await gWalker.querySelector(gWalker.rootNode, "html");
runNextTest();

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

@ -24,9 +24,8 @@ let gStyles = null;
addTest(async function setup() {
const url = document.getElementById("inspectorContent").href;
const { target } = await attachURL(url);
const inspector = target.getInspector();
gWalker = await inspector.getWalker();
ok(gWalker, "getWalker() should return an actor.");
const inspector = await target.getInspector();
gWalker = inspector.walker;
gStyles = await inspector.getPageStyle();
runNextTest();
});

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

@ -24,9 +24,8 @@ let gStyles = null;
addTest(async function setup() {
const url = document.getElementById("inspectorContent").href;
const { target } = await attachURL(url);
const inspector = target.getInspector();
gWalker = await inspector.getWalker();
ok(gWalker, "getWalker() should return an actor.");
const inspector = await target.getInspector();
gWalker = inspector.walker;
gStyles = await inspector.getPageStyle();
runNextTest();
});

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

@ -20,10 +20,8 @@ let gStyles = null;
addTest(async function() {
const url = document.getElementById("inspectorContent").href;
const { target } = await attachURL(url);
const inspector = target.getInspector();
const walker = await inspector.getWalker();
ok(walker, "getWalker() should return an actor.");
gWalker = walker;
const inspector = await target.getInspector();
gWalker = inspector.walker;
gStyles = await inspector.getPageStyle();
runNextTest();
});

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

@ -28,9 +28,8 @@ addTest(async function setup() {
const url = document.getElementById("inspectorContent").href;
const { target, doc } = await attachURL(url);
gInspectee = doc;
const inspector = target.getInspector();
gWalker = await inspector.getWalker();
ok(gWalker, "getWalker() should return an actor.");
const inspector = await target.getInspector();
gWalker = inspector.walker;
gStyles = await inspector.getPageStyle();
runNextTest();
});

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

@ -28,10 +28,10 @@ addAsyncTest(async function setup() {
const url = document.getElementById("inspectorContent").href;
const { target, doc } = await attachURL(url);
const inspector = target.getInspector();
const inspector = await target.getInspector();
gInspectee = doc;
gWalker = await inspector.getWalker();
gWalker = inspector.walker;
gStyles = await inspector.getPageStyle();
runNextTest();

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

@ -25,9 +25,8 @@ let gStyles = null;
addTest(async function setup() {
const url = document.getElementById("inspectorContent").href;
const { target } = await attachURL(url);
const inspector = target.getInspector();
gWalker = await inspector.getWalker();
ok(gWalker, "getWalker() should return an actor.");
const inspector = await target.getInspector();
gWalker = inspector.walker;
gStyles = await inspector.getPageStyle();
runNextTest();
});