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

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

Issue 2644753002: DevTools: untruncate links on copy (Closed)
Patch Set: ac Created 3 years, 8 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.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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 { 418 {
419 if (consoleView._visibleViewMessages.length === expectedCount) { 419 if (consoleView._visibleViewMessages.length === expectedCount) {
420 InspectorTest.addResult("Message count: " + expectedCount); 420 InspectorTest.addResult("Message count: " + expectedCount);
421 callback(); 421 callback();
422 } else { 422 } else {
423 InspectorTest.addSniffer(consoleView, "_messageAppendedForTests", ch eckAndReturn); 423 InspectorTest.addSniffer(consoleView, "_messageAppendedForTests", ch eckAndReturn);
424 } 424 }
425 } 425 }
426 } 426 }
427 427
428 InspectorTest.selectConsoleMessages = function(fromMessage, fromTextOffset, toMe ssage, toTextOffset)
429 {
430 var consoleView = Console.ConsoleView.instance();
431 var from = selectionContainerAndOffset(consoleView.itemElement(fromMessage). element(), fromTextOffset);
432 var to = selectionContainerAndOffset(consoleView.itemElement(toMessage).elem ent(), toTextOffset);
433 window.getSelection().setBaseAndExtent(from.container, from.offset, to.conta iner, to.offset);
434
435 function selectionContainerAndOffset(container, offset)
436 {
437 var charCount = 0;
438 var node = container;
439 while (node = node.traverseNextTextNode(true)) {
440 var length = node.textContent.length;
441 if (charCount + length >= offset) {
442 return {
443 container: node,
444 offset: offset - charCount
445 };
446 }
447 charCount += length;
448 }
449 return null;
450 }
451 }
452
428 } 453 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698