Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(824)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js

Issue 2879503002: [Devtools] Added product entry tests for network
Patch Set: [Devtools] Added product entry tests for network Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 if (window.GCController) 1 if (window.GCController)
2 GCController.collectAll(); 2 GCController.collectAll();
3 3
4 var initialize_InspectorTest = function() { 4 var initialize_InspectorTest = function() {
5 Protocol.InspectorBackend.Options.suppressRequestErrors = true; 5 Protocol.InspectorBackend.Options.suppressRequestErrors = true;
6 var results = []; 6 var results = [];
7 7
8 function consoleOutputHook(messageType) 8 function consoleOutputHook(messageType)
9 { 9 {
10 InspectorTest.addResult(messageType + ": " + Array.prototype.slice.call(argu ments, 1)); 10 InspectorTest.addResult(messageType + ": " + Array.prototype.slice.call(argu ments, 1));
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 { 420 {
421 InspectorTest.addResult(view instanceof Sources.SourcesNavigatorView ? "Sour ces:" : "Content Scripts:"); 421 InspectorTest.addResult(view instanceof Sources.SourcesNavigatorView ? "Sour ces:" : "Content Scripts:");
422 view._groupByFrame = mode.includes("frame"); 422 view._groupByFrame = mode.includes("frame");
423 view._groupByDomain = mode.includes("domain"); 423 view._groupByDomain = mode.includes("domain");
424 view._groupByFolder = mode.includes("folder"); 424 view._groupByFolder = mode.includes("folder");
425 view._resetForTest(); 425 view._resetForTest();
426 InspectorTest.addResult("-------- Setting mode: [" + mode + "]"); 426 InspectorTest.addResult("-------- Setting mode: [" + mode + "]");
427 InspectorTest.dumpNavigatorView(view); 427 InspectorTest.dumpNavigatorView(view);
428 } 428 }
429 429
430 /**
431 * @param {symbol} event
432 * @param {!Common.Object} obj
433 * @param {(function(?):boolean)|undefined}
434 * @return {!Promise}
435 */
436 InspectorTest.waitEventListener = function(event, obj, condition = undefined)
allada 2017/05/10 22:25:01 There are a few places in this file that could use
dgozman 2017/05/10 22:57:13 Paul is adding .once(), will it work in most cases
437 {
438 condition = condition || function() { return true;};
439 return new Promise(resolve => {
440 obj.addEventListener(event, onEventFired);
441
442 function onEventFired(event) {
443 if (!condition(event.data))
444 return;
445 obj.removeEventListener(event, onEventFired);
446 resolve(event.data);
447 }
448 });
449 }
450
430 InspectorTest.waitForUISourceCode = function(urlSuffix, projectType) 451 InspectorTest.waitForUISourceCode = function(urlSuffix, projectType)
431 { 452 {
432 function matches(uiSourceCode) 453 function matches(uiSourceCode)
433 { 454 {
434 if (projectType && uiSourceCode.project().type() !== projectType) 455 if (projectType && uiSourceCode.project().type() !== projectType)
435 return false; 456 return false;
436 if (!projectType && uiSourceCode.project().type() === Workspace.projectT ypes.Service) 457 if (!projectType && uiSourceCode.project().type() === Workspace.projectT ypes.Service)
437 return false; 458 return false;
438 if (urlSuffix && !uiSourceCode.url().endsWith(urlSuffix)) 459 if (urlSuffix && !uiSourceCode.url().endsWith(urlSuffix))
439 return false; 460 return false;
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after
1299 _output("[page] " + text); 1320 _output("[page] " + text);
1300 } 1321 }
1301 1322
1302 function _output(result) 1323 function _output(result)
1303 { 1324 {
1304 if (!outputElement) 1325 if (!outputElement)
1305 createOutputElement(); 1326 createOutputElement();
1306 outputElement.appendChild(document.createTextNode(result)); 1327 outputElement.appendChild(document.createTextNode(result));
1307 outputElement.appendChild(document.createElement("br")); 1328 outputElement.appendChild(document.createElement("br"));
1308 } 1329 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698