OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/callback.h" | 6 #include "base/callback.h" |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
11 #include "chrome/browser/bookmarks/bookmark_model.h" | 11 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 12 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
12 #include "chrome/browser/bookmarks/bookmark_utils.h" | 13 #include "chrome/browser/bookmarks/bookmark_utils.h" |
13 #include "chrome/browser/prefs/pref_service.h" | 14 #include "chrome/browser/prefs/pref_service.h" |
14 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/browser/ui/browser.h" | 16 #include "chrome/browser/ui/browser.h" |
16 #include "chrome/browser/ui/browser_tabstrip.h" | 17 #include "chrome/browser/ui/browser_tabstrip.h" |
17 #include "chrome/browser/ui/browser_window.h" | 18 #include "chrome/browser/ui/browser_window.h" |
18 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" | 19 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" |
19 #include "chrome/common/chrome_notification_types.h" | 20 #include "chrome/common/chrome_notification_types.h" |
20 #include "chrome/common/pref_names.h" | 21 #include "chrome/common/pref_names.h" |
21 #include "chrome/test/base/test_browser_window.h" | 22 #include "chrome/test/base/test_browser_window.h" |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 bookmark_utils::DisableBookmarkBarViewAnimationsForTesting(true); | 173 bookmark_utils::DisableBookmarkBarViewAnimationsForTesting(true); |
173 | 174 |
174 profile_.reset(new TestingProfile()); | 175 profile_.reset(new TestingProfile()); |
175 profile_->CreateBookmarkModel(true); | 176 profile_->CreateBookmarkModel(true); |
176 profile_->BlockUntilBookmarkModelLoaded(); | 177 profile_->BlockUntilBookmarkModelLoaded(); |
177 profile_->GetPrefs()->SetBoolean(prefs::kShowBookmarkBar, true); | 178 profile_->GetPrefs()->SetBoolean(prefs::kShowBookmarkBar, true); |
178 | 179 |
179 browser_.reset( | 180 browser_.reset( |
180 chrome::CreateBrowserWithTestWindowForProfile(profile_.get())); | 181 chrome::CreateBrowserWithTestWindowForProfile(profile_.get())); |
181 | 182 |
182 model_ = profile_->GetBookmarkModel(); | 183 model_ = BookmarkModelFactory::GetForProfile(profile_.get()); |
183 model_->ClearStore(); | 184 model_->ClearStore(); |
184 | 185 |
185 bb_view_.reset(new BookmarkBarView(browser_.get(), NULL)); | 186 bb_view_.reset(new BookmarkBarView(browser_.get(), NULL)); |
186 bb_view_->set_owned_by_client(); | 187 bb_view_->set_owned_by_client(); |
187 bb_view_->SetPageNavigator(&navigator_); | 188 bb_view_->SetPageNavigator(&navigator_); |
188 | 189 |
189 AddTestData(CreateBigMenu()); | 190 AddTestData(CreateBigMenu()); |
190 | 191 |
191 // Calculate the preferred size so that one button doesn't fit, which | 192 // Calculate the preferred size so that one button doesn't fit, which |
192 // triggers the overflow button to appear. | 193 // triggers the overflow button to appear. |
(...skipping 1517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1710 Done(); | 1711 Done(); |
1711 } | 1712 } |
1712 }; | 1713 }; |
1713 | 1714 |
1714 #if defined(OS_WIN) | 1715 #if defined(OS_WIN) |
1715 #define MAYBE_BookmarkBarViewTest19_SiblingMenu DISABLED_SiblingMenu | 1716 #define MAYBE_BookmarkBarViewTest19_SiblingMenu DISABLED_SiblingMenu |
1716 #else | 1717 #else |
1717 #define MAYBE_BookmarkBarViewTest19_SiblingMenu SiblingMenu | 1718 #define MAYBE_BookmarkBarViewTest19_SiblingMenu SiblingMenu |
1718 #endif | 1719 #endif |
1719 VIEW_TEST(BookmarkBarViewTest19, MAYBE_BookmarkBarViewTest19_SiblingMenu) | 1720 VIEW_TEST(BookmarkBarViewTest19, MAYBE_BookmarkBarViewTest19_SiblingMenu) |
OLD | NEW |