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

Side by Side Diff: LayoutTests/inspector-protocol/input/dispatchKeyEvent-focus.html

Issue 292973007: DevTools: Focus/blur events that are triggered by DevTools get dispatched when page is unfocused (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/inspector-protocol/input/dispatchKeyEvent-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 type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script>
4 <script>
5
6 function load()
7 {
8 window.internals.setFocused(false);
9 runTest();
10 }
11
12 function dump()
13 {
14 log("================");
15 log("value of foo:" + document.getElementById("foo").value);
16 log("value of bar:" + document.getElementById("bar").value);
17 log("value of baz:" + document.getElementById("baz").value);
18 window.internals.setFocused(true);
dgozman 2014/05/22 12:45:47 Events you dispatch should have already focused th
vsevik 2014/05/22 13:14:40 I think this is done to make sure the test is not
19 }
20
21 function test()
22 {
23 type("foo");
24 typeTab();
25 type("bar");
26 typeTab();
27 InspectorTest.executeInPage("dump()", InspectorTest.completeTest.bind(Inspec torTest));
28
29 function type(text)
30 {
31 for (var i = 0; i < text.length; ++i) {
32 var dec = text.charCodeAt(i);
33 var hex = "U+00" + Number(dec).toString(16);
34 InspectorTest.sendCommand("Input.dispatchKeyEvent", {
35 "type": "rawKeyDown",
36 "windowsVirtualKeyCode": dec,
37 "keyIdentifier": hex
38 });
39 InspectorTest.sendCommand("Input.dispatchKeyEvent", {
40 "type": "char",
41 "text": text[i],
42 "unmodifiedText": text[i]
43 });
44 InspectorTest.sendCommand("Input.dispatchKeyEvent", {
45 "type": "keyUp",
46 "windowsVirtualKeyCode": dec,
47 "keyIdentifier": hex
48 });
49 }
50 }
51
52 function typeTab()
53 {
54 InspectorTest.sendCommand("Input.dispatchKeyEvent", {
55 "type": "rawKeyDown",
56 "windowsVirtualKeyCode": 9,
57 "keyIdentifier": "U+0009"
58 });
59 InspectorTest.sendCommand("Input.dispatchKeyEvent", {
60 "type": "char"
61 });
62 InspectorTest.sendCommand("Input.dispatchKeyEvent", {
63 "type": "keyUp",
64 "windowsVirtualKeyCode": 9,
65 "keyIdentifier": "U+0009"
66 });
67 }
68 }
69
70 </script>
71 </head>
72 <body onload="load()">
73 <div id="inputs">
74 <input onfocus="log('focus foo')" onblur="log('blur foo')" id="foo" autofocus>
75 <input onfocus="log('focus bar')" onblur="log('blur bar')" id="bar">
76 <input onfocus="log('focus baz')" onblur="log('blur baz')" id="baz">
77 </div>
78 </body>
79 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/inspector-protocol/input/dispatchKeyEvent-focus-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698