Commit 2458d402 authored by tsergeant's avatar tsergeant Committed by Commit bot

MD Bookmarks: Update a couple of TODOs

This completes one TODO (adding an error message to StoreClient),
and removes another obsolete TODO.

BUG=697706
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2858483002
Cr-Commit-Position: refs/heads/master@{#468574}
parent dde5c7d2
...@@ -49,7 +49,10 @@ cr.define('bookmarks', function() { ...@@ -49,7 +49,10 @@ cr.define('bookmarks', function() {
* @param {function(!BookmarksPageState)} valueGetter * @param {function(!BookmarksPageState)} valueGetter
*/ */
watch: function(localProperty, valueGetter) { watch: function(localProperty, valueGetter) {
// TODO(tsergeant): Warn if localProperty is not a defined property. if (!this.getPropertyInfo(localProperty).defined) {
console.error(
'No property ' + localProperty + ' defined on ' + this.is);
}
this.watches_.push({ this.watches_.push({
localProperty: localProperty, localProperty: localProperty,
valueGetter: valueGetter, valueGetter: valueGetter,
......
...@@ -52,11 +52,13 @@ suiteSetup(function() { ...@@ -52,11 +52,13 @@ suiteSetup(function() {
bookmarks.Store.prototype.reduce_.call(this, action); bookmarks.Store.prototype.reduce_.call(this, action);
}, },
/**
* Notifies UI elements that the store data has changed. When reducers are
* disabled, tests are responsible for manually changing the data to make
* UI elements update correctly (eg, tests must replace the whole list
* when changing a single element).
*/
notifyObservers: function() { notifyObservers: function() {
// TODO(tsergeant): Revisit how state modifications work in UI tests.
// We don't want tests to worry about modifying the whole state tree.
// Instead, we could perform a deep clone in here to ensure that every
// StoreClient is updated.
this.notifyObservers_(this.data); this.notifyObservers_(this.data);
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment