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

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

Issue 2173233002: [DevTools] Better locations for snippets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added a test Created 4 years, 4 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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 InspectorTest.addResult("FAILED: didn't find _parameters field in th e message."); 361 InspectorTest.addResult("FAILED: didn't find _parameters field in th e message.");
362 } 362 }
363 } 363 }
364 } 364 }
365 365
366 InspectorTest.waitUntilMessageReceived = function(callback) 366 InspectorTest.waitUntilMessageReceived = function(callback)
367 { 367 {
368 InspectorTest.addSniffer(InspectorTest.consoleModel, "addMessage", callback, false); 368 InspectorTest.addSniffer(InspectorTest.consoleModel, "addMessage", callback, false);
369 } 369 }
370 370
371 InspectorTest.waitUntilMessageReceivedPromise = function()
372 {
373 var cb;
374 var p = new Promise((f) => cb = f);
375 InspectorTest.waitUntilMessageReceived(cb);
376 return p;
377 }
378
371 InspectorTest.waitUntilNthMessageReceived = function(count, callback) 379 InspectorTest.waitUntilNthMessageReceived = function(count, callback)
372 { 380 {
373 function override() 381 function override()
374 { 382 {
375 if (--count === 0) 383 if (--count === 0)
376 InspectorTest.safeWrap(callback)(); 384 InspectorTest.safeWrap(callback)();
377 else 385 else
378 InspectorTest.addSniffer(InspectorTest.consoleModel, "addMessage", o verride, false); 386 InspectorTest.addSniffer(InspectorTest.consoleModel, "addMessage", o verride, false);
379 } 387 }
380 InspectorTest.addSniffer(InspectorTest.consoleModel, "addMessage", override, false); 388 InspectorTest.addSniffer(InspectorTest.consoleModel, "addMessage", override, false);
381 } 389 }
382 390
391 InspectorTest.waitUntilNthMessageReceivedPromise = function(count)
392 {
393 var cb;
394 var p = new Promise((f) => cb = f);
395 InspectorTest.waitUntilNthMessageReceived(count, cb);
396 return p;
397 }
398
383 InspectorTest.changeExecutionContext = function(namePrefix) 399 InspectorTest.changeExecutionContext = function(namePrefix)
384 { 400 {
385 var selector = WebInspector.ConsoleView.instance()._executionContextModel._s electElement; 401 var selector = WebInspector.ConsoleView.instance()._executionContextModel._s electElement;
386 var option = selector.firstChild; 402 var option = selector.firstChild;
387 while (option) { 403 while (option) {
388 if (option.textContent && option.textContent.startsWith(namePrefix)) 404 if (option.textContent && option.textContent.startsWith(namePrefix))
389 break; 405 break;
390 option = option.nextSibling; 406 option = option.nextSibling;
391 } 407 }
392 if (!option) { 408 if (!option) {
(...skipping 14 matching lines...) Expand all
407 if (consoleView._visibleViewMessages.length === expectedCount) { 423 if (consoleView._visibleViewMessages.length === expectedCount) {
408 InspectorTest.addResult("Message count: " + expectedCount); 424 InspectorTest.addResult("Message count: " + expectedCount);
409 callback(); 425 callback();
410 } else { 426 } else {
411 InspectorTest.addSniffer(consoleView, "_messageAppendedForTests", ch eckAndReturn); 427 InspectorTest.addSniffer(consoleView, "_messageAppendedForTests", ch eckAndReturn);
412 } 428 }
413 } 429 }
414 } 430 }
415 431
416 } 432 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698