2 <!-- This is an example app used by chrome/functional/apptest.py to demonstrate
3 use of the Automation Event Queue for testing webapps using DomMutation
6 This example webapp simulates an asyncronous login flow. -->
10 <title>AppTest Example</title>
11 <script type="text/javascript">
15 document.getElementById("console").innerHTML += "> " + str + "<br \>";
18 /* Calls a function after a specified number of miliseconds. */
19 function delayedCallback(f, ms) {
20 globalTimeout = setTimeout(f, ms);
24 write("Initializing...");
25 delayedCallback(createLoginLink, 2000);
28 function createLoginLink() {
29 write("<a id='login' href='' onclick='return login();'>Log In</a>");
33 write("Logging in...");
34 delayedCallback(loginSuccess, 2000);
38 function loginSuccess() {
39 write("Login succeeded!");
40 document.getElementById("fail").innerHTML = "";
44 clearTimeout(globalTimeout);
51 <body onload="init()">
53 [ <a href='' onclick='return fail();'>Fail Test</a> ]