OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_bubble_view.h" | 5 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
11 #include "chrome/browser/signin/fake_signin_manager.h" | 11 #include "chrome/browser/signin/fake_signin_manager_builder.h" |
12 #include "chrome/browser/signin/signin_manager_factory.h" | 12 #include "chrome/browser/signin/signin_manager_factory.h" |
13 #include "chrome/browser/ui/bookmarks/bookmark_bubble_delegate.h" | 13 #include "chrome/browser/ui/bookmarks/bookmark_bubble_delegate.h" |
14 #include "chrome/test/base/browser_with_test_window_test.h" | 14 #include "chrome/test/base/browser_with_test_window_test.h" |
15 #include "components/bookmarks/browser/bookmark_utils.h" | 15 #include "components/bookmarks/browser/bookmark_utils.h" |
16 #include "components/bookmarks/test/bookmark_test_helpers.h" | 16 #include "components/bookmarks/test/bookmark_test_helpers.h" |
17 #include "components/signin/core/browser/signin_manager.h" | 17 #include "components/signin/core/browser/signin_manager.h" |
18 | 18 |
19 using bookmarks::BookmarkModel; | 19 using bookmarks::BookmarkModel; |
20 | 20 |
21 namespace { | 21 namespace { |
(...skipping 21 matching lines...) Expand all Loading... |
43 // Make sure the bubble is destroyed before the profile to avoid a crash. | 43 // Make sure the bubble is destroyed before the profile to avoid a crash. |
44 bubble_.reset(); | 44 bubble_.reset(); |
45 | 45 |
46 BrowserWithTestWindowTest::TearDown(); | 46 BrowserWithTestWindowTest::TearDown(); |
47 } | 47 } |
48 | 48 |
49 // BrowserWithTestWindowTest: | 49 // BrowserWithTestWindowTest: |
50 TestingProfile* CreateProfile() override { | 50 TestingProfile* CreateProfile() override { |
51 TestingProfile::Builder builder; | 51 TestingProfile::Builder builder; |
52 builder.AddTestingFactory(SigninManagerFactory::GetInstance(), | 52 builder.AddTestingFactory(SigninManagerFactory::GetInstance(), |
53 FakeSigninManagerBase::Build); | 53 BuildFakeSigninManagerBase); |
54 return builder.Build().release(); | 54 return builder.Build().release(); |
55 } | 55 } |
56 | 56 |
57 protected: | 57 protected: |
58 // Creates a bookmark bubble view. | 58 // Creates a bookmark bubble view. |
59 void CreateBubbleView() { | 59 void CreateBubbleView() { |
60 scoped_ptr<BookmarkBubbleDelegate> delegate; | 60 scoped_ptr<BookmarkBubbleDelegate> delegate; |
61 bubble_.reset(new BookmarkBubbleView(NULL, | 61 bubble_.reset(new BookmarkBubbleView(NULL, |
62 NULL, | 62 NULL, |
63 delegate.Pass(), | 63 delegate.Pass(), |
(...skipping 29 matching lines...) Expand all Loading... |
93 // Verifies that the sync promo is displayed for a user that is not signed in. | 93 // Verifies that the sync promo is displayed for a user that is not signed in. |
94 TEST_F(BookmarkBubbleViewTest, SyncPromoNotSignedIn) { | 94 TEST_F(BookmarkBubbleViewTest, SyncPromoNotSignedIn) { |
95 CreateBubbleView(); | 95 CreateBubbleView(); |
96 bubble_->Init(); | 96 bubble_->Init(); |
97 #if defined(OS_CHROMEOS) | 97 #if defined(OS_CHROMEOS) |
98 EXPECT_FALSE(bubble_->sync_promo_view_); | 98 EXPECT_FALSE(bubble_->sync_promo_view_); |
99 #else // !defined(OS_CHROMEOS) | 99 #else // !defined(OS_CHROMEOS) |
100 EXPECT_TRUE(bubble_->sync_promo_view_); | 100 EXPECT_TRUE(bubble_->sync_promo_view_); |
101 #endif | 101 #endif |
102 } | 102 } |
OLD | NEW |