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" |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 class BookmarkBubbleViewTest : public BrowserWithTestWindowTest { | 23 class BookmarkBubbleViewTest : public BrowserWithTestWindowTest { |
24 public: | 24 public: |
25 BookmarkBubbleViewTest() {} | 25 BookmarkBubbleViewTest() {} |
26 | 26 |
27 // testing::Test: | 27 // testing::Test: |
28 virtual void SetUp() OVERRIDE { | 28 virtual void SetUp() OVERRIDE { |
29 BrowserWithTestWindowTest::SetUp(); | 29 BrowserWithTestWindowTest::SetUp(); |
30 | 30 |
31 profile()->CreateBookmarkModel(true); | 31 profile()->CreateBookmarkModel(true); |
32 test::WaitForBookmarkModelToLoad(profile()); | 32 BookmarkModel* bookmark_model = |
| 33 BookmarkModelFactory::GetForProfile(profile()); |
| 34 test::WaitForBookmarkModelToLoad(bookmark_model); |
33 | 35 |
34 bookmark_utils::AddIfNotBookmarked( | 36 bookmark_utils::AddIfNotBookmarked( |
35 BookmarkModelFactory::GetForProfile(profile()), | 37 bookmark_model, GURL(kTestBookmarkURL), base::string16()); |
36 GURL(kTestBookmarkURL), | |
37 base::string16()); | |
38 } | 38 } |
39 | 39 |
40 virtual void TearDown() OVERRIDE { | 40 virtual void TearDown() OVERRIDE { |
41 // Make sure the bubble is destroyed before the profile to avoid a crash. | 41 // Make sure the bubble is destroyed before the profile to avoid a crash. |
42 bubble_.reset(); | 42 bubble_.reset(); |
43 | 43 |
44 BrowserWithTestWindowTest::TearDown(); | 44 BrowserWithTestWindowTest::TearDown(); |
45 } | 45 } |
46 | 46 |
47 // BrowserWithTestWindowTest: | 47 // BrowserWithTestWindowTest: |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // Verifies that the sync promo is displayed for a user that is not signed in. | 90 // Verifies that the sync promo is displayed for a user that is not signed in. |
91 TEST_F(BookmarkBubbleViewTest, SyncPromoNotSignedIn) { | 91 TEST_F(BookmarkBubbleViewTest, SyncPromoNotSignedIn) { |
92 CreateBubbleView(); | 92 CreateBubbleView(); |
93 bubble_->Init(); | 93 bubble_->Init(); |
94 #if defined(OS_CHROMEOS) | 94 #if defined(OS_CHROMEOS) |
95 EXPECT_FALSE(bubble_->sync_promo_view_); | 95 EXPECT_FALSE(bubble_->sync_promo_view_); |
96 #else // !defined(OS_CHROMEOS) | 96 #else // !defined(OS_CHROMEOS) |
97 EXPECT_TRUE(bubble_->sync_promo_view_); | 97 EXPECT_TRUE(bubble_->sync_promo_view_); |
98 #endif | 98 #endif |
99 } | 99 } |
OLD | NEW |