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

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

Issue 2902103002: MD Bookmarks: Disable 'Open in Incognito Window' when Incognito is disabled (Closed)
Patch Set: Review comment 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 suite('Incognito policy', function() {
6 var store;
7 var app;
8
9 setup(function() {
10 store = new bookmarks.TestStore({
11 nodes: testTree(createFolder(
12 '1',
13 [
14 createItem('11'),
15 ])),
16 selectedFolder: '1',
17 });
18 store.setReducersEnabled(true);
19 store.expectAction('set-incognito-availability');
20 bookmarks.Store.instance_ = store;
21
22 app = document.createElement('bookmarks-app');
23 replaceBody(app);
24 });
25
26 test('updates when changed by the browser', function() {
27 var commandManager = bookmarks.CommandManager.getInstance();
28 // Incognito is disabled during testGenPreamble(). Wait for the front-end to
29 // load the config.
30 return store.waitForAction('set-incognito-availability').then(action => {
31 assertEquals(IncognitoAvailability.DISABLED,
32 store.data.prefs.incognitoAvailability);
33 assertFalse(
34 commandManager.canExecute(Command.OPEN_INCOGNITO, new Set(['11'])));
35
36 return cr.sendWithPromise(
37 'testSetIncognito', IncognitoAvailability.ENABLED);
38 }).then(() => {
39 assertEquals(IncognitoAvailability.ENABLED,
40 store.data.prefs.incognitoAvailability);
41 assertTrue(
42 commandManager.canExecute(Command.OPEN_INCOGNITO, new Set(['11'])));
43 });
44 });
45 });
OLDNEW
« no previous file with comments | « chrome/test/data/webui/md_bookmarks/md_bookmarks_browsertest.js ('k') | chrome/test/data/webui/md_bookmarks/test_store.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698