Chromium Code Reviews| Index: chrome/browser/ui/views/bookmarks/bookmark_context_menu_unittest.cc |
| diff --git a/chrome/browser/ui/views/bookmarks/bookmark_context_menu_unittest.cc b/chrome/browser/ui/views/bookmarks/bookmark_context_menu_unittest.cc |
| index 1fa8186353bbcac948e48add17d225f2dcad5e7f..c07e4a523ff8f855e7cf5b2c9401558e4a48df9c 100644 |
| --- a/chrome/browser/ui/views/bookmarks/bookmark_context_menu_unittest.cc |
| +++ b/chrome/browser/ui/views/bookmarks/bookmark_context_menu_unittest.cc |
| @@ -152,6 +152,25 @@ TEST_F(BookmarkContextMenuTest, OpenAllIncognito) { |
| ASSERT_TRUE(folder->GetChild(0)->url() == navigator_.urls_[0]); |
| } |
| +// Tests counting tabs for 'open all' on a folder with a couple of bookmarks. |
| +TEST_F(BookmarkContextMenuTest, OpenCount) { |
| + const BookmarkNode* folder = model_->bookmark_bar_node()->GetChild(1); |
| + int result = chrome::OpenCount(NULL, folder); |
| + |
| + // Should have navigated to F1's child but not F11's child. |
|
Peter Kasting
2017/04/14 08:17:15
Nit: Should have navigated -> OpenAll() would navi
Paezagon
2017/04/14 18:47:25
Done.
|
| + ASSERT_EQ(static_cast<size_t>(2), result); |
|
Peter Kasting
2017/04/14 08:17:15
Nit: Can be EXPECT rather than ASSERT. Use "2U" i
Paezagon
2017/04/14 18:47:25
Done.
|
| +} |
| + |
| +// Tests counting on 'open all' on a folder with a couple of bookmarks in |
| +// incognito window. |
|
Peter Kasting
2017/04/14 08:17:15
Nit: This is slightly unclear; maybe instead "Same
Paezagon
2017/04/14 18:47:24
Done.
|
| +TEST_F(BookmarkContextMenuTest, OpenCountIncognito) { |
| + const BookmarkNode* folder = model_->bookmark_bar_node()->GetChild(1); |
| + int result = chrome::OpenCount(NULL, folder, true, profile_.get()); |
| + |
| + // Should have navigated to only f1a but not f2a. |
| + ASSERT_EQ(static_cast<size_t>(1), result); |
| +} |
| + |
| // Tests the enabled state of the menus when supplied an empty vector. |
| TEST_F(BookmarkContextMenuTest, EmptyNodes) { |
| BookmarkContextMenu controller( |