| 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" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 profile_->CreateBookmarkModel(true); | 173 profile_->CreateBookmarkModel(true); |
| 174 profile_->BlockUntilBookmarkModelLoaded(); | 174 profile_->BlockUntilBookmarkModelLoaded(); |
| 175 profile_->GetPrefs()->SetBoolean(prefs::kShowBookmarkBar, true); | 175 profile_->GetPrefs()->SetBoolean(prefs::kShowBookmarkBar, true); |
| 176 | 176 |
| 177 browser_.reset(new Browser(Browser::TYPE_TABBED, profile_.get())); | 177 browser_.reset(new Browser(Browser::TYPE_TABBED, profile_.get())); |
| 178 | 178 |
| 179 model_ = profile_->GetBookmarkModel(); | 179 model_ = profile_->GetBookmarkModel(); |
| 180 model_->ClearStore(); | 180 model_->ClearStore(); |
| 181 | 181 |
| 182 bb_view_.reset(new BookmarkBarView(browser_.get())); | 182 bb_view_.reset(new BookmarkBarView(browser_.get())); |
| 183 bb_view_->set_parent_owned(false); | 183 bb_view_->set_owned_by_client(); |
| 184 bb_view_->SetPageNavigator(&navigator_); | 184 bb_view_->SetPageNavigator(&navigator_); |
| 185 | 185 |
| 186 AddTestData(CreateBigMenu()); | 186 AddTestData(CreateBigMenu()); |
| 187 | 187 |
| 188 // Calculate the preferred size so that one button doesn't fit, which | 188 // Calculate the preferred size so that one button doesn't fit, which |
| 189 // triggers the overflow button to appear. | 189 // triggers the overflow button to appear. |
| 190 // | 190 // |
| 191 // BookmarkBarView::Layout does nothing if the parent is NULL and | 191 // BookmarkBarView::Layout does nothing if the parent is NULL and |
| 192 // GetPreferredSize hard codes a width of 1. For that reason we add the | 192 // GetPreferredSize hard codes a width of 1. For that reason we add the |
| 193 // BookmarkBarView to a dumby view as the parent. | 193 // BookmarkBarView to a dumby view as the parent. |
| (...skipping 1428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1622 ASSERT_TRUE(menu != NULL); | 1622 ASSERT_TRUE(menu != NULL); |
| 1623 ASSERT_TRUE(menu->GetSubmenu()->IsShowing()); | 1623 ASSERT_TRUE(menu->GetSubmenu()->IsShowing()); |
| 1624 | 1624 |
| 1625 menu->GetMenuController()->CancelAll(); | 1625 menu->GetMenuController()->CancelAll(); |
| 1626 | 1626 |
| 1627 Done(); | 1627 Done(); |
| 1628 } | 1628 } |
| 1629 }; | 1629 }; |
| 1630 | 1630 |
| 1631 VIEW_TEST(BookmarkBarViewTest19, SiblingMenu) | 1631 VIEW_TEST(BookmarkBarViewTest19, SiblingMenu) |
| OLD | NEW |