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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/console/console-edit-property-value.html

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
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/console-test.js"></script>
5 <script>
6
7 // window.debugTest = true
8 function logToConsole()
9 {
10 var obj = {a: 1, b: {a: 1}, c: [2], d: "foo", e: null};
11 console.log(obj);
12 }
13
14 var test = function()
15 {
16 InspectorTest.evaluateInConsole("logToConsole()", step1);
17
18 function step1()
19 {
20 InspectorTest.expandConsoleMessages(step2);
21 }
22
23 function step2()
24 {
25 var valueElements = getValueElements();
26 doubleClickTypeAndEnter(valueElements[0], "1 + 2");
27 InspectorTest.waitForRemoteObjectsConsoleMessages(step3);
28 }
29
30 function step3()
31 {
32 var valueElements = getValueElements();
33 doubleClickTypeAndEnter(valueElements[1], "nonExistingValue");
34 InspectorTest.waitForRemoteObjectsConsoleMessages(step4);
35 }
36
37 function step4()
38 {
39 var valueElements = getValueElements();
40 doubleClickTypeAndEnter(valueElements[2], "[1, 2, 3]");
41 InspectorTest.waitForRemoteObjectsConsoleMessages(step5);
42 }
43
44 function step5()
45 {
46 var valueElements = getValueElements();
47 doubleClickTypeAndEnter(valueElements[3], "document.createElement('p')") ;
48 InspectorTest.waitForRemoteObjectsConsoleMessages(step6);
49 }
50
51 function step6()
52 {
53 var valueElements = getValueElements();
54 doubleClickTypeAndEnter(valueElements[4], "null");
55 InspectorTest.waitForRemoteObjectsConsoleMessages(step7);
56 }
57
58 function step7()
59 {
60 InspectorTest.dumpConsoleMessages();
61 InspectorTest.completeTest();
62 }
63
64 function getValueElements()
65 {
66 var messageElement = WebInspector.ConsoleView.instance()._visibleViewMes sages[1]._messageElement;
67 return messageElement.querySelectorAll("::shadow .value");
68 }
69
70 function doubleClickTypeAndEnter(node, text)
71 {
72 var event = document.createEvent("MouseEvent");
73 event.initMouseEvent("dblclick", true, true, null, 2);
74 node.dispatchEvent(event);
75
76 InspectorTest.assertTrue(node.classList.contains("hidden"));
77
78 var messageElement = WebInspector.ConsoleView.instance()._visibleViewMes sages[1]._messageElement;
79 var editPrompt = messageElement.querySelector("::shadow .text-prompt");
80 editPrompt.textContent = text;
81 editPrompt.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
82 }
83 }
84
85 </script>
86 </head>
87
88 <body onload="runTest()">
89 <p>
90 Tests that property values can be edited inline in the console via double click.
91 </p>
92
93 </body>
94 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698