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/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 model_(NULL), | 108 model_(NULL), |
109 bb_view_(NULL), | 109 bb_view_(NULL), |
110 file_thread_(BrowserThread::FILE, MessageLoop::current()) { | 110 file_thread_(BrowserThread::FILE, MessageLoop::current()) { |
111 } | 111 } |
112 | 112 |
113 virtual void SetUp() OVERRIDE { | 113 virtual void SetUp() OVERRIDE { |
114 BookmarkBarView::DisableAnimationsForTesting(true); | 114 BookmarkBarView::DisableAnimationsForTesting(true); |
115 | 115 |
116 profile_.reset(new TestingProfile()); | 116 profile_.reset(new TestingProfile()); |
117 profile_->CreateBookmarkModel(true); | 117 profile_->CreateBookmarkModel(true); |
118 profile_->BlockUntilBookmarkModelLoaded(); | 118 model_ = BookmarkModelFactory::GetForProfile(profile_.get()); |
| 119 ui_test_utils::WaitForBookmarkModelToLoad(model_); |
119 profile_->GetPrefs()->SetBoolean(prefs::kShowBookmarkBar, true); | 120 profile_->GetPrefs()->SetBoolean(prefs::kShowBookmarkBar, true); |
120 | 121 |
121 Browser::CreateParams native_params(profile_.get(), | 122 Browser::CreateParams native_params(profile_.get(), |
122 chrome::HOST_DESKTOP_TYPE_NATIVE); | 123 chrome::HOST_DESKTOP_TYPE_NATIVE); |
123 browser_.reset( | 124 browser_.reset( |
124 chrome::CreateBrowserWithTestWindowForParams(&native_params)); | 125 chrome::CreateBrowserWithTestWindowForParams(&native_params)); |
125 | 126 |
126 model_ = BookmarkModelFactory::GetForProfile(profile_.get()); | |
127 model_->ClearStore(); | 127 model_->ClearStore(); |
128 | 128 |
129 bb_view_.reset(new BookmarkBarView(browser_.get(), NULL)); | 129 bb_view_.reset(new BookmarkBarView(browser_.get(), NULL)); |
130 bb_view_->set_owned_by_client(); | 130 bb_view_->set_owned_by_client(); |
131 bb_view_->SetPageNavigator(&navigator_); | 131 bb_view_->SetPageNavigator(&navigator_); |
132 | 132 |
133 AddTestData(CreateBigMenu()); | 133 AddTestData(CreateBigMenu()); |
134 | 134 |
135 // Calculate the preferred size so that one button doesn't fit, which | 135 // Calculate the preferred size so that one button doesn't fit, which |
136 // triggers the overflow button to appear. | 136 // triggers the overflow button to appear. |
(...skipping 1633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1770 EXPECT_TRUE(bb_view_->GetContextMenu() == NULL); | 1770 EXPECT_TRUE(bb_view_->GetContextMenu() == NULL); |
1771 EXPECT_TRUE(bb_view_->GetMenu() == NULL); | 1771 EXPECT_TRUE(bb_view_->GetMenu() == NULL); |
1772 | 1772 |
1773 Done(); | 1773 Done(); |
1774 } | 1774 } |
1775 | 1775 |
1776 ContextMenuNotificationObserver observer_; | 1776 ContextMenuNotificationObserver observer_; |
1777 }; | 1777 }; |
1778 | 1778 |
1779 VIEW_TEST(BookmarkBarViewTest21, ContextMenusForEmptyFolder) | 1779 VIEW_TEST(BookmarkBarViewTest21, ContextMenusForEmptyFolder) |
OLD | NEW |