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

Unified Diff: chrome/browser/ui/views/bookmarks/bookmark_context_menu_unittest.cc

Issue 2809003002: Making bookmark folder context menu display the number of bookmarks that will be opened by Open All (Closed)
Patch Set: Refactoring URL itteration function as per comments, addressing other formatting and style errors Created 3 years, 8 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/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(

Powered by Google App Engine
This is Rietveld 408576698