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

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

Issue 6452011: Rework tree APIs to reflect Google style and more const-correctness.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/string_number_conversions.h" 5 #include "base/string_number_conversions.h"
6 #include "base/utf_string_conversions.h" 6 #include "base/utf_string_conversions.h"
7 #include "chrome/app/chrome_command_ids.h" 7 #include "chrome/app/chrome_command_ids.h"
8 #include "chrome/browser/automation/ui_controls.h" 8 #include "chrome/browser/automation/ui_controls.h"
9 #include "chrome/browser/bookmarks/bookmark_model.h" 9 #include "chrome/browser/bookmarks/bookmark_model.h"
10 #include "chrome/browser/bookmarks/bookmark_utils.h" 10 #include "chrome/browser/bookmarks/bookmark_utils.h"
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 views::MenuItemView* menu = bb_view_->GetMenu(); 813 views::MenuItemView* menu = bb_view_->GetMenu();
814 ASSERT_TRUE(menu != NULL); 814 ASSERT_TRUE(menu != NULL);
815 ASSERT_TRUE(menu->GetSubmenu()->IsShowing()); 815 ASSERT_TRUE(menu->GetSubmenu()->IsShowing());
816 816
817 first_menu_ = menu->GetSubmenu()->GetMenuItemAt(0); 817 first_menu_ = menu->GetSubmenu()->GetMenuItemAt(0);
818 gfx::Point menu_loc; 818 gfx::Point menu_loc;
819 views::View::ConvertPointToScreen(first_menu_, &menu_loc); 819 views::View::ConvertPointToScreen(first_menu_, &menu_loc);
820 start_y_ = menu_loc.y(); 820 start_y_ = menu_loc.y();
821 821
822 // Move the mouse over the scroll button. 822 // Move the mouse over the scroll button.
823 views::View* scroll_container = menu->GetSubmenu()->GetParent(); 823 views::View* scroll_container = menu->GetSubmenu()->parent();
824 ASSERT_TRUE(scroll_container != NULL); 824 ASSERT_TRUE(scroll_container != NULL);
825 scroll_container = scroll_container->GetParent(); 825 scroll_container = scroll_container->parent();
826 ASSERT_TRUE(scroll_container != NULL); 826 ASSERT_TRUE(scroll_container != NULL);
827 views::View* scroll_down_button = scroll_container->GetChildViewAt(1); 827 views::View* scroll_down_button = scroll_container->GetChildViewAt(1);
828 ASSERT_TRUE(scroll_down_button); 828 ASSERT_TRUE(scroll_down_button);
829 gfx::Point loc(scroll_down_button->width() / 2, 829 gfx::Point loc(scroll_down_button->width() / 2,
830 scroll_down_button->height() / 2); 830 scroll_down_button->height() / 2);
831 views::View::ConvertPointToScreen(scroll_down_button, &loc); 831 views::View::ConvertPointToScreen(scroll_down_button, &loc);
832 832
833 // On linux, the sending one location isn't enough. 833 // On linux, the sending one location isn't enough.
834 ui_controls::SendMouseMove(loc.x() - 1 , loc.y() - 1); 834 ui_controls::SendMouseMove(loc.x() - 1 , loc.y() - 1);
835 ui_controls::SendMouseMoveNotifyWhenDone( 835 ui_controls::SendMouseMoveNotifyWhenDone(
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
1165 void Step3() { 1165 void Step3() {
1166 // Make sure the context menu is showing. 1166 // Make sure the context menu is showing.
1167 views::MenuItemView* menu = bb_view_->GetContextMenu(); 1167 views::MenuItemView* menu = bb_view_->GetContextMenu();
1168 ASSERT_TRUE(menu != NULL); 1168 ASSERT_TRUE(menu != NULL);
1169 ASSERT_TRUE(menu->GetSubmenu()); 1169 ASSERT_TRUE(menu->GetSubmenu());
1170 ASSERT_TRUE(menu->GetSubmenu()->IsShowing()); 1170 ASSERT_TRUE(menu->GetSubmenu()->IsShowing());
1171 1171
1172 // Find the first separator. 1172 // Find the first separator.
1173 views::SubmenuView* submenu = menu->GetSubmenu(); 1173 views::SubmenuView* submenu = menu->GetSubmenu();
1174 views::View* separator_view = NULL; 1174 views::View* separator_view = NULL;
1175 for (int i = 0; i < submenu->GetChildViewCount(); ++i) { 1175 for (int i = 0; i < submenu->child_count(); ++i) {
1176 if (submenu->GetChildViewAt(i)->GetID() != 1176 if (submenu->GetChildViewAt(i)->GetID() !=
1177 views::MenuItemView::kMenuItemViewID) { 1177 views::MenuItemView::kMenuItemViewID) {
1178 separator_view = submenu->GetChildViewAt(i); 1178 separator_view = submenu->GetChildViewAt(i);
1179 break; 1179 break;
1180 } 1180 }
1181 } 1181 }
1182 ASSERT_TRUE(separator_view); 1182 ASSERT_TRUE(separator_view);
1183 1183
1184 // Click on the separator. Clicking on the separator shouldn't visually 1184 // Click on the separator. Clicking on the separator shouldn't visually
1185 // change anything. 1185 // change anything.
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
1355 ASSERT_TRUE(button->state() == views::CustomButton::BS_PUSHED); 1355 ASSERT_TRUE(button->state() == views::CustomButton::BS_PUSHED);
1356 1356
1357 // Close the window. 1357 // Close the window.
1358 window_->Close(); 1358 window_->Close();
1359 window_ = NULL; 1359 window_ = NULL;
1360 } 1360 }
1361 }; 1361 };
1362 1362
1363 // Disabled, http://crbug.com/64303. 1363 // Disabled, http://crbug.com/64303.
1364 VIEW_TEST(BookmarkBarViewTest16, DISABLED_DeleteMenu) 1364 VIEW_TEST(BookmarkBarViewTest16, DISABLED_DeleteMenu)
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/bookmark_bar_view.cc ('k') | chrome/browser/ui/views/bookmark_editor_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698