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

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

Issue 2319523004: DevTools: Remember the last focused widget. (Closed)
Patch Set: Add 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/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>
dgozman 2016/09/12 21:21:14 Let's place it under inspector/components.
einbinder 2016/09/12 22:19:05 Done.
2 <head>
3 <script src="../http/tests/inspector/inspector-test.js"></script>
4 <script>
5 function test()
6 {
7 var outerInput = document.createElement("input");
8 WebInspector.inspectorView.element.appendChild(outerInput);
9
10 var mainWidget = new WebInspector.Widget();
dgozman 2016/09/12 21:21:14 Let's add SplitWidget into a mix as well to exerci
einbinder 2016/09/12 22:19:04 Done.
11 mainWidget.show(WebInspector.inspectorView.element);
12
13 var widget1 = new WebInspector.Widget();
14 widget1.show(mainWidget.element);
15 var input1 = document.createElement("input");
16 widget1.element.appendChild(input1);
17 widget1.setDefaultFocusedElement(input1);
18
19 var widget2 = new WebInspector.Widget();
20 widget2.show(mainWidget.element);
21 var input2 = document.createElement("input");
22 widget2.element.appendChild(input2);
23 widget2.setDefaultFocusedElement(input2);
24
25 outerInput.focus();
26 dumpFocus();
27
28 widget1.focus();
29 dumpFocus();
30
31 input2.focus();
32 dumpFocus();
33
34 outerInput.focus();
35 dumpFocus();
36
37 mainWidget.focus();
38 dumpFocus();
39
40 outerInput.focus();
41 dumpFocus();
42
43 widget2.hideWidget();
44 mainWidget.focus();
45 dumpFocus();
46
47 InspectorTest.completeTest();
48
49 function dumpFocus(){
dgozman 2016/09/12 21:21:14 { on next line
einbinder 2016/09/12 22:19:05 Done.
50 var focused = WebInspector.currentFocusElement();
dgozman 2016/09/12 21:21:14 Should we check document.deepActiveElement to not
einbinder 2016/09/12 22:19:04 document.deepActiveElement unfortunately isn't a t
51 if (focused === outerInput) {
52 InspectorTest.addResult("Outer Focused");
53 } else if (focused === input1) {
54 InspectorTest.addResult("Input1 Focused");
55 } else if (focused === input2) {
56 InspectorTest.addResult("Input2 Focused");
57 }
58 else {
dgozman 2016/09/12 21:21:14 } else on the same line
einbinder 2016/09/12 22:19:05 Done.
59 InspectorTest.addResult("No focus");
60 }
61 }
62 }
63 </script>
64 </head>
65 <body onload="runTest()">
66 <p>Tests whether focus is properly remembered on widgets.</p>
67 </body>
68 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/widget-focus-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698