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

Side by Side Diff: chrome/test/data/apptest_basic.html

Issue 9372120: Implementation of AutomationEventQueue and associated framework to support generic non-blocking aut… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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
(Empty)
1 <html>
dennis_jeffrey 2012/02/23 19:26:36 I recommend adding a comment at the top of this fi
craigdh 2012/02/24 01:30:02 Done.
2
3 <head>
4 <title>AppTest Example</title>
5 <script type="text/javascript">
6 var globalTimeout;
7
8 function write(str) {
9 document.getElementById("console").innerHTML += "> " + str + "<br \>";
10 }
11
12 function delay(f, ms) {
13 globalTimeout = setTimeout(f, ms);
14 }
15
16 function raiseEvent(str) {
17 if (window.domAutomationController) {
18 window.domAutomationController.setAutomationId(424242)
19 window.domAutomationController.send(str);
20 }
21 }
22
23 function init() {
24 write("Initializing...");
25 delay(loginReady, 2000);
26 raiseEvent("init");
27 }
28
29 function loginReady() {
30 write("<a id='login' href='' onclick='return login();'>Log In</a>");
31 raiseEvent("login ready");
32 }
33
34 function login() {
35 write("Logging in...");
36 delay(loginSuccess, 2000);
37 raiseEvent("login start");
38 return false;
39 }
40
41 function loginSuccess() {
42 write("Login succeeded!");
43 raiseEvent("login done");
44 }
45
46 function fail() {
47 clearTimeout(globalTimeout);
48 write("App failed!");
49 raiseEvent("error");
50 return false;
51 }
52 </script>
53 </head>
54
55 <body onload="init()">
56 <div id="s-1">
57 [ <a id='fail' href='' onclick='return fail();'>Fail Test</a> ]
58 <br /><br />
59 </div>
60
61 <div id="console">
62 </div>
63
64 </body>
65
66 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698