diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-08 18:56:29 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-08 18:56:29 +0000 |
commit | 202bd1883fac347987a65fe6cb52ab908fea347e (patch) | |
tree | 6c37d27b7d300f190fd9b4fc5edc840f8b64ac94 /chrome/browser/views/bookmark_context_menu_test.cc | |
parent | 3a943fc9e24653047ba7f3abe68e8624100fb36f (diff) | |
download | chromium_src-202bd1883fac347987a65fe6cb52ab908fea347e.zip chromium_src-202bd1883fac347987a65fe6cb52ab908fea347e.tar.gz chromium_src-202bd1883fac347987a65fe6cb52ab908fea347e.tar.bz2 |
Bookmark context menu unforking:
- create cross-platform BookmarkContextMenuController
- use the new class on GTK (replacing BookmarkContextMenuControllerGtk)
- keep using the old class on views (now named BookmarkContextMenuControllerViews)
- add tests for the new BookmarkContextMenuController
Review URL: http://codereview.chromium.org/577016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38371 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/bookmark_context_menu_test.cc')
-rw-r--r-- | chrome/browser/views/bookmark_context_menu_test.cc | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/chrome/browser/views/bookmark_context_menu_test.cc b/chrome/browser/views/bookmark_context_menu_test.cc index e0a3936..9082324 100644 --- a/chrome/browser/views/bookmark_context_menu_test.cc +++ b/chrome/browser/views/bookmark_context_menu_test.cc @@ -111,7 +111,7 @@ TEST_F(BookmarkContextMenuTest, DeleteURL) { nodes.push_back(model_->GetBookmarkBarNode()->GetChild(0)); BookmarkContextMenu controller( NULL, profile_.get(), NULL, nodes[0]->GetParent(), nodes, - BookmarkContextMenuController::BOOKMARK_BAR); + BookmarkContextMenuControllerViews::BOOKMARK_BAR); GURL url = model_->GetBookmarkBarNode()->GetChild(0)->GetURL(); ASSERT_TRUE(controller.IsCommandEnabled(IDS_BOOKMARK_BAR_REMOVE)); // Delete the URL. @@ -138,7 +138,7 @@ TEST_F(BookmarkContextMenuTest, EmptyNodes) { BookmarkContextMenu controller( NULL, profile_.get(), NULL, model_->other_node(), std::vector<const BookmarkNode*>(), - BookmarkContextMenuController::BOOKMARK_BAR); + BookmarkContextMenuControllerViews::BOOKMARK_BAR); EXPECT_FALSE(controller.IsCommandEnabled(IDS_BOOMARK_BAR_OPEN_ALL)); EXPECT_FALSE( controller.IsCommandEnabled(IDS_BOOMARK_BAR_OPEN_ALL_NEW_WINDOW)); @@ -159,7 +159,7 @@ TEST_F(BookmarkContextMenuTest, SingleURL) { nodes.push_back(model_->GetBookmarkBarNode()->GetChild(0)); BookmarkContextMenu controller( NULL, profile_.get(), NULL, nodes[0]->GetParent(), - nodes, BookmarkContextMenuController::BOOKMARK_BAR); + nodes, BookmarkContextMenuControllerViews::BOOKMARK_BAR); EXPECT_TRUE(controller.IsCommandEnabled(IDS_BOOMARK_BAR_OPEN_ALL)); EXPECT_TRUE( controller.IsCommandEnabled(IDS_BOOMARK_BAR_OPEN_ALL_NEW_WINDOW)); @@ -181,7 +181,7 @@ TEST_F(BookmarkContextMenuTest, MultipleURLs) { nodes.push_back(model_->GetBookmarkBarNode()->GetChild(1)->GetChild(0)); BookmarkContextMenu controller( NULL, profile_.get(), NULL, nodes[0]->GetParent(), - nodes, BookmarkContextMenuController::BOOKMARK_BAR); + nodes, BookmarkContextMenuControllerViews::BOOKMARK_BAR); EXPECT_TRUE(controller.IsCommandEnabled(IDS_BOOMARK_BAR_OPEN_ALL)); EXPECT_TRUE( controller.IsCommandEnabled(IDS_BOOMARK_BAR_OPEN_ALL_NEW_WINDOW)); @@ -202,7 +202,7 @@ TEST_F(BookmarkContextMenuTest, SingleFolder) { nodes.push_back(model_->GetBookmarkBarNode()->GetChild(2)); BookmarkContextMenu controller( NULL, profile_.get(), NULL, nodes[0]->GetParent(), - nodes, BookmarkContextMenuController::BOOKMARK_BAR); + nodes, BookmarkContextMenuControllerViews::BOOKMARK_BAR); EXPECT_FALSE(controller.IsCommandEnabled(IDS_BOOMARK_BAR_OPEN_ALL)); EXPECT_FALSE( controller.IsCommandEnabled(IDS_BOOMARK_BAR_OPEN_ALL_NEW_WINDOW)); @@ -224,7 +224,7 @@ TEST_F(BookmarkContextMenuTest, MultipleEmptyFolders) { nodes.push_back(model_->GetBookmarkBarNode()->GetChild(3)); BookmarkContextMenu controller( NULL, profile_.get(), NULL, nodes[0]->GetParent(), - nodes, BookmarkContextMenuController::BOOKMARK_BAR); + nodes, BookmarkContextMenuControllerViews::BOOKMARK_BAR); EXPECT_FALSE(controller.IsCommandEnabled(IDS_BOOMARK_BAR_OPEN_ALL)); EXPECT_FALSE( controller.IsCommandEnabled(IDS_BOOMARK_BAR_OPEN_ALL_NEW_WINDOW)); @@ -246,7 +246,7 @@ TEST_F(BookmarkContextMenuTest, MultipleFoldersWithURLs) { nodes.push_back(model_->GetBookmarkBarNode()->GetChild(4)); BookmarkContextMenu controller( NULL, profile_.get(), NULL, nodes[0]->GetParent(), - nodes, BookmarkContextMenuController::BOOKMARK_BAR); + nodes, BookmarkContextMenuControllerViews::BOOKMARK_BAR); EXPECT_TRUE(controller.IsCommandEnabled(IDS_BOOMARK_BAR_OPEN_ALL)); EXPECT_TRUE( controller.IsCommandEnabled(IDS_BOOMARK_BAR_OPEN_ALL_NEW_WINDOW)); @@ -266,7 +266,7 @@ TEST_F(BookmarkContextMenuTest, DisableIncognito) { nodes.push_back(model_->GetBookmarkBarNode()->GetChild(0)); BookmarkContextMenu controller( NULL, profile_.get(), NULL, nodes[0]->GetParent(), - nodes, BookmarkContextMenuController::BOOKMARK_BAR); + nodes, BookmarkContextMenuControllerViews::BOOKMARK_BAR); profile_->set_off_the_record(true); EXPECT_FALSE(controller.IsCommandEnabled(IDS_BOOMARK_BAR_OPEN_INCOGNITO)); EXPECT_FALSE(controller.IsCommandEnabled(IDS_BOOMARK_BAR_OPEN_ALL_INCOGNITO)); @@ -278,7 +278,7 @@ TEST_F(BookmarkContextMenuTest, DisabledItemsWithOtherNode) { nodes.push_back(model_->other_node()); BookmarkContextMenu controller( NULL, profile_.get(), NULL, nodes[0], nodes, - BookmarkContextMenuController::BOOKMARK_BAR); + BookmarkContextMenuControllerViews::BOOKMARK_BAR); EXPECT_FALSE(controller.IsCommandEnabled(IDS_BOOKMARK_BAR_EDIT)); EXPECT_FALSE(controller.IsCommandEnabled(IDS_BOOKMARK_BAR_REMOVE)); } @@ -288,7 +288,7 @@ TEST_F(BookmarkContextMenuTest, DisabledItemsWithOtherNode) { TEST_F(BookmarkContextMenuTest, EmptyNodesNullParent) { BookmarkContextMenu controller( NULL, profile_.get(), NULL, NULL, std::vector<const BookmarkNode*>(), - BookmarkContextMenuController::BOOKMARK_MANAGER_ORGANIZE_MENU); + BookmarkContextMenuControllerViews::BOOKMARK_MANAGER_ORGANIZE_MENU); EXPECT_FALSE(controller.IsCommandEnabled(IDS_BOOMARK_BAR_OPEN_ALL)); EXPECT_FALSE( controller.IsCommandEnabled(IDS_BOOMARK_BAR_OPEN_ALL_NEW_WINDOW)); @@ -307,7 +307,7 @@ TEST_F(BookmarkContextMenuTest, CutCopyPasteNode) { nodes.push_back(model_->GetBookmarkBarNode()->GetChild(0)); scoped_ptr<BookmarkContextMenu> controller(new BookmarkContextMenu( NULL, profile_.get(), NULL, nodes[0]->GetParent(), nodes, - BookmarkContextMenuController::BOOKMARK_BAR)); + BookmarkContextMenuControllerViews::BOOKMARK_BAR)); EXPECT_TRUE(controller->IsCommandEnabled(IDS_COPY)); EXPECT_TRUE(controller->IsCommandEnabled(IDS_CUT)); @@ -316,7 +316,7 @@ TEST_F(BookmarkContextMenuTest, CutCopyPasteNode) { controller.reset(new BookmarkContextMenu( NULL, profile_.get(), NULL, nodes[0]->GetParent(), nodes, - BookmarkContextMenuController::BOOKMARK_BAR)); + BookmarkContextMenuControllerViews::BOOKMARK_BAR)); int old_count = model_->GetBookmarkBarNode()->GetChildCount(); controller->ExecuteCommand(IDS_PASTE); @@ -327,7 +327,7 @@ TEST_F(BookmarkContextMenuTest, CutCopyPasteNode) { controller.reset(new BookmarkContextMenu( NULL, profile_.get(), NULL, nodes[0]->GetParent(), nodes, - BookmarkContextMenuController::BOOKMARK_BAR)); + BookmarkContextMenuControllerViews::BOOKMARK_BAR)); // Cut the URL. controller->ExecuteCommand(IDS_CUT); ASSERT_TRUE(model_->GetBookmarkBarNode()->GetChild(0)->is_url()); |