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

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

Issue 2842843003: DevTools: Display product information in ConsoleContextSelector (Closed)
Patch Set: f 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/console/console-context-selector.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.runtimeModel.executionContexts(); 8 var executionContexts = InspectorTest.runtimeModel.executionContexts();
9 for (var context of executionContexts) { 9 for (var context of executionContexts) {
10 if (context.isDefault) { 10 if (context.isDefault) {
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 InspectorTest.waitUntilNthMessageReceivedPromise = function(count) 387 InspectorTest.waitUntilNthMessageReceivedPromise = function(count)
388 { 388 {
389 var callback; 389 var callback;
390 var promise = new Promise((fullfill) => callback = fullfill); 390 var promise = new Promise((fullfill) => callback = fullfill);
391 InspectorTest.waitUntilNthMessageReceived(count, callback); 391 InspectorTest.waitUntilNthMessageReceived(count, callback);
392 return promise; 392 return promise;
393 } 393 }
394 394
395 InspectorTest.changeExecutionContext = function(namePrefix) 395 InspectorTest.changeExecutionContext = function(namePrefix)
396 { 396 {
397 var selector = Console.ConsoleView.instance()._consoleContextSelector._selec tElement; 397 var selector = Console.ConsoleView.instance()._consoleContextSelector;
398 var option = selector.firstChild; 398 for (var executionContext of selector._list._items) {
399 while (option) { 399 if (selector._titleFor(executionContext).startsWith(namePrefix)) {
400 if (option.textContent && option.textContent.trim().startsWith(namePrefi x)) 400 UI.context.setFlavor(SDK.ExecutionContext, executionContext);
401 break; 401 return;
402 option = option.nextSibling; 402 }
403 } 403 }
404 if (!option) { 404 InspectorTest.addResult("FAILED: context with prefix: " + namePrefix + " no t found in the context list");
405 InspectorTest.addResult("FAILED: context with prefix: " + namePrefix + " not found in the context list");
406 return;
407 }
408 option.selected = true;
409 Console.ConsoleView.instance()._consoleContextSelector._executionContextChan ged();
410 } 405 }
411 406
412 InspectorTest.waitForConsoleMessages = function(expectedCount, callback) 407 InspectorTest.waitForConsoleMessages = function(expectedCount, callback)
413 { 408 {
414 var consoleView = Console.ConsoleView.instance(); 409 var consoleView = Console.ConsoleView.instance();
415 checkAndReturn(); 410 checkAndReturn();
416 411
417 function checkAndReturn() 412 function checkAndReturn()
418 { 413 {
419 if (consoleView._visibleViewMessages.length === expectedCount) { 414 if (consoleView._visibleViewMessages.length === expectedCount) {
(...skipping 26 matching lines...) Expand all
446 offset: offset - charCount 441 offset: offset - charCount
447 }; 442 };
448 } 443 }
449 charCount += length; 444 charCount += length;
450 } 445 }
451 return null; 446 return null;
452 } 447 }
453 } 448 }
454 449
455 } 450 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/console/console-context-selector.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698