Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Tools / GardeningServer / scripts / garden-o-matic.js
index 8e10dcb..7d8ccec 100644 (file)
@@ -36,6 +36,9 @@ var g_failuresController = null;
 
 var g_nonLayoutTestFailureBuilders = null;
 
+var g_updating = false;
+var g_updateButton = null;
+
 function updatePartyTime()
 {
     if (!g_unexpectedFailuresController.length() && !g_nonLayoutTestFailureBuilders.hasFailures())
@@ -55,6 +58,13 @@ function updateTreeStatus()
 
 function update()
 {
+    if (g_updating)
+        return;
+
+    g_updating = true;
+    if (g_updateButton)
+        g_updateButton.disabled = true;
+
     if (g_revisionHint)
         g_revisionHint.dismiss();
 
@@ -86,7 +96,7 @@ function update()
             updatePartyTime();
             g_unexpectedFailuresController.purge();
 
-            Object.keys(config.currentBuilders()).forEach(function(builderName) {
+            Object.keys(config.builders).forEach(function(builderName) {
                 if (!model.state.resultsByBuilder[builderName])
                     g_info.add(new ui.notifications.Info('Could not find test results for ' + builderName + ' in the last ' + config.kBuildNumberLimit + ' runs.'));
             });
@@ -96,6 +106,10 @@ function update()
             g_revisionHint = new ui.notifications.Info('');
             g_revisionHint.updateWithNode(new ui.revisionDetails());
             g_info.add(g_revisionHint);
+
+            g_updating = false;
+            if (g_updateButton)
+                g_updateButton.disabled = false;
         });
     });
 }
@@ -136,6 +150,7 @@ $(document).ready(function() {
     updateButton.addEventListener("click", update);
     updateButton.textContent = 'update';
     topBar.appendChild(updateButton);
+    g_updateButton = updateButton;
 
     var treeStatus = new ui.TreeStatus();
     topBar.appendChild(treeStatus);