Title: [158094] trunk/Websites/test-results
Revision
158094
Author
[email protected]
Date
2013-10-26 17:48:30 -0700 (Sat, 26 Oct 2013)

Log Message

New flakiness dashboard should support substring matching
https://bugs.webkit.org/show_bug.cgi?id=123393

Reviewed by Alexey Proskuryakov.

Addressed the use cases by
1. Always showing the candidate even when there is exactly one test matching the current value.
2. Adding all tests that match the current value upon the user pressing enter key.

* public/index.html:
(fetchManifest): Add all tests that match the current value. Confirm whether the user really
want to add all the tests when there are more than 15 tests to add.
* public/js/autocompleter.js:
(Autocompleter.prototype.filterCandidates): Extracted from _updateCandidates.
(Autocompleter.prototype._updateCandidates): Show the candidate window even when there is
exactly one test that matches the criteria so that the user can select this test.

Modified Paths

Diff

Modified: trunk/Websites/test-results/ChangeLog (158093 => 158094)


--- trunk/Websites/test-results/ChangeLog	2013-10-27 00:47:21 UTC (rev 158093)
+++ trunk/Websites/test-results/ChangeLog	2013-10-27 00:48:30 UTC (rev 158094)
@@ -1,5 +1,24 @@
 2013-10-26  Ryosuke Niwa  <[email protected]>
 
+        New flakiness dashboard should support substring matching
+        https://bugs.webkit.org/show_bug.cgi?id=123393
+
+        Reviewed by Alexey Proskuryakov.
+
+        Addressed the use cases by
+        1. Always showing the candidate even when there is exactly one test matching the current value.
+        2. Adding all tests that match the current value upon the user pressing enter key.
+
+        * public/index.html:
+        (fetchManifest): Add all tests that match the current value. Confirm whether the user really
+        want to add all the tests when there are more than 15 tests to add.
+        * public/js/autocompleter.js:
+        (Autocompleter.prototype.filterCandidates): Extracted from _updateCandidates.
+        (Autocompleter.prototype._updateCandidates): Show the candidate window even when there is
+        exactly one test that matches the criteria so that the user can select this test.
+
+2013-10-26  Ryosuke Niwa  <[email protected]>
+
         New flakiness dashboard shouldn't treat tests with right expectations as failing
         https://bugs.webkit.org/show_bug.cgi?id=123385
 

Modified: trunk/Websites/test-results/public/index.html (158093 => 158094)


--- trunk/Websites/test-results/public/index.html	2013-10-27 00:47:21 UTC (rev 158093)
+++ trunk/Websites/test-results/public/index.html	2013-10-27 00:48:30 UTC (rev 158094)
@@ -518,6 +518,23 @@
     var input = document.getElementById('testName');
     input.autocompleter = new Autocompleter(input, testNames);
 
+    input.form._onsubmit_ = function (event) {
+        addTests(input.value);
+        event.preventDefault();
+        return false;
+    }
+
+    function addTests(filter) {
+        var candidates = input.autocompleter.filterCandidates(filter);
+        if (candidates.length > 15) {
+            if (!confirm('Are you sure you want to add ' + candidates.length + ' tests that match this substring?'))
+                return;
+        }
+        for (var i = 0; i < candidates.length; i++)
+            TestResultsView.fetchTest(candidates[i]);
+        TestResultsView.updateLocationHash();
+    }
+
     var builderListView = document.getElementById('builderListView');
     TestResultsView._sortObjectsByName(response['builders']).forEach(function (builder) {
         builderListView.appendChild(element('option', [builder.name]));

Modified: trunk/Websites/test-results/public/js/autocompleter.js (158093 => 158094)


--- trunk/Websites/test-results/public/js/autocompleter.js	2013-10-27 00:47:21 UTC (rev 158093)
+++ trunk/Websites/test-results/public/js/autocompleter.js	2013-10-27 00:48:30 UTC (rev 158094)
@@ -12,6 +12,10 @@
     inputElement.addEventListener('keydown', this.navigate.bind(this));
 }
 
+Autocompleter.prototype.filterCandidates = function (filter) {
+    return this._list.filter(function (testName) { return testName.indexOf(filter) >= 0; });
+}
+
 Autocompleter.prototype._ensureCandidateWindow = function () {
     if (this._candidateWindow)
         return;
@@ -28,8 +32,8 @@
     if (this._currentFilter == filter)
         return false;
 
-    var candidates = this._list.filter(function (testName) { return testName.indexOf(filter) >= 0; });
-    if (candidates.length > 50 || candidates.length == 1)
+    var candidates = this.filterCandidates(filter);
+    if (candidates.length > 50)
         candidates = [];
     this._candidates = candidates;
     this._currentFilter = filter;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to