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 <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 class BookmarkBubbleViewTest : public BrowserWithTestWindowTest { | 28 class BookmarkBubbleViewTest : public BrowserWithTestWindowTest { |
29 public: | 29 public: |
30 BookmarkBubbleViewTest() {} | 30 BookmarkBubbleViewTest() {} |
31 | 31 |
32 // testing::Test: | 32 // testing::Test: |
33 void SetUp() override { | 33 void SetUp() override { |
34 BrowserWithTestWindowTest::SetUp(); | 34 BrowserWithTestWindowTest::SetUp(); |
35 | 35 |
36 profile()->CreateBookmarkModel(true); | 36 profile()->CreateBookmarkModel(true); |
37 BookmarkModel* bookmark_model = | 37 BookmarkModel* bookmark_model = |
38 BookmarkModelFactory::GetForProfile(profile()); | 38 BookmarkModelFactory::GetForBrowserContext(profile()); |
39 bookmarks::test::WaitForBookmarkModelToLoad(bookmark_model); | 39 bookmarks::test::WaitForBookmarkModelToLoad(bookmark_model); |
40 | 40 |
41 bookmarks::AddIfNotBookmarked( | 41 bookmarks::AddIfNotBookmarked( |
42 bookmark_model, GURL(kTestBookmarkURL), base::string16()); | 42 bookmark_model, GURL(kTestBookmarkURL), base::string16()); |
43 } | 43 } |
44 | 44 |
45 void TearDown() override { | 45 void TearDown() override { |
46 // Make sure the bubble is destroyed before the profile to avoid a crash. | 46 // Make sure the bubble is destroyed before the profile to avoid a crash. |
47 bubble_.reset(); | 47 bubble_.reset(); |
48 | 48 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 TEST_F(BookmarkBubbleViewTest, SyncPromoNotSignedIn) { | 95 TEST_F(BookmarkBubbleViewTest, SyncPromoNotSignedIn) { |
96 CreateBubbleView(); | 96 CreateBubbleView(); |
97 bubble_->Init(); | 97 bubble_->Init(); |
98 std::unique_ptr<views::View> footnote(bubble_->CreateFootnoteView()); | 98 std::unique_ptr<views::View> footnote(bubble_->CreateFootnoteView()); |
99 #if defined(OS_CHROMEOS) | 99 #if defined(OS_CHROMEOS) |
100 EXPECT_FALSE(footnote); | 100 EXPECT_FALSE(footnote); |
101 #else // !defined(OS_CHROMEOS) | 101 #else // !defined(OS_CHROMEOS) |
102 EXPECT_TRUE(footnote); | 102 EXPECT_TRUE(footnote); |
103 #endif | 103 #endif |
104 } | 104 } |
OLD | NEW |