re-tab
authorTravis Webb <me@traviswebb.com>
Tue, 17 Jun 2014 08:11:57 +0000 (04:11 -0400)
committerTravis Webb <me@traviswebb.com>
Tue, 17 Jun 2014 08:11:57 +0000 (04:11 -0400)
test/lib/zombie_auth.js

index 9906d90..af7af9e 100644 (file)
@@ -133,56 +133,42 @@ var assert = require('assert'),
         return browser.pressButton('Sign In');
       })
       .then(function () {
-
-          //
-          // Plan to give up after a set time
-          //
-          /*
-          var timeout = setTimeout(function () {
-              console.log("App did not fully load");
-              process.exit(1);
-            }, secondsToWait * 1000);
-            */
-
-          //
-          // Check frequently to see if the app is loaded, and move forward when it is
-          //
-          var interval = setInterval(function () {
-            //console.dir(browser.windows);
-            if (browser.window.XT && browser.window.XT.app && browser.window.XT.app.state === 6) {
-
-              // add the global objects to our global namespace
-              enyo = browser.window.enyo;
-              XG = browser.window.XG;
-              XM = browser.window.XM;
-              XT = browser.window.XT;
-              XV = browser.window.XV;
-              XZ.browser = browser;
-              XZ.host = host;
-              XZ.database = database;
-
-              XT.log = function (message, obj) {
-                if (message && message.toLowerCase().indexOf("error") === 0) {
-                  // errors from the datasource should cause the test to fail
-                  assert.fail(message + " " + JSON.stringify(obj));
-                }
-                // log if verbose mode or if the log is a warning
-                if (verboseMode || (message && message.code)) {
-                  console.log(JSON.stringify(arguments));
-                }
-              };
-
-              // these are really annoying
-              browser.window.Backbone.Relational.showWarnings = false;
-
-              // clear out both is interval and the I'm-giving-up timeout
-              // we really want neither to be run again.
-              clearInterval(interval);
-
-              // give control back to whoever called us
-              callback();
-            }
-          }, 500); // 100 = check to see if the app is loaded every 0.1 seconds
-        });
+        // Check frequently to see if the app is loaded, and move forward when it is
+        var interval = setInterval(function () {
+          if (browser.window.XT && browser.window.XT.app && browser.window.XT.app.state === 6) {
+
+            // add the global objects to our global namespace
+            enyo = browser.window.enyo;
+            XG = browser.window.XG;
+            XM = browser.window.XM;
+            XT = browser.window.XT;
+            XV = browser.window.XV;
+            XZ.browser = browser;
+            XZ.host = host;
+            XZ.database = database;
+
+            XT.log = function (message, obj) {
+              if (message && message.toLowerCase().indexOf("error") === 0) {
+                // errors from the datasource should cause the test to fail
+                assert.fail(message + " " + JSON.stringify(obj));
+              }
+              // log if verbose mode or if the log is a warning
+              if (verboseMode || (message && message.code)) {
+                console.log(JSON.stringify(arguments));
+              }
+            };
+
+            // these are really annoying
+            browser.window.Backbone.Relational.showWarnings = false;
+
+            // clear out both is interval and the I'm-giving-up timeout
+            // we really want neither to be run again.
+            clearInterval(interval);
+
+            // give control back to whoever called us
+            callback();
+          }
+        }, 500); // 100 = check to see if the app is loaded every 0.1 seconds
+      });
   };
 }());