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/location.h" | 8 #include "base/location.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 views::MenuController::TurnOffMenuSelectionHoldForTest(); | 273 views::MenuController::TurnOffMenuSelectionHoldForTest(); |
274 BookmarkBarView::DisableAnimationsForTesting(true); | 274 BookmarkBarView::DisableAnimationsForTesting(true); |
275 SetConstrainedWindowViewsClient(CreateChromeConstrainedWindowViewsClient()); | 275 SetConstrainedWindowViewsClient(CreateChromeConstrainedWindowViewsClient()); |
276 | 276 |
277 profile_.reset(new TestingProfile()); | 277 profile_.reset(new TestingProfile()); |
278 profile_->CreateBookmarkModel(true); | 278 profile_->CreateBookmarkModel(true); |
279 model_ = BookmarkModelFactory::GetForProfile(profile_.get()); | 279 model_ = BookmarkModelFactory::GetForProfile(profile_.get()); |
280 bookmarks::test::WaitForBookmarkModelToLoad(model_); | 280 bookmarks::test::WaitForBookmarkModelToLoad(model_); |
281 profile_->GetPrefs()->SetBoolean(bookmarks::prefs::kShowBookmarkBar, true); | 281 profile_->GetPrefs()->SetBoolean(bookmarks::prefs::kShowBookmarkBar, true); |
282 | 282 |
283 Browser::CreateParams native_params(profile_.get(), | 283 Browser::CreateParams native_params(profile_.get()); |
284 chrome::GetActiveDesktop()); | |
285 browser_ = chrome::CreateBrowserWithTestWindowForParams(&native_params); | 284 browser_ = chrome::CreateBrowserWithTestWindowForParams(&native_params); |
286 | 285 |
287 local_state_.reset(new ScopedTestingLocalState( | 286 local_state_.reset(new ScopedTestingLocalState( |
288 TestingBrowserProcess::GetGlobal())); | 287 TestingBrowserProcess::GetGlobal())); |
289 model_->ClearStore(); | 288 model_->ClearStore(); |
290 | 289 |
291 bb_view_.reset(new BookmarkBarView(browser_.get(), NULL)); | 290 bb_view_.reset(new BookmarkBarView(browser_.get(), NULL)); |
292 bb_view_->set_owned_by_client(); | 291 bb_view_->set_owned_by_client(); |
293 bb_view_->SetPageNavigator(&navigator_); | 292 bb_view_->SetPageNavigator(&navigator_); |
294 | 293 |
(...skipping 2032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2327 // Menu should not be showing anymore. | 2326 // Menu should not be showing anymore. |
2328 views::MenuItemView* menu = bb_view_->GetMenu(); | 2327 views::MenuItemView* menu = bb_view_->GetMenu(); |
2329 ASSERT_TRUE(menu == nullptr); | 2328 ASSERT_TRUE(menu == nullptr); |
2330 | 2329 |
2331 Done(); | 2330 Done(); |
2332 } | 2331 } |
2333 }; | 2332 }; |
2334 | 2333 |
2335 VIEW_TEST(BookmarkBarViewTest26, CancelModeClosesMenu); | 2334 VIEW_TEST(BookmarkBarViewTest26, CancelModeClosesMenu); |
2336 #endif | 2335 #endif |
OLD | NEW |