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

Unified 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: Remove complex value editing from tests 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/inspector/console/console-edit-property-value.html
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-edit-property-value.html b/third_party/WebKit/LayoutTests/inspector/console/console-edit-property-value.html
new file mode 100644
index 0000000000000000000000000000000000000000..3244307cdb9c3d44327d5a934bf520ca28bff5d9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector/console/console-edit-property-value.html
@@ -0,0 +1,79 @@
+<html>
+<head>
+<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../http/tests/inspector/console-test.js"></script>
+<script>
+
+function logToConsole()
+{
+ var obj = {a: 1, b: "foo", c: null};
+ console.log(obj);
+}
+
+var test = function()
+{
+ InspectorTest.evaluateInConsole("logToConsole()", step1);
+
+ function step1()
+ {
+ InspectorTest.expandConsoleMessages(step2);
+ }
+
+ function step2()
+ {
+ var valueElements = getValueElements();
+ doubleClickTypeAndEnter(valueElements[0], "1 + 2");
+ InspectorTest.waitForRemoteObjectsConsoleMessages(step3);
+ }
+
+ function step3()
+ {
+ var valueElements = getValueElements();
+ doubleClickTypeAndEnter(valueElements[1], "nonExistingValue");
+ InspectorTest.waitForRemoteObjectsConsoleMessages(step4);
+ }
+
+ function step4()
+ {
+ var valueElements = getValueElements();
+ doubleClickTypeAndEnter(valueElements[2], "[1, 2, 3]");
+ InspectorTest.waitForRemoteObjectsConsoleMessages(step5);
+ }
+
+ function step5()
+ {
+ InspectorTest.dumpConsoleMessages();
+ InspectorTest.completeTest();
+ }
+
+ function getValueElements()
+ {
+ var messageElement = WebInspector.ConsoleView.instance()._visibleViewMessages[1]._messageElement;
+ return messageElement.querySelectorAll("::shadow .value");
+ }
+
+ function doubleClickTypeAndEnter(node, text)
+ {
+ var event = document.createEvent("MouseEvent");
+ event.initMouseEvent("dblclick", true, true, null, 2);
+ node.dispatchEvent(event);
+
+ InspectorTest.assertTrue(node.classList.contains("hidden"));
lushnikov 2016/08/03 22:34:48 let's not assert in tests - instead, dump and erro
luoe 2016/08/05 01:12:47 Done.
+
+ var messageElement = WebInspector.ConsoleView.instance()._visibleViewMessages[1]._messageElement;
+ var editPrompt = messageElement.querySelector("::shadow .text-prompt");
+ editPrompt.textContent = text;
+ editPrompt.dispatchEvent(InspectorTest.createKeyEvent("Enter"));
+ }
+}
+
+</script>
+</head>
+
+<body onload="runTest()">
+<p>
+Tests that property values can be edited inline in the console via double click.
+</p>
+
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698