[Performance tests] Interactive/SelectAll.html throws an exception
https://bugs.webkit.org/show_bug.cgi?id=124495

Reviewed by Antti Koivisto

Return a boolean indicating whether more values are needed or not in
PerfTestRunner.measureValueAsync so that runTest can terminate gracefully.

* Interactive/SelectAll.html:
(runTest): Don't schedule a timer for runTest if we've got enough values.
* resources/runner.js:
(PerfTestRunner.measureValueAsync): Returns true iff more values are needed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159421 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/PerformanceTests/ChangeLog b/PerformanceTests/ChangeLog
index 7d423b9..66a4165 100644
--- a/PerformanceTests/ChangeLog
+++ b/PerformanceTests/ChangeLog
@@ -1,3 +1,18 @@
+2013-11-18  Ryosuke Niwa  <rniwa@webkit.org>
+
+        [Performance tests] Interactive/SelectAll.html throws an exception
+        https://bugs.webkit.org/show_bug.cgi?id=124495
+
+        Reviewed by Antti Koivisto
+
+        Return a boolean indicating whether more values are needed or not in
+        PerfTestRunner.measureValueAsync so that runTest can terminate gracefully.
+
+        * Interactive/SelectAll.html:
+        (runTest): Don't schedule a timer for runTest if we've got enough values.
+        * resources/runner.js:
+        (PerfTestRunner.measureValueAsync): Returns true iff more values are needed.
+
 2013-11-13  Antti Koivisto  <antti@apple.com>
 
         This was supposed to test overflow-wrap:break-word instead of word-break:break-all.
diff --git a/PerformanceTests/Interactive/SelectAll.html b/PerformanceTests/Interactive/SelectAll.html
index 1e89ab9..3d6d7ec 100644
--- a/PerformanceTests/Interactive/SelectAll.html
+++ b/PerformanceTests/Interactive/SelectAll.html
@@ -22,10 +22,11 @@
         iframe.contentDocument.execCommand('SelectAll');
         iframe.contentDocument.body.offsetTop;
         setTimeout(function () {
-            PerfTestRunner.measureValueAsync(PerfTestRunner.now() - startTime);
+            if (!PerfTestRunner.measureValueAsync(PerfTestRunner.now() - startTime))
+                return;
             PerfTestRunner.gc();
             setTimeout(runTest, 0);
-        }, 0);        
+        }, 0);
     }, 0);
 }
 
diff --git a/PerformanceTests/resources/runner.js b/PerformanceTests/resources/runner.js
index 576f1d1..c7aa116 100755
--- a/PerformanceTests/resources/runner.js
+++ b/PerformanceTests/resources/runner.js
@@ -236,11 +236,15 @@
             ignoreWarmUpAndLog(measuredValue);
         } catch (exception) {
             logFatalError("Got an exception while logging the result with name=" + exception.name + ", message=" + exception.message);
-            return;
+            return false;
         }
 
-        if (completedIterations >= iterationCount)
+        if (completedIterations >= iterationCount) {
             finish();
+            return false;
+        }
+
+        return true;
     }
 
     PerfTestRunner.measureTime = function (test) {