Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Unified Diff: chrome/browser/resources/settings/settings_main/settings_main.js

Issue 2739323005: MD Settings: Allow search within settings to track multiple requests separately. (Closed)
Patch Set: Fix test error. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/settings/settings_main/settings_main.js
diff --git a/chrome/browser/resources/settings/settings_main/settings_main.js b/chrome/browser/resources/settings/settings_main/settings_main.js
index 22b4bd86fb2766ef7145bfac11d076b95fbf0639..27f17d1756d21cf945fafc0c76da44e45302b1b9 100644
--- a/chrome/browser/resources/settings/settings_main/settings_main.js
+++ b/chrome/browser/resources/settings/settings_main/settings_main.js
@@ -254,19 +254,20 @@ Polymer({
setTimeout(function() {
var whenSearchDone =
assert(this.getPage_(settings.Route.BASIC)).searchContents(query);
- whenSearchDone.then(function(request) {
+ whenSearchDone.then(function(requests) {
resolve();
- if (!request.finished) {
+ if (requests.some(function(r) { return r.canceled; })) {
Dan Beam 2017/03/14 00:44:28 can we hide these details in the request class?
dpapad 2017/03/14 03:28:11 Done. Wrapped those in a temp object inside basic_
// Nothing to do here. A previous search request was canceled
- // because a new search request was issued before the first one
- // completed.
+ // because a new search request was issued with a different query
+ // before the previous completed.
return;
}
this.toolbarSpinnerActive = false;
- this.inSearchMode_ = !request.isSame('');
+ this.inSearchMode_ = !requests[0].isSame('');
Dan Beam 2017/03/14 00:44:27 should this also be .every()?
dpapad 2017/03/14 03:28:11 It does not need to, because all the requests corr
this.showNoResultsFound_ =
- this.inSearchMode_ && !request.didFindMatches();
+ this.inSearchMode_ &&
+ requests.every(function(r) { return !r.didFindMatches(); });
Dan Beam 2017/03/14 00:44:28 can we hide these details in the request class?
dpapad 2017/03/14 03:28:11 Done.
}.bind(this));
}.bind(this), 0);
}.bind(this));

Powered by Google App Engine
This is Rietveld 408576698