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

Unified Diff: chrome/test/data/webui/md_bookmarks/test_store.js

Issue 2977523002: MD Bookmarks: Scroll and select items that are added to the main list (Closed)
Patch Set: Review comments Created 3 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/test/data/webui/md_bookmarks/test_store.js
diff --git a/chrome/test/data/webui/md_bookmarks/test_store.js b/chrome/test/data/webui/md_bookmarks/test_store.js
index f9c705d8ee4c91409d6539d09c77beb9165539da..b138113854cecc40e7f143f72ebe2b9bac4afcc1 100644
--- a/chrome/test/data/webui/md_bookmarks/test_store.js
+++ b/chrome/test/data/webui/md_bookmarks/test_store.js
@@ -10,7 +10,8 @@ suiteSetup(function() {
this.initialized_ = true;
this.lastAction_ = null;
- this.acceptInit_ = false;
+ /** @type {?PromiseResolver} */
+ this.initPromise_ = null;
this.enableReducers_ = false;
/** @type {!Map<string, !PromiseResolver>} */
this.resolverMap_ = new Map();
@@ -21,8 +22,10 @@ suiteSetup(function() {
/** @override */
init: function(state) {
- if (this.acceptInit_)
+ if (this.initPromise_) {
bookmarks.Store.prototype.init.call(this, state);
+ this.initPromise_.resolve();
+ }
},
get lastAction() {
@@ -77,10 +80,14 @@ suiteSetup(function() {
this.notifyObservers_(this.data);
},
- // Call in order to accept data from an init call to the TestStore once.
+ /**
+ * Call in order to accept data from an init call to the TestStore once.
+ * @return {Promise} Promise which resolves when the store is initialized.
+ */
acceptInitOnce: function() {
- this.acceptInit_ = true;
+ this.initPromise_ = new PromiseResolver();
this.initialized_ = false;
+ return this.initPromise_.promise;
},
/**

Powered by Google App Engine
This is Rietveld 408576698