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

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

Issue 2776993002: [MD Bookmarks] Persist collapsed folders between page loads. (Closed)
Patch Set: fix closure Created 3 years, 8 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
« no previous file with comments | « chrome/test/data/webui/md_bookmarks/md_bookmarks_browsertest.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 77f5c0fee158a3f7cc0d891cd294c15a5e833e7d..36041011cdfa3a390ca3fcd4dbdf9e950413473c 100644
--- a/chrome/test/data/webui/md_bookmarks/test_store.js
+++ b/chrome/test/data/webui/md_bookmarks/test_store.js
@@ -7,6 +7,7 @@ cr.define('bookmarks', function() {
this.data = Object.assign(bookmarks.util.createEmptyState(), data);
this.lastAction_ = null;
this.observers_ = [];
+ this.acceptInit_ = false;
};
TestStore.prototype = {
@@ -14,7 +15,12 @@ cr.define('bookmarks', function() {
this.observers_.push(client);
},
- init: function() {},
+ init: function(state) {
+ if (this.acceptInit_) {
+ this.data = state;
+ this.acceptInit_ = false;
+ }
+ },
removeObserver: function(client) {},
@@ -37,6 +43,11 @@ cr.define('bookmarks', function() {
// StoreClient is updated.
this.observers_.forEach((client) => client.onStateChanged(this.data));
},
+
+ // Call in order to accept data from an init call to the TestStore once.
+ acceptInitOnce: function() {
+ this.acceptInit_ = true;
+ },
};
return {
« no previous file with comments | « chrome/test/data/webui/md_bookmarks/md_bookmarks_browsertest.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698