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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/apptest_basic.html
diff --git a/chrome/test/data/apptest_basic.html b/chrome/test/data/apptest_basic.html
new file mode 100644
index 0000000000000000000000000000000000000000..ff63e39eb4c9389b9203047fe54061de40d08520
--- /dev/null
+++ b/chrome/test/data/apptest_basic.html
@@ -0,0 +1,66 @@
+<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.
+
+ <head>
+ <title>AppTest Example</title>
+ <script type="text/javascript">
+ var globalTimeout;
+
+ function write(str) {
+ document.getElementById("console").innerHTML += "> " + str + "<br \>";
+ }
+
+ function delay(f, ms) {
+ globalTimeout = setTimeout(f, ms);
+ }
+
+ function raiseEvent(str) {
+ if (window.domAutomationController) {
+ window.domAutomationController.setAutomationId(424242)
+ window.domAutomationController.send(str);
+ }
+ }
+
+ function init() {
+ write("Initializing...");
+ delay(loginReady, 2000);
+ raiseEvent("init");
+ }
+
+ function loginReady() {
+ write("<a id='login' href='' onclick='return login();'>Log In</a>");
+ raiseEvent("login ready");
+ }
+
+ function login() {
+ write("Logging in...");
+ delay(loginSuccess, 2000);
+ raiseEvent("login start");
+ return false;
+ }
+
+ function loginSuccess() {
+ write("Login succeeded!");
+ raiseEvent("login done");
+ }
+
+ function fail() {
+ clearTimeout(globalTimeout);
+ write("App failed!");
+ raiseEvent("error");
+ return false;
+ }
+ </script>
+ </head>
+
+ <body onload="init()">
+ <div id="s-1">
+ [ <a id='fail' href='' onclick='return fail();'>Fail Test</a> ]
+ <br /><br />
+ </div>
+
+ <div id="console">
+ </div>
+
+ </body>
+
+</html>

Powered by Google App Engine
This is Rietveld 408576698