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

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, 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-copy-truncated-text.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 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, useTextContainer)
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 if (offset === 0 && container.nodeType !== Node.TEXT_NODE)
438 container = container.traverseNextTextNode();
439 var charCount = 0;
440 var node = container;
441 while (node = node.traverseNextTextNode(true)) {
442 var length = node.textContent.length;
443 if (charCount + length >= offset) {
444 return {
445 container: node,
446 offset: offset - charCount
447 };
448 }
449 charCount += length;
450 }
451 return null;
452 }
453 }
454
428 } 455 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/console/console-copy-truncated-text.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698