Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc

Issue 24733003: Update defaults for InstantExtended. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 14 matching lines...) Expand all
25 #include "chrome/test/base/interactive_test_utils.h" 25 #include "chrome/test/base/interactive_test_utils.h"
26 #include "chrome/test/base/scoped_testing_local_state.h" 26 #include "chrome/test/base/scoped_testing_local_state.h"
27 #include "chrome/test/base/test_browser_window.h" 27 #include "chrome/test/base/test_browser_window.h"
28 #include "chrome/test/base/testing_browser_process.h" 28 #include "chrome/test/base/testing_browser_process.h"
29 #include "chrome/test/base/testing_profile.h" 29 #include "chrome/test/base/testing_profile.h"
30 #include "chrome/test/base/ui_test_utils.h" 30 #include "chrome/test/base/ui_test_utils.h"
31 #include "chrome/test/base/view_event_test_base.h" 31 #include "chrome/test/base/view_event_test_base.h"
32 #include "content/public/browser/notification_service.h" 32 #include "content/public/browser/notification_service.h"
33 #include "content/public/browser/page_navigator.h" 33 #include "content/public/browser/page_navigator.h"
34 #include "content/public/test/test_browser_thread.h" 34 #include "content/public/test/test_browser_thread.h"
35 #include "content/public/test/test_renderer_host.h"
35 #include "grit/generated_resources.h" 36 #include "grit/generated_resources.h"
36 #include "ui/base/accessibility/accessibility_types.h" 37 #include "ui/base/accessibility/accessibility_types.h"
37 #include "ui/base/clipboard/clipboard.h" 38 #include "ui/base/clipboard/clipboard.h"
38 #include "ui/base/test/ui_controls.h" 39 #include "ui/base/test/ui_controls.h"
39 #include "ui/events/keycodes/keyboard_codes.h" 40 #include "ui/events/keycodes/keyboard_codes.h"
40 #include "ui/views/controls/button/menu_button.h" 41 #include "ui/views/controls/button/menu_button.h"
41 #include "ui/views/controls/button/text_button.h" 42 #include "ui/views/controls/button/text_button.h"
42 #include "ui/views/controls/menu/menu_controller.h" 43 #include "ui/views/controls/menu/menu_controller.h"
43 #include "ui/views/controls/menu/menu_item_view.h" 44 #include "ui/views/controls/menu/menu_item_view.h"
44 #include "ui/views/controls/menu/submenu_view.h" 45 #include "ui/views/controls/menu/submenu_view.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 return bb_view_->GetBookmarkButton(view_index); 200 return bb_view_->GetBookmarkButton(view_index);
200 } 201 }
201 202
202 // See comment above class description for what this does. 203 // See comment above class description for what this does.
203 virtual bool CreateBigMenu() { return false; } 204 virtual bool CreateBigMenu() { return false; }
204 205
205 BookmarkModel* model_; 206 BookmarkModel* model_;
206 scoped_ptr<BookmarkBarView> bb_view_; 207 scoped_ptr<BookmarkBarView> bb_view_;
207 TestingPageNavigator navigator_; 208 TestingPageNavigator navigator_;
208 209
210 // The existence of this object enables tests via RenderViewHostTester.
211 content::RenderViewHostTestEnabler rvh_test_enabler_;
212
209 private: 213 private:
210 void AddTestData(bool big_menu) { 214 void AddTestData(bool big_menu) {
211 const BookmarkNode* bb_node = model_->bookmark_bar_node(); 215 const BookmarkNode* bb_node = model_->bookmark_bar_node();
212 std::string test_base = "file:///c:/tmp/"; 216 std::string test_base = "file:///c:/tmp/";
213 const BookmarkNode* f1 = model_->AddFolder(bb_node, 0, ASCIIToUTF16("F1")); 217 const BookmarkNode* f1 = model_->AddFolder(bb_node, 0, ASCIIToUTF16("F1"));
214 model_->AddURL(f1, 0, ASCIIToUTF16("f1a"), GURL(test_base + "f1a")); 218 model_->AddURL(f1, 0, ASCIIToUTF16("f1a"), GURL(test_base + "f1a"));
215 const BookmarkNode* f11 = model_->AddFolder(f1, 1, ASCIIToUTF16("F11")); 219 const BookmarkNode* f11 = model_->AddFolder(f1, 1, ASCIIToUTF16("F11"));
216 model_->AddURL(f11, 0, ASCIIToUTF16("f11a"), GURL(test_base + "f11a")); 220 model_->AddURL(f11, 0, ASCIIToUTF16("f11a"), GURL(test_base + "f11a"));
217 if (big_menu) { 221 if (big_menu) {
218 for (int i = 1; i <= 100; ++i) { 222 for (int i = 1; i <= 100; ++i) {
(...skipping 1556 matching lines...) Expand 10 before | Expand all | Expand 10 after
1775 EXPECT_TRUE(bb_view_->GetContextMenu() == NULL); 1779 EXPECT_TRUE(bb_view_->GetContextMenu() == NULL);
1776 EXPECT_TRUE(bb_view_->GetMenu() == NULL); 1780 EXPECT_TRUE(bb_view_->GetMenu() == NULL);
1777 1781
1778 Done(); 1782 Done();
1779 } 1783 }
1780 1784
1781 ContextMenuNotificationObserver observer_; 1785 ContextMenuNotificationObserver observer_;
1782 }; 1786 };
1783 1787
1784 VIEW_TEST(BookmarkBarViewTest21, ContextMenusForEmptyFolder) 1788 VIEW_TEST(BookmarkBarViewTest21, ContextMenusForEmptyFolder)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698