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

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

Issue 391413003: DevTools: [Timeline] extract common infrastructure from tracing tests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: comments addressed Created 6 years, 5 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
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script> 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script>
4 <script> 4 <script>
5 5
6 function load() 6 function load()
7 { 7 {
8 window.internals.setFocused(false); 8 window.internals.setFocused(false);
9 runTest(); 9 runTest();
10 } 10 }
11 11
12 function dump() 12 function dump()
13 { 13 {
14 log("================"); 14 log("================");
15 log("value of foo:" + document.getElementById("foo").value); 15 log("value of foo:" + document.getElementById("foo").value);
16 log("value of bar:" + document.getElementById("bar").value); 16 log("value of bar:" + document.getElementById("bar").value);
17 log("value of baz:" + document.getElementById("baz").value); 17 log("value of baz:" + document.getElementById("baz").value);
18 window.internals.setFocused(true); 18 window.internals.setFocused(true);
19 } 19 }
20 20
21 function test() 21 function test()
22 { 22 {
23 type("foo"); 23 type("foo");
24 typeTab(); 24 typeTab();
25 type("bar"); 25 type("bar");
26 typeTab(); 26 typeTab();
27 InspectorTest.executeInPage("dump()", InspectorTest.completeTest.bind(Inspec torTest)); 27 InspectorTest.evaluateInPage("dump()", InspectorTest.completeTest.bind(Inspe ctorTest));
28 28
29 function type(text) 29 function type(text)
30 { 30 {
31 for (var i = 0; i < text.length; ++i) { 31 for (var i = 0; i < text.length; ++i) {
32 var dec = text.charCodeAt(i); 32 var dec = text.charCodeAt(i);
33 var hex = "U+00" + Number(dec).toString(16); 33 var hex = "U+00" + Number(dec).toString(16);
34 InspectorTest.sendCommand("Input.dispatchKeyEvent", { 34 InspectorTest.sendCommand("Input.dispatchKeyEvent", {
35 "type": "rawKeyDown", 35 "type": "rawKeyDown",
36 "windowsVirtualKeyCode": dec, 36 "windowsVirtualKeyCode": dec,
37 "keyIdentifier": hex 37 "keyIdentifier": hex
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 </script> 70 </script>
71 </head> 71 </head>
72 <body onload="load()"> 72 <body onload="load()">
73 <div id="inputs"> 73 <div id="inputs">
74 <input onfocus="log('focus foo')" onblur="log('blur foo')" id="foo" autofocus> 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"> 75 <input onfocus="log('focus bar')" onblur="log('blur bar')" id="bar">
76 <input onfocus="log('focus baz')" onblur="log('blur baz')" id="baz"> 76 <input onfocus="log('focus baz')" onblur="log('blur baz')" id="baz">
77 </div> 77 </div>
78 </body> 78 </body>
79 </html> 79 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698