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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158094
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2013-10-26 Ryosuke Niwa <rniwa@webkit.org>
+
+ 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 <rniwa@webkit.org>
New flakiness dashboard shouldn't treat tests with right expectations as failing
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]));
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;
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;