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

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

Issue 2912893002: MD Bookmarks: Support policies for disabling bookmark editing (Closed)
Patch Set: canEdit -> globalCanEdit Created 3 years, 6 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
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'])));
+ });
+ });
});
« no previous file with comments | « chrome/test/data/webui/md_bookmarks/md_bookmarks_focus_test.js ('k') | chrome/test/data/webui/md_bookmarks/toolbar_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698