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

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

Issue 2139043002: DevTools: show alternate title onexpand of object in console (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/console/console-call-getter-on-proto-expected.txt » ('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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 function mycallback(text) 50 function mycallback(text)
51 { 51 {
52 text = text.replace(/\bVM\d+/g, "VM"); 52 text = text.replace(/\bVM\d+/g, "VM");
53 InspectorTest.addResult(code + " = " + text); 53 InspectorTest.addResult(code + " = " + text);
54 callback(text); 54 callback(text);
55 } 55 }
56 InspectorTest.evaluateInConsole(code, mycallback, dontForceMainContext); 56 InspectorTest.evaluateInConsole(code, mycallback, dontForceMainContext);
57 } 57 }
58 58
59 InspectorTest.prepareConsoleMessageText = function(messageElement, consoleMessag e) 59 InspectorTest.cleanConsoleMessageText = function(messageText)
60 { 60 {
61 var messageText = messageElement.deepTextContent().replace(/\u200b/g, ""); 61 messageText.replace(/\u200b/g, "");
62 // Replace scriptIds with generic scriptId string to avoid flakiness. 62 // Replace scriptIds with generic scriptId string to avoid flakiness.
63 messageText = messageText.replace(/VM\d+/g, "VM"); 63 messageText = messageText.replace(/VM\d+/g, "VM");
64 if (messageText.startsWith("Navigated to")) { 64 if (messageText.startsWith("Navigated to")) {
65 var fileName = messageText.split(" ").pop().split("/").pop(); 65 var fileName = messageText.split(" ").pop().split("/").pop();
66 messageText = "Navigated to " + fileName; 66 messageText = "Navigated to " + fileName;
67 } 67 }
68 // The message might be extremely long in case of dumping stack overflow mes sage. 68 // The message might be extremely long in case of dumping stack overflow mes sage.
69 messageText = messageText.substring(0, 1024); 69 messageText = messageText.substring(0, 1024);
70 return messageText; 70 return messageText;
71 } 71 }
72 72
73 InspectorTest.prepareConsoleMessageText = function(messageElement, consoleMessag e)
74 {
75 var messageText = messageElement.deepTextContent();
76 return InspectorTest.cleanConsoleMessageText(messageText);
77 }
78
79 InspectorTest.dumpConsoleMessagesWithObjectProperties = function(messageElement, consoleMessage)
lushnikov 2016/08/05 01:42:04 let's reuse the existing infrastructure (see conso
luoe 2016/08/05 01:48:10 Done.
80 {
81 var messageText = messageElement.childTextNodes().map(formatPropertyNames).j oin("");
82 return InspectorTest.cleanConsoleMessageText(messageText);
83
84 function formatPropertyNames(node) {
85 if (node.parentElement && node.parentElement.parentElement && node.paren tElement.parentElement.classList.contains("console-view-object-properties-sectio n"))
86 return "\n" + node.textContent;
87 if (node.parentElement && node.parentElement.classList.contains("name"))
88 return "\n" + node.textContent;
89 else
90 return node.textContent;
91 }
92 }
93
73 InspectorTest.disableConsoleViewport = function() 94 InspectorTest.disableConsoleViewport = function()
74 { 95 {
75 InspectorTest.fixConsoleViewportDimensions(600, 2000); 96 InspectorTest.fixConsoleViewportDimensions(600, 2000);
76 } 97 }
77 98
78 InspectorTest.fixConsoleViewportDimensions = function(width, height) 99 InspectorTest.fixConsoleViewportDimensions = function(width, height)
79 { 100 {
80 var viewport = WebInspector.ConsoleView.instance()._viewport; 101 var viewport = WebInspector.ConsoleView.instance()._viewport;
81 viewport.element.style.width = width + "px"; 102 viewport.element.style.width = width + "px";
82 viewport.element.style.height = height + "px"; 103 viewport.element.style.height = height + "px";
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 if (consoleView._visibleViewMessages.length === expectedCount) { 444 if (consoleView._visibleViewMessages.length === expectedCount) {
424 InspectorTest.addResult("Message count: " + expectedCount); 445 InspectorTest.addResult("Message count: " + expectedCount);
425 callback(); 446 callback();
426 } else { 447 } else {
427 InspectorTest.addSniffer(consoleView, "_messageAppendedForTests", ch eckAndReturn); 448 InspectorTest.addSniffer(consoleView, "_messageAppendedForTests", ch eckAndReturn);
428 } 449 }
429 } 450 }
430 } 451 }
431 452
432 } 453 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/console/console-call-getter-on-proto-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698