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

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

Issue 2185493003: MD Settings: Adding some unit tests for <settings-main>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@search_no_results
Patch Set: Nit. Created 4 years, 5 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 bc621f34e9f9a940584a7f59a267340c3c3c64cf..4684864d1ada00a90473cd36b52a82811198caee 100644
--- a/chrome/browser/resources/settings/settings_main/settings_main.js
+++ b/chrome/browser/resources/settings/settings_main/settings_main.js
@@ -195,6 +195,8 @@ Polymer({
* @param {string} query
michaelpg 2016/07/30 05:38:44 @return
dpapad 2016/08/01 21:23:06 Done.
*/
searchContents: function(query) {
+ var promiseResolver = new PromiseResolver();
michaelpg 2016/07/30 05:38:44 this promise/setTimeout business is scary, if we'r
michaelpg 2016/07/30 05:38:44 ok, after looking over it... we're resolving this
dpapad 2016/08/01 21:23:06 Removed PromiseResolver. Yes, it was used to avoid
+
this.ensureInDefaultSearchPage_();
this.toolbarSpinnerActive = true;
@@ -213,14 +215,18 @@ Polymer({
// Nothing to do here. A previous search request was canceled
// because a new search request was issued before the first one
// completed.
+ promiseResolver.resolve();
michaelpg 2016/07/30 05:38:44 we should just resolve this before the if so we do
dpapad 2016/08/01 21:23:06 Done.
return;
}
this.toolbarSpinnerActive = false;
this.showNoResultsFound_ =
!request.isSame('') && !request.didFindMatches();
+ promiseResolver.resolve();
}.bind(this));
}.bind(this), 0);
+
+ return promiseResolver.promise;
},
/**

Powered by Google App Engine
This is Rietveld 408576698