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

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

Issue 2297443002: DevTools: show extension name in console execution context selector. (Closed)
Patch Set: Created 4 years, 3 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 var initialize_ConsoleTest = function() { 1 var initialize_ConsoleTest = function() {
2 2
3 InspectorTest.preloadModule("source_frame"); 3 InspectorTest.preloadModule("source_frame");
4 InspectorTest.preloadPanel("console"); 4 InspectorTest.preloadPanel("console");
5 5
6 InspectorTest.selectMainExecutionContext = function() 6 InspectorTest.selectMainExecutionContext = function()
7 { 7 {
8 var executionContexts = InspectorTest.mainTarget.runtimeModel.executionConte xts(); 8 var executionContexts = InspectorTest.mainTarget.runtimeModel.executionConte xts();
9 for (var context of executionContexts) { 9 for (var context of executionContexts) {
10 if (context.isDefault) { 10 if (context.isDefault) {
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 InspectorTest.waitUntilNthMessageReceivedPromise = function(count) 391 InspectorTest.waitUntilNthMessageReceivedPromise = function(count)
392 { 392 {
393 var callback; 393 var callback;
394 var promise = new Promise((fullfill) => callback = fullfill); 394 var promise = new Promise((fullfill) => callback = fullfill);
395 InspectorTest.waitUntilNthMessageReceived(count, callback); 395 InspectorTest.waitUntilNthMessageReceived(count, callback);
396 return promise; 396 return promise;
397 } 397 }
398 398
399 InspectorTest.changeExecutionContext = function(namePrefix) 399 InspectorTest.changeExecutionContext = function(namePrefix)
400 { 400 {
401 var selector = WebInspector.ConsoleView.instance()._executionContextModel._s electElement; 401 var selector = WebInspector.ConsoleView.instance()._consoleContextSelector._ selectElement;
402 var option = selector.firstChild; 402 var option = selector.firstChild;
403 while (option) { 403 while (option) {
404 if (option.textContent && option.textContent.startsWith(namePrefix)) 404 if (option.textContent && option.textContent.startsWith(namePrefix))
405 break; 405 break;
406 option = option.nextSibling; 406 option = option.nextSibling;
407 } 407 }
408 if (!option) { 408 if (!option) {
409 InspectorTest.addResult("FAILED: context with prefix: " + namePrefix + " not found in the context list"); 409 InspectorTest.addResult("FAILED: context with prefix: " + namePrefix + " not found in the context list");
410 return; 410 return;
411 } 411 }
412 option.selected = true; 412 option.selected = true;
413 WebInspector.ConsoleView.instance()._executionContextModel._executionContext Changed(); 413 WebInspector.ConsoleView.instance()._consoleContextSelector._executionContex tChanged();
414 } 414 }
415 415
416 InspectorTest.waitForConsoleMessages = function(expectedCount, callback) 416 InspectorTest.waitForConsoleMessages = function(expectedCount, callback)
417 { 417 {
418 var consoleView = WebInspector.ConsoleView.instance(); 418 var consoleView = WebInspector.ConsoleView.instance();
419 checkAndReturn(); 419 checkAndReturn();
420 420
421 function checkAndReturn() 421 function checkAndReturn()
422 { 422 {
423 if (consoleView._visibleViewMessages.length === expectedCount) { 423 if (consoleView._visibleViewMessages.length === expectedCount) {
424 InspectorTest.addResult("Message count: " + expectedCount); 424 InspectorTest.addResult("Message count: " + expectedCount);
425 callback(); 425 callback();
426 } else { 426 } else {
427 InspectorTest.addSniffer(consoleView, "_messageAppendedForTests", ch eckAndReturn); 427 InspectorTest.addSniffer(consoleView, "_messageAppendedForTests", ch eckAndReturn);
428 } 428 }
429 } 429 }
430 } 430 }
431 431
432 } 432 }
OLDNEW
« no previous file with comments | « chrome/browser/devtools/devtools_sanity_browsertest.cc ('k') | third_party/WebKit/Source/devtools/front_end/Tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698