| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/keyboard_codes.h" | 5 #include "base/keyboard_codes.h" |
| 6 #include "base/string_util.h" | 6 #include "base/string_util.h" |
| 7 #include "chrome/browser/automation/ui_controls.h" | 7 #include "chrome/browser/automation/ui_controls.h" |
| 8 #include "chrome/browser/bookmarks/bookmark_model.h" | 8 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 9 #include "chrome/browser/bookmarks/bookmark_utils.h" | 9 #include "chrome/browser/bookmarks/bookmark_utils.h" |
| 10 #include "chrome/browser/profile.h" | 10 #include "chrome/browser/profile.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 | 78 |
| 79 virtual void SetUp() { | 79 virtual void SetUp() { |
| 80 views::MenuItemView::allow_task_nesting_during_run_ = true; | 80 views::MenuItemView::allow_task_nesting_during_run_ = true; |
| 81 BookmarkBarView::testing_ = true; | 81 BookmarkBarView::testing_ = true; |
| 82 | 82 |
| 83 profile_.reset(new TestingProfile()); | 83 profile_.reset(new TestingProfile()); |
| 84 profile_->set_has_history_service(true); | 84 profile_->set_has_history_service(true); |
| 85 profile_->CreateBookmarkModel(true); | 85 profile_->CreateBookmarkModel(true); |
| 86 profile_->BlockUntilBookmarkModelLoaded(); | 86 profile_->BlockUntilBookmarkModelLoaded(); |
| 87 profile_->GetPrefs()->SetBoolean(prefs::kShowBookmarkBar, true); | 87 profile_->GetPrefs()->SetBoolean(prefs::kShowBookmarkBar, true); |
| 88 profile_->CreateProfileSyncService(); |
| 88 | 89 |
| 89 model_ = profile_->GetBookmarkModel(); | 90 model_ = profile_->GetBookmarkModel(); |
| 90 model_->ClearStore(); | 91 model_->ClearStore(); |
| 91 | 92 |
| 92 bb_view_ = new BookmarkBarView(profile_.get(), NULL); | 93 bb_view_ = new BookmarkBarView(profile_.get(), NULL); |
| 93 bb_view_->SetPageNavigator(&navigator_); | 94 bb_view_->SetPageNavigator(&navigator_); |
| 94 | 95 |
| 95 AddTestData(CreateBigMenu()); | 96 AddTestData(CreateBigMenu()); |
| 96 | 97 |
| 97 // Calculate the preferred size so that one button doesn't fit, which | 98 // Calculate the preferred size so that one button doesn't fit, which |
| (...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1093 NULL, base::VKEY_ESCAPE, false, false, false, | 1094 NULL, base::VKEY_ESCAPE, false, false, false, |
| 1094 CreateEventTask(this, &BookmarkBarViewTest14::Step3)); | 1095 CreateEventTask(this, &BookmarkBarViewTest14::Step3)); |
| 1095 } | 1096 } |
| 1096 | 1097 |
| 1097 void Step3() { | 1098 void Step3() { |
| 1098 Done(); | 1099 Done(); |
| 1099 } | 1100 } |
| 1100 }; | 1101 }; |
| 1101 | 1102 |
| 1102 VIEW_TEST(BookmarkBarViewTest14, ContextMenus2) | 1103 VIEW_TEST(BookmarkBarViewTest14, ContextMenus2) |
| OLD | NEW |