OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chrome/browser/ui/views/bookmarks/bookmark_context_menu.h" | 5 #include "chrome/browser/ui/views/bookmarks/bookmark_context_menu.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 } // namespace | 63 } // namespace |
64 | 64 |
65 class BookmarkContextMenuTest : public testing::Test { | 65 class BookmarkContextMenuTest : public testing::Test { |
66 public: | 66 public: |
67 BookmarkContextMenuTest() : model_(nullptr) {} | 67 BookmarkContextMenuTest() : model_(nullptr) {} |
68 | 68 |
69 void SetUp() override { | 69 void SetUp() override { |
70 profile_.reset(new TestingProfile()); | 70 profile_.reset(new TestingProfile()); |
71 profile_->CreateBookmarkModel(true); | 71 profile_->CreateBookmarkModel(true); |
72 | 72 |
73 model_ = BookmarkModelFactory::GetForProfile(profile_.get()); | 73 model_ = BookmarkModelFactory::GetForBrowserContext(profile_.get()); |
74 bookmarks::test::WaitForBookmarkModelToLoad(model_); | 74 bookmarks::test::WaitForBookmarkModelToLoad(model_); |
75 | 75 |
76 AddTestData(); | 76 AddTestData(); |
77 } | 77 } |
78 | 78 |
79 void TearDown() override { | 79 void TearDown() override { |
80 ui::Clipboard::DestroyClipboardForCurrentThread(); | 80 ui::Clipboard::DestroyClipboardForCurrentThread(); |
81 | 81 |
82 BrowserThread::GetBlockingPool()->FlushForTesting(); | 82 BrowserThread::GetBlockingPool()->FlushForTesting(); |
83 } | 83 } |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 controller.reset(new BookmarkContextMenu( | 372 controller.reset(new BookmarkContextMenu( |
373 NULL, NULL, profile_.get(), NULL, nodes[0]->parent(), nodes, false)); | 373 NULL, NULL, profile_.get(), NULL, nodes[0]->parent(), nodes, false)); |
374 EXPECT_TRUE(controller->IsCommandVisible(IDC_BOOKMARK_BAR_NEW_FOLDER)); | 374 EXPECT_TRUE(controller->IsCommandVisible(IDC_BOOKMARK_BAR_NEW_FOLDER)); |
375 EXPECT_TRUE( | 375 EXPECT_TRUE( |
376 controller->IsCommandVisible(IDC_BOOKMARK_BAR_SHOW_MANAGED_BOOKMARKS)); | 376 controller->IsCommandVisible(IDC_BOOKMARK_BAR_SHOW_MANAGED_BOOKMARKS)); |
377 menu = controller->menu(); | 377 menu = controller->menu(); |
378 EXPECT_TRUE(menu->GetMenuItemByID(IDC_BOOKMARK_BAR_NEW_FOLDER)->visible()); | 378 EXPECT_TRUE(menu->GetMenuItemByID(IDC_BOOKMARK_BAR_NEW_FOLDER)->visible()); |
379 EXPECT_TRUE(menu->GetMenuItemByID(IDC_BOOKMARK_BAR_SHOW_MANAGED_BOOKMARKS) | 379 EXPECT_TRUE(menu->GetMenuItemByID(IDC_BOOKMARK_BAR_SHOW_MANAGED_BOOKMARKS) |
380 ->visible()); | 380 ->visible()); |
381 } | 381 } |
OLD | NEW |