Skip to content

Commit

Permalink
DevTools: deprecate InspectorTest.runAfterPendingDispatches
Browse files Browse the repository at this point in the history
The InspectorTest.runAfterPendingDispatches results in an eventual test
flakiness, increasing maintanence burden.

Clients should consider other ways instead of using
InspectorTest.runAfterPendingDispatches, e.g. adding a specific
_methodForTest method which will be sniffed.

R=dgozman
BUG=602843

Review URL: https://codereview.chromium.org/1877223003

Cr-Commit-Position: refs/heads/master@{#387101}
  • Loading branch information
aslushnikov authored and Commit bot committed Apr 13, 2016
1 parent 0bac6c9 commit cb18158
Show file tree
Hide file tree
Showing 62 changed files with 96 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
}
InspectorTest.completeTest();
}
InspectorTest.runAfterPendingDispatches(run);
InspectorTest.deprecatedRunAfterPendingDispatches(run);
}

</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
}
InspectorTest.completeTest();
}
InspectorTest.runAfterPendingDispatches(callback);
InspectorTest.deprecatedRunAfterPendingDispatches(callback);
}

</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

function step2()
{
InspectorTest.runAfterPendingDispatches(step3);
InspectorTest.deprecatedRunAfterPendingDispatches(step3);
}

function step3()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
InspectorTest.dumpConsoleMessages();
InspectorTest.completeTest();
}
InspectorTest.runAfterPendingDispatches(finish);
InspectorTest.deprecatedRunAfterPendingDispatches(finish);
}
}
//# sourceURL=console-fetch-logging.html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ InspectorTest.expandConsoleMessages = function(callback, deepFilter, sectionFilt
for (var i = 0; i < messageViews.length; ++i)
messageViews[i].contentElement();

InspectorTest.runAfterPendingDispatches(expandTreeElements);
InspectorTest.deprecatedRunAfterPendingDispatches(expandTreeElements);

function expandTreeElements()
{
Expand All @@ -274,7 +274,7 @@ InspectorTest.expandConsoleMessages = function(callback, deepFilter, sectionFilt
}
}
}
InspectorTest.runAfterPendingDispatches(callback);
InspectorTest.deprecatedRunAfterPendingDispatches(callback);
}
}

Expand All @@ -301,7 +301,7 @@ InspectorTest.expandGettersInConsoleMessages = function(callback)
if (propertiesCount === 0) {
for (var i = 0; i < properties.length; ++i)
properties[i].click();
InspectorTest.runAfterPendingDispatches(callback);
InspectorTest.deprecatedRunAfterPendingDispatches(callback);
} else {
InspectorTest.addSniffer(WebInspector.ObjectPropertyTreeElement.prototype, "_updateExpandable", propertyExpandableUpdated);
}
Expand All @@ -314,7 +314,7 @@ InspectorTest.expandConsoleMessagesErrorParameters = function(callback)
// Initiate round-trips to fetch necessary data for further rendering.
for (var i = 0; i < messageViews.length; ++i)
messageViews[i].contentElement();
InspectorTest.runAfterPendingDispatches(expandErrorParameters);
InspectorTest.deprecatedRunAfterPendingDispatches(expandErrorParameters);
function expandErrorParameters()
{
for (var i = 0; i < messageViews.length; ++i) {
Expand All @@ -338,7 +338,7 @@ InspectorTest.waitForRemoteObjectsConsoleMessages = function(callback)
var messages = WebInspector.ConsoleView.instance()._visibleViewMessages;
for (var i = 0; i < messages.length; ++i)
messages[i].toMessageElement();
InspectorTest.runAfterPendingDispatches(callback);
InspectorTest.deprecatedRunAfterPendingDispatches(callback);
}

InspectorTest.checkConsoleMessagesDontHaveParameters = function()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
InspectorTest.dumpConsoleMessages();
InspectorTest.completeTest();
}
InspectorTest.runAfterPendingDispatches(finish);
InspectorTest.deprecatedRunAfterPendingDispatches(finish);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
InspectorTest.dumpConsoleMessages();
InspectorTest.completeTest();
}
InspectorTest.runAfterPendingDispatches(finish);
InspectorTest.deprecatedRunAfterPendingDispatches(finish);
}
}
//# sourceURL=console-xhr-logging.html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ InspectorTest.waitUntilPausedAndDumpStackAndResume = function(callback, options)
{
InspectorTest.captureStackTrace(callFrames, asyncStackTrace, options);
InspectorTest.addResult(InspectorTest.clearSpecificInfoFromStackFrames(caption));
InspectorTest.runAfterPendingDispatches(step2);
InspectorTest.deprecatedRunAfterPendingDispatches(step2);
}

function step2()
Expand Down Expand Up @@ -442,7 +442,7 @@ InspectorTest.expandScopeVariablesSidebarPane = function(callback)
var sections = InspectorTest.scopeChainSections();
for (var i = 0; i < sections.length - 1; ++i)
sections[i].expand();
InspectorTest.runAfterPendingDispatches(callback);
InspectorTest.deprecatedRunAfterPendingDispatches(callback);
};

InspectorTest.expandProperties = function(properties, callback)
Expand All @@ -458,7 +458,7 @@ InspectorTest.expandProperties = function(properties, callback)
var path = properties[index++];
InspectorTest._expandProperty(parentTreeElement, path, 0, expandNextPath);
}
InspectorTest.runAfterPendingDispatches(expandNextPath);
InspectorTest.deprecatedRunAfterPendingDispatches(expandNextPath);
};

InspectorTest._expandProperty = function(parentTreeElement, path, pathIndex, callback)
Expand All @@ -476,7 +476,7 @@ InspectorTest._expandProperty = function(parentTreeElement, path, pathIndex, cal
return;
}
propertyTreeElement.expand();
InspectorTest.runAfterPendingDispatches(InspectorTest._expandProperty.bind(InspectorTest, propertyTreeElement, path, pathIndex, callback));
InspectorTest.deprecatedRunAfterPendingDispatches(InspectorTest._expandProperty.bind(InspectorTest, propertyTreeElement, path, pathIndex, callback));
};

InspectorTest._findChildPropertyTreeElement = function(parent, childName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

function step2()
{
InspectorTest.runAfterPendingDispatches(step3);
InspectorTest.deprecatedRunAfterPendingDispatches(step3);
}

function step3()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ InspectorTest.expandAndDumpEventListeners = function(eventListenersView, updateC
for (var j = 0; j < listenerItems.length; ++j)
listenerItems[j].expand();
}
InspectorTest.runAfterPendingDispatches(objectsExpanded);
InspectorTest.deprecatedRunAfterPendingDispatches(objectsExpanded);
}

function objectsExpanded()
Expand Down Expand Up @@ -512,12 +512,12 @@ InspectorTest.runWhenPageLoads = function(callback)
InspectorTest._pageLoadedCallback = InspectorTest.safeWrap(chainedCallback);
}

InspectorTest.runAfterPendingDispatches = function(callback)
InspectorTest.deprecatedRunAfterPendingDispatches = function(callback)
{
var barrier = new CallbackBarrier();
var targets = WebInspector.targetManager.targets();
for (var i = 0; i < targets.length; ++i)
targets[i]._connection.runAfterPendingDispatches(barrier.createCallback());
targets[i]._connection.deprecatedRunAfterPendingDispatches(barrier.createCallback());
barrier.callWhenDone(InspectorTest.safeWrap(callback));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
InspectorTest.addResult("Logged headers: " + headersArray.join(", "));
InspectorTest.addResult("Content: \"" + content + "\"");

InspectorTest.runAfterPendingDispatches(next);
InspectorTest.deprecatedRunAfterPendingDispatches(next);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
InspectorTest.addResult("Request: " + url);
blockedSetting.set(patterns);
nextStep = next;
InspectorTest.runAfterPendingDispatches(addScript);
InspectorTest.deprecatedRunAfterPendingDispatches(addScript);

function addScript()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
function test()
{
// Resources panel has heavy initialization that does not work well with reloading-from-test.
InspectorTest.runAfterPendingDispatches(function() {
InspectorTest.deprecatedRunAfterPendingDispatches(function() {
InspectorTest.reloadPage(step1);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
if (target.isDedicatedWorker()) {
var serviceWorkerManager = WebInspector.targetManager.mainTarget().serviceWorkerManager;
// Allow agents to do rountrips.
InspectorTest.runAfterPendingDispatches(function() {
InspectorTest.deprecatedRunAfterPendingDispatches(function() {
for (var worker of serviceWorkerManager.workers())
worker.stop();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ InspectorTest.stopTimeline = function(callback)
var panel = WebInspector.panels.timeline;
function didStop()
{
InspectorTest.runAfterPendingDispatches(callback);
InspectorTest.deprecatedRunAfterPendingDispatches(callback);
}
InspectorTest.addSniffer(panel, "loadingComplete", didStop);
panel._toggleRecording();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ InspectorTest.collectAuditResults = function(callback)
liElements[j].treeElement.expand();
}
}
InspectorTest.runAfterPendingDispatches(function() {
InspectorTest.deprecatedRunAfterPendingDispatches(function() {
InspectorTest.collectTextContent(WebInspector.panels.audits.visibleView.element, "");
callback();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
populated = true;
}

InspectorTest.runAfterPendingDispatches(expandRecursively);
InspectorTest.deprecatedRunAfterPendingDispatches(expandRecursively);

function expandRecursively()
{
Expand All @@ -97,9 +97,9 @@
}
}
if (populated)
InspectorTest.runAfterPendingDispatches(completeTest);
InspectorTest.deprecatedRunAfterPendingDispatches(completeTest);
else
InspectorTest.runAfterPendingDispatches(expandRecursively);
InspectorTest.deprecatedRunAfterPendingDispatches(expandRecursively);
}

function completeTest()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
InspectorTest.dumpConsoleMessages();
InspectorTest.completeTest();
}
InspectorTest.runAfterPendingDispatches(callback);
InspectorTest.deprecatedRunAfterPendingDispatches(callback);
}

</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
customElement.click();
}

InspectorTest.runAfterPendingDispatches(dumpExpanded);
InspectorTest.deprecatedRunAfterPendingDispatches(dumpExpanded);
}

function dumpExpanded()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@

function dumpAndClearConsoleMessages(next)
{
InspectorTest.runAfterPendingDispatches(function() {
InspectorTest.deprecatedRunAfterPendingDispatches(function() {
InspectorTest.dumpConsoleMessages();
InspectorTest.consoleModel.requestClearMessages();
InspectorTest.runAfterPendingDispatches(next);
InspectorTest.deprecatedRunAfterPendingDispatches(next);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
if (next === total) {
InspectorTest.evaluateInPage("tearDown()");
InspectorTest.expandConsoleMessages();
InspectorTest.runAfterPendingDispatches(finish);
InspectorTest.deprecatedRunAfterPendingDispatches(finish);
} else {
loopOverGlobals(next, total);
}
Expand All @@ -59,11 +59,11 @@
}

InspectorTest.evaluateInConsole("a" + current);
InspectorTest.runAfterPendingDispatches(invokeConsoleLog);
InspectorTest.deprecatedRunAfterPendingDispatches(invokeConsoleLog);
function invokeConsoleLog()
{
InspectorTest.evaluateInPage("log(a" + current + ")");
InspectorTest.runAfterPendingDispatches(advance);
InspectorTest.deprecatedRunAfterPendingDispatches(advance);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
InspectorTest.evaluateInConsole("[obj]");
InspectorTest.evaluateInConsole("obj.foo");
InspectorTest.evaluateInConsole("[obj.foo]");
InspectorTest.runAfterPendingDispatches(step1);
InspectorTest.deprecatedRunAfterPendingDispatches(step1);

function step1()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@
}

InspectorTest.evaluateInPage("log(" + current + ")");
InspectorTest.runAfterPendingDispatches(evalInConsole);
InspectorTest.deprecatedRunAfterPendingDispatches(evalInConsole);
function evalInConsole()
{
InspectorTest.evaluateInConsole("globals[" + current + "]");
InspectorTest.runAfterPendingDispatches(advance);
InspectorTest.deprecatedRunAfterPendingDispatches(advance);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@
}

InspectorTest.evaluateInPage("log(" + current + ")");
InspectorTest.runAfterPendingDispatches(evalInConsole);
InspectorTest.deprecatedRunAfterPendingDispatches(evalInConsole);
function evalInConsole()
{
InspectorTest.evaluateInConsole("globals[" + current + "]");
InspectorTest.runAfterPendingDispatches(advance);
InspectorTest.deprecatedRunAfterPendingDispatches(advance);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@
}

InspectorTest.evaluateInPage("log(" + current + ")");
InspectorTest.runAfterPendingDispatches(evalInConsole);
InspectorTest.deprecatedRunAfterPendingDispatches(evalInConsole);
function evalInConsole()
{
InspectorTest.evaluateInConsole("globals[" + current + "]");
InspectorTest.runAfterPendingDispatches(advance);
InspectorTest.deprecatedRunAfterPendingDispatches(advance);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
function step1()
{
InspectorTest.consoleModel.requestClearMessages();
InspectorTest.runAfterPendingDispatches(step2);
InspectorTest.deprecatedRunAfterPendingDispatches(step2);
}

function step2()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
WebInspector.settingForTest("skipStackFramesPattern").set(frameworkRegexString);

InspectorTest.evaluateInPage("runLogs()");
InspectorTest.runAfterPendingDispatches(callback);
InspectorTest.deprecatedRunAfterPendingDispatches(callback);
function callback()
{
InspectorTest.dumpConsoleMessages();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
{
var expr = expressions.shift();
if (!expr) {
InspectorTest.runAfterPendingDispatches(next);
InspectorTest.deprecatedRunAfterPendingDispatches(next);
return;
}
InspectorTest.evaluateInConsole(expr, iterate);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{
var treeElement = InspectorTest.firstElementsTreeOutline().findTreeElement(node);
treeElement.remove();
InspectorTest.runAfterPendingDispatches(done);
InspectorTest.deprecatedRunAfterPendingDispatches(done);
}
},

Expand Down
Loading

0 comments on commit cb18158

Please sign in to comment.