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

Unified Diff: chrome/browser/ui/bookmarks/bookmark_context_menu_controller_unittest.cc

Issue 23068005: Convert UserPolicySigninService to use OAuth2TokenService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with ToT Created 7 years, 4 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/bookmarks/bookmark_context_menu_controller_unittest.cc
diff --git a/chrome/browser/ui/bookmarks/bookmark_context_menu_controller_unittest.cc b/chrome/browser/ui/bookmarks/bookmark_context_menu_controller_unittest.cc
index ef95d4bc269c00c13743c76638a1497f84d39268..4d19024bcf0c70e11571a5c1b844f07d61ee8dee 100644
--- a/chrome/browser/ui/bookmarks/bookmark_context_menu_controller_unittest.cc
+++ b/chrome/browser/ui/bookmarks/bookmark_context_menu_controller_unittest.cc
@@ -46,7 +46,13 @@ class BookmarkContextMenuControllerTest : public testing::Test {
}
virtual void SetUp() OVERRIDE {
- profile_.reset(new TestingProfile());
+ Reset(false);
+ }
+ void Reset(bool incognito) {
+ TestingProfile::Builder builder;
+ if (incognito)
+ builder.SetIncognito();
+ profile_ = builder.Build();
profile_->CreateBookmarkModel(true);
model_ = BookmarkModelFactory::GetForProfile(profile_.get());
@@ -237,11 +243,12 @@ TEST_F(BookmarkContextMenuControllerTest, MultipleFoldersWithURLs) {
// Tests the enabled state of open incognito.
TEST_F(BookmarkContextMenuControllerTest, DisableIncognito) {
+ // Create a new incognito profile.
+ Reset(true);
std::vector<const BookmarkNode*> nodes;
nodes.push_back(model_->bookmark_bar_node()->GetChild(0));
BookmarkContextMenuController controller(
NULL, NULL, NULL, profile_.get(), NULL, nodes[0]->parent(), nodes);
- profile_->set_incognito(true);
EXPECT_FALSE(controller.IsCommandIdEnabled(IDC_BOOKMARK_BAR_OPEN_INCOGNITO));
EXPECT_FALSE(
controller.IsCommandIdEnabled(IDC_BOOKMARK_BAR_OPEN_ALL_INCOGNITO));

Powered by Google App Engine
This is Rietveld 408576698