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

Side by Side Diff: chrome/test/data/webui/md_bookmarks/test_store.js

Issue 2820153003: [MD Bookmarks] Add keyboard navigation to sidebar. (Closed)
Patch Set: address comments Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 suiteSetup(function() { 5 suiteSetup(function() {
6 cr.define('bookmarks', function() { 6 cr.define('bookmarks', function() {
7 var TestStore = function(data) { 7 var TestStore = function(data) {
8 bookmarks.Store.call(this); 8 bookmarks.Store.call(this);
9 this.data_ = Object.assign(bookmarks.util.createEmptyState(), data); 9 this.data_ = Object.assign(bookmarks.util.createEmptyState(), data);
10 this.initialized_ = true; 10 this.initialized_ = true;
11 11
12 this.lastAction_ = null; 12 this.lastAction_ = null;
13 this.acceptInit_ = false; 13 this.acceptInit_ = false;
14 this.enableReducers_ = false; 14 this.enableReducers_ = false;
15 }; 15 };
16 16
17 TestStore.prototype = { 17 TestStore.prototype = {
18 __proto__: bookmarks.Store.prototype, 18 __proto__: bookmarks.Store.prototype,
19 19
20 init: function(state) { 20 init: function(state) {
21 if (this.acceptInit_) 21 if (this.acceptInit_)
22 bookmarks.Store.prototype.init.call(this, state); 22 bookmarks.Store.prototype.init.call(this, state);
23 }, 23 },
24 24
25 get lastAction() { 25 get lastAction() {
26 return this.lastAction_; 26 return this.lastAction_;
27 }, 27 },
28 28
29 resetLastAction() {
30 this.lastAction_ = null;
31 },
32
29 get data() { 33 get data() {
30 return this.data_; 34 return this.data_;
31 }, 35 },
32 36
33 set data(newData) { 37 set data(newData) {
34 this.data_ = newData; 38 this.data_ = newData;
35 }, 39 },
36 40
37 /** 41 /**
38 * Enable or disable calling bookmarks.reduceAction for each action. 42 * Enable or disable calling bookmarks.reduceAction for each action.
(...skipping 28 matching lines...) Expand all
67 this.acceptInit_ = true; 71 this.acceptInit_ = true;
68 this.initialized_ = false; 72 this.initialized_ = false;
69 }, 73 },
70 }; 74 };
71 75
72 return { 76 return {
73 TestStore: TestStore, 77 TestStore: TestStore,
74 }; 78 };
75 }); 79 });
76 }); 80 });
OLDNEW
« no previous file with comments | « chrome/test/data/webui/md_bookmarks/md_bookmarks_focus_test.js ('k') | chrome/test/data/webui/md_bookmarks/test_util.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698