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..e99f3896c4eab0b4bc108c16c72d7f6a1d9015db 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,10 @@ cr.define('bookmarks', function() { |
this.observers_.push(client); |
}, |
- init: function() {}, |
+ init: function(state) { |
+ if (this.acceptInit_) |
+ this.data = state; |
+ }, |
removeObserver: function(client) {}, |
@@ -37,6 +41,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. |
+ acceptInit: function() { |
+ this.acceptInit_ = true; |
+ }, |
}; |
return { |