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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/components/widget-focus.html

Issue 2319523004: DevTools: Remember the last focused widget. (Closed)
Patch Set: Fix test Created 4 years, 3 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/components/widget-focus-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
(Empty)
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script>
5
6 function test()
7 {
8 var outerInput = document.createElement("input");
9 WebInspector.inspectorView.element.appendChild(outerInput);
10
11 var mainWidget = new WebInspector.Widget();
12 mainWidget.show(WebInspector.inspectorView.element);
13
14 var widget1 = new WebInspector.Widget();
15 widget1.show(mainWidget.element);
16 var input1 = document.createElement("input");
17 input1.id = "input1";
18 widget1.element.appendChild(input1);
19 widget1.setDefaultFocusedElement(input1);
20
21 var widget2 = new WebInspector.Widget();
22 widget2.show(mainWidget.element);
23 var input2 = document.createElement("input");
24 input2.id = "input2";
25 widget2.element.appendChild(input2);
26 widget2.setDefaultFocusedElement(input2);
27
28 outerInput.focus();
29 dumpFocus();
30
31 widget1.focus();
32 dumpFocus();
33
34 input2.focus();
35 dumpFocus();
36
37 outerInput.focus();
38 dumpFocus();
39
40 mainWidget.focus();
41 dumpFocus();
42
43 outerInput.focus();
44 dumpFocus();
45
46 widget2.hideWidget();
47 mainWidget.focus();
48 dumpFocus();
49
50 var splitWidget = new WebInspector.SplitWidget();
51 splitWidget.show(mainWidget.element);
52 var widget3 = new WebInspector.Widget();
53 var input3 = document.createElement("input");
54 input1.id = "input3";
55 widget3.element.appendChild(input3);
56 widget3.setDefaultFocusedElement(input3);
57 splitWidget.setSidebarWidget(widget3);
58 var widget4 = new WebInspector.Widget();
59 var input4 = document.createElement("input");
60 input4.id = "input4";
61 widget4.element.appendChild(input4);
62 widget4.setDefaultFocusedElement(input4);
63 splitWidget.setMainWidget(widget4);
64
65 splitWidget.focus();
66 dumpFocus();
67
68 widget3.focus();
69 dumpFocus();
70
71 mainWidget.focus();
72 dumpFocus();
73
74 InspectorTest.completeTest();
75
76 function dumpFocus()
77 {
78 var focused = WebInspector.currentFocusElement();
79 if (focused === outerInput) {
80 InspectorTest.addResult("Outer Focused");
81 } else if (focused === input1) {
82 InspectorTest.addResult("Input1 Focused");
83 } else if (focused === input2) {
84 InspectorTest.addResult("Input2 Focused");
85 } else if (focused === input3) {
86 InspectorTest.addResult("Input3 Focused");
87 } else if (focused === input4) {
88 InspectorTest.addResult("Input4 Focused");
89 } else {
90 InspectorTest.addResult("No focus");
91 }
92 }
93 }
94 </script>
95 </head>
96 <body onload="runTest()">
97 <p>Tests whether focus is properly remembered on widgets.</p>
98 </body>
99 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/components/widget-focus-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698