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

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

Issue 2647153002: [DevTools] Improve context and target naming. (Closed)
Patch Set: fixed comments and sorting Created 3 years, 11 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/http/tests/inspector/inspector-test.js » ('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.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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 var promise = new Promise((fullfill) => callback = fullfill); 389 var promise = new Promise((fullfill) => callback = fullfill);
390 InspectorTest.waitUntilNthMessageReceived(count, callback); 390 InspectorTest.waitUntilNthMessageReceived(count, callback);
391 return promise; 391 return promise;
392 } 392 }
393 393
394 InspectorTest.changeExecutionContext = function(namePrefix) 394 InspectorTest.changeExecutionContext = function(namePrefix)
395 { 395 {
396 var selector = Console.ConsoleView.instance()._consoleContextSelector._selec tElement; 396 var selector = Console.ConsoleView.instance()._consoleContextSelector._selec tElement;
397 var option = selector.firstChild; 397 var option = selector.firstChild;
398 while (option) { 398 while (option) {
399 if (option.textContent && option.textContent.startsWith(namePrefix)) 399 if (option.textContent && option.textContent.trim().startsWith(namePrefi x))
400 break; 400 break;
401 option = option.nextSibling; 401 option = option.nextSibling;
402 } 402 }
403 if (!option) { 403 if (!option) {
404 InspectorTest.addResult("FAILED: context with prefix: " + namePrefix + " not found in the context list"); 404 InspectorTest.addResult("FAILED: context with prefix: " + namePrefix + " not found in the context list");
405 return; 405 return;
406 } 406 }
407 option.selected = true; 407 option.selected = true;
408 Console.ConsoleView.instance()._consoleContextSelector._executionContextChan ged(); 408 Console.ConsoleView.instance()._consoleContextSelector._executionContextChan ged();
409 } 409 }
410 410
411 InspectorTest.waitForConsoleMessages = function(expectedCount, callback) 411 InspectorTest.waitForConsoleMessages = function(expectedCount, callback)
412 { 412 {
413 var consoleView = Console.ConsoleView.instance(); 413 var consoleView = Console.ConsoleView.instance();
414 checkAndReturn(); 414 checkAndReturn();
415 415
416 function checkAndReturn() 416 function checkAndReturn()
417 { 417 {
418 if (consoleView._visibleViewMessages.length === expectedCount) { 418 if (consoleView._visibleViewMessages.length === expectedCount) {
419 InspectorTest.addResult("Message count: " + expectedCount); 419 InspectorTest.addResult("Message count: " + expectedCount);
420 callback(); 420 callback();
421 } else { 421 } else {
422 InspectorTest.addSniffer(consoleView, "_messageAppendedForTests", ch eckAndReturn); 422 InspectorTest.addSniffer(consoleView, "_messageAppendedForTests", ch eckAndReturn);
423 } 423 }
424 } 424 }
425 } 425 }
426 426
427 } 427 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698