| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |