| Index: chrome/test/data/webui/md_bookmarks/policy_test.js
|
| diff --git a/chrome/test/data/webui/md_bookmarks/policy_test.js b/chrome/test/data/webui/md_bookmarks/policy_test.js
|
| index 365400739b556ffad2f919daf2c09953558eb399..6e5cb07baa04035839c5ad2b91875c9a4c381f71 100644
|
| --- a/chrome/test/data/webui/md_bookmarks/policy_test.js
|
| +++ b/chrome/test/data/webui/md_bookmarks/policy_test.js
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -suite('Incognito policy', function() {
|
| +suite('Bookmarks policies', function() {
|
| var store;
|
| var app;
|
|
|
| @@ -17,13 +17,14 @@ suite('Incognito policy', function() {
|
| });
|
| store.setReducersEnabled(true);
|
| store.expectAction('set-incognito-availability');
|
| + store.expectAction('set-can-edit');
|
| store.replaceSingleton();
|
|
|
| app = document.createElement('bookmarks-app');
|
| replaceBody(app);
|
| });
|
|
|
| - test('updates when changed by the browser', function() {
|
| + test('incognito availability updates when changed', function() {
|
| var commandManager = bookmarks.CommandManager.getInstance();
|
| // Incognito is disabled during testGenPreamble(). Wait for the front-end to
|
| // load the config.
|
| @@ -42,4 +43,17 @@ suite('Incognito policy', function() {
|
| commandManager.canExecute(Command.OPEN_INCOGNITO, new Set(['11'])));
|
| });
|
| });
|
| +
|
| + test('canEdit updates when changed', function() {
|
| + var commandManager = bookmarks.CommandManager.getInstance();
|
| + return store.waitForAction('set-can-edit').then(action => {
|
| + assertFalse(store.data.prefs.canEdit);
|
| + assertFalse(commandManager.canExecute(Command.DELETE, new Set(['11'])));
|
| +
|
| + return cr.sendWithPromise('testSetCanEdit', true);
|
| + }).then(() => {
|
| + assertTrue(store.data.prefs.canEdit);
|
| + assertTrue(commandManager.canExecute(Command.DELETE, new Set(['11'])));
|
| + });
|
| + });
|
| });
|
|
|