Commit 43083f01 authored by dpapad's avatar dpapad Committed by Commit Bot

WebUI Polymer 2: Fix a few Bookmarks tests.

Specifically fixing the following tests:
MaterialBookmarksActionsTest.All
MaterialBookmarksAppTest.All
MaterialBookmarksCommandManagerTest.All
MaterialBookmarksFolderNodeTest.All
MaterialBookmarksItemTest.All
MaterialBookmarksListTest.All
MaterialBookmarksPolicyTest.All
MaterialBookmarksReducersTest.All
MaterialBookmarksToastManagerTest.All
MaterialBookmarksToolbarTest.All
MaterialBookmarksUtilTest.All

Remaining bookmarks tests will be fixed in a follow up.

Bug: 738611
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I62bd58f80208e024953b7f44a110a28db07d7cb4
Reviewed-on: https://chromium-review.googlesource.com/1100108
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: default avatarcalamity <calamity@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567437}
parent 96195371
......@@ -23,9 +23,7 @@ cr.define('bookmarks', function() {
},
/** @private {Set<string>} */
menuIds_: {
type: Object,
},
menuIds_: Object,
/** @private */
hasAnySublabel_: {
......@@ -40,7 +38,10 @@ cr.define('bookmarks', function() {
* or elsewhere in the UI.
* @private {MenuSource}
*/
menuSource_: MenuSource.NONE,
menuSource_: {
type: Number,
value: MenuSource.NONE,
},
/** @private */
globalCanEdit_: Boolean,
......@@ -702,7 +703,7 @@ cr.define('bookmarks', function() {
* @private
*/
computeHasAnySublabel_: function() {
if (!this.menuIds_)
if (this.menuIds_ == undefined || this.menuCommands_ == undefined)
return false;
return this.menuCommands_.some(
......
......@@ -476,7 +476,7 @@ TEST_F('MaterialBookmarksFocusTest', 'All', function() {
focusedItem.focus();
assertEquals(focusedItem, dialogFocusManager.getFocusedElement_());
commandManager.openCommandMenuAtPosition(0, 0);
commandManager.openCommandMenuAtPosition(0, 0, MenuSource.ITEM);
const dropdown = commandManager.$.dropdown.getIfExists();
assertTrue(dropdown.open);
......@@ -495,7 +495,7 @@ TEST_F('MaterialBookmarksFocusTest', 'All', function() {
focusedItem.focus();
assertEquals(focusedItem, dialogFocusManager.getFocusedElement_());
commandManager.openCommandMenuAtPosition(0, 0);
commandManager.openCommandMenuAtPosition(0, 0, MenuSource.ITEM);
const dropdown = commandManager.$.dropdown.getIfExists();
dropdown.close();
assertNotEquals(focusedItem, dialogFocusManager.getFocusedElement_());
......@@ -521,14 +521,14 @@ TEST_F('MaterialBookmarksFocusTest', 'All', function() {
focusedItem.focus();
assertEquals(focusedItem, dialogFocusManager.getFocusedElement_());
commandManager.openCommandMenuAtPosition(0, 0);
commandManager.openCommandMenuAtPosition(0, 0, MenuSource.ITEM);
assertNotEquals(focusedItem, dialogFocusManager.getFocusedElement_());
const dropdown = commandManager.$.dropdown.getIfExists();
dropdown.close();
focusedItem = items[3];
focusedItem.focus();
commandManager.openCommandMenuAtPosition(0, 0);
commandManager.openCommandMenuAtPosition(0, 0, MenuSource.ITEM);
return waitForClose(dropdown)
.then(() => {
......
......@@ -113,6 +113,7 @@ function customClick(element, config, eventName) {
const props = {
bubbles: true,
cancelable: true,
composed: true,
button: 0,
buttons: 1,
shiftKey: false,
......
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