| OLD | NEW |
| 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 suite('<bookmarks-toolbar>', function() { | 5 suite('<bookmarks-toolbar>', function() { |
| 6 var toolbar; | 6 var toolbar; |
| 7 var store; | 7 var store; |
| 8 var commandManager; | 8 var commandManager; |
| 9 | 9 |
| 10 suiteSetup(function() { | 10 suiteSetup(function() { |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 store.data.selection.items = new Set(['2', '3']); | 81 store.data.selection.items = new Set(['2', '3']); |
| 82 store.notifyObservers(); | 82 store.notifyObservers(); |
| 83 Polymer.dom.flush(); | 83 Polymer.dom.flush(); |
| 84 | 84 |
| 85 assertTrue(toolbar.showSelectionOverlay); | 85 assertTrue(toolbar.showSelectionOverlay); |
| 86 assertTrue( | 86 assertTrue( |
| 87 toolbar.$$('cr-toolbar-selection-overlay').deleteButton.disabled); | 87 toolbar.$$('cr-toolbar-selection-overlay').deleteButton.disabled); |
| 88 }); | 88 }); |
| 89 | 89 |
| 90 test('overflow menu options are disabled when appropriate', function() { | 90 test('overflow menu options are disabled when appropriate', function() { |
| 91 MockInteractions.tap(toolbar.$.menuButton); |
| 92 Polymer.dom.flush(); |
| 93 |
| 91 store.data.selectedFolder = '1'; | 94 store.data.selectedFolder = '1'; |
| 92 store.notifyObservers(); | 95 store.notifyObservers(); |
| 93 | 96 |
| 94 assertFalse(toolbar.$.addBookmarkButton.disabled); | 97 assertFalse(toolbar.$$('#addBookmarkButton').disabled); |
| 95 | 98 |
| 96 store.data.selectedFolder = '4'; | 99 store.data.selectedFolder = '4'; |
| 97 store.notifyObservers(); | 100 store.notifyObservers(); |
| 98 | 101 |
| 99 assertTrue(toolbar.$.addBookmarkButton.disabled); | 102 assertTrue(toolbar.$$('#addBookmarkButton').disabled); |
| 100 assertFalse(toolbar.$.importBookmarkButton.disabled); | 103 assertFalse(toolbar.$$('#importBookmarkButton').disabled); |
| 101 | 104 |
| 102 store.data.prefs.canEdit = false; | 105 store.data.prefs.canEdit = false; |
| 103 store.notifyObservers(); | 106 store.notifyObservers(); |
| 104 | 107 |
| 105 assertTrue(toolbar.$.addBookmarkButton.disabled); | 108 assertTrue(toolbar.$$('#addBookmarkButton').disabled); |
| 106 assertTrue(toolbar.$.importBookmarkButton.disabled); | 109 assertTrue(toolbar.$$('#importBookmarkButton').disabled); |
| 107 }); | 110 }); |
| 108 }); | 111 }); |
| OLD | NEW |