OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <map> | 5 #include <map> |
6 | 6 |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
10 #include "ui/base/clipboard/clipboard.h" | 10 #include "ui/base/clipboard/clipboard.h" |
(...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1225 MOCK_CONST_METHOD0(GetItemCount, int()); | 1225 MOCK_CONST_METHOD0(GetItemCount, int()); |
1226 MOCK_CONST_METHOD1(GetTypeAt, ItemType(int index)); | 1226 MOCK_CONST_METHOD1(GetTypeAt, ItemType(int index)); |
1227 MOCK_CONST_METHOD1(GetCommandIdAt, int(int index)); | 1227 MOCK_CONST_METHOD1(GetCommandIdAt, int(int index)); |
1228 MOCK_CONST_METHOD1(GetLabelAt, string16(int index)); | 1228 MOCK_CONST_METHOD1(GetLabelAt, string16(int index)); |
1229 MOCK_CONST_METHOD1(IsItemDynamicAt, bool(int index)); | 1229 MOCK_CONST_METHOD1(IsItemDynamicAt, bool(int index)); |
1230 MOCK_CONST_METHOD1(GetLabelFontAt, const gfx::Font* (int index)); | 1230 MOCK_CONST_METHOD1(GetLabelFontAt, const gfx::Font* (int index)); |
1231 MOCK_CONST_METHOD2(GetAcceleratorAt, bool(int index, | 1231 MOCK_CONST_METHOD2(GetAcceleratorAt, bool(int index, |
1232 ui::Accelerator* accelerator)); | 1232 ui::Accelerator* accelerator)); |
1233 MOCK_CONST_METHOD1(IsItemCheckedAt, bool(int index)); | 1233 MOCK_CONST_METHOD1(IsItemCheckedAt, bool(int index)); |
1234 MOCK_CONST_METHOD1(GetGroupIdAt, int(int index)); | 1234 MOCK_CONST_METHOD1(GetGroupIdAt, int(int index)); |
1235 MOCK_CONST_METHOD2(GetIconAt, bool(int index, SkBitmap* icon)); | 1235 MOCK_METHOD2(GetIconAt, bool(int index, SkBitmap* icon)); |
1236 MOCK_CONST_METHOD1(GetButtonMenuItemAt, ButtonMenuItemModel*(int index)); | 1236 MOCK_CONST_METHOD1(GetButtonMenuItemAt, ButtonMenuItemModel*(int index)); |
1237 MOCK_CONST_METHOD1(IsEnabledAt, bool(int index)); | 1237 MOCK_CONST_METHOD1(IsEnabledAt, bool(int index)); |
1238 MOCK_CONST_METHOD1(IsVisibleAt, bool(int index)); | 1238 MOCK_CONST_METHOD1(IsVisibleAt, bool(int index)); |
1239 MOCK_CONST_METHOD1(GetSubmenuModelAt, MenuModel*(int index)); | 1239 MOCK_CONST_METHOD1(GetSubmenuModelAt, MenuModel*(int index)); |
1240 MOCK_METHOD1(HighlightChangedTo, void(int index)); | 1240 MOCK_METHOD1(HighlightChangedTo, void(int index)); |
1241 MOCK_METHOD1(ActivatedAt, void(int index)); | 1241 MOCK_METHOD1(ActivatedAt, void(int index)); |
1242 MOCK_METHOD2(ActivatedAtWithDisposition, void(int index, | 1242 MOCK_METHOD2(ActivatedAtWithDisposition, void(int index, |
1243 int disposition)); | 1243 int disposition)); |
1244 MOCK_METHOD0(MenuWillShow, void()); | 1244 MOCK_METHOD0(MenuWillShow, void()); |
1245 MOCK_METHOD0(MenuClosed, void()); | 1245 MOCK_METHOD0(MenuClosed, void()); |
| 1246 MOCK_METHOD1(SetMenuModelDelegate, void(MenuModelDelegate* delegate)); |
1246 MOCK_METHOD3(GetModelAndIndexForCommandId, bool(int command_id, | 1247 MOCK_METHOD3(GetModelAndIndexForCommandId, bool(int command_id, |
1247 MenuModel** model, int* index)); | 1248 MenuModel** model, int* index)); |
1248 }; | 1249 }; |
1249 } | 1250 } |
1250 | 1251 |
1251 class TestDialog : public DialogDelegate, public ButtonListener { | 1252 class TestDialog : public DialogDelegate, public ButtonListener { |
1252 public: | 1253 public: |
1253 explicit TestDialog(ui::MockMenuModel* mock_menu_model) | 1254 explicit TestDialog(ui::MockMenuModel* mock_menu_model) |
1254 : contents_(NULL), | 1255 : contents_(NULL), |
1255 button1_(NULL), | 1256 button1_(NULL), |
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1932 top_view->scheduled_paint_rects_.clear(); | 1933 top_view->scheduled_paint_rects_.clear(); |
1933 child_view->SetBounds(30, 30, 20, 20); | 1934 child_view->SetBounds(30, 30, 20, 20); |
1934 EXPECT_EQ(2U, top_view->scheduled_paint_rects_.size()); | 1935 EXPECT_EQ(2U, top_view->scheduled_paint_rects_.size()); |
1935 | 1936 |
1936 // There should be 2 rects, spanning from (10, 10) to (50, 50). | 1937 // There should be 2 rects, spanning from (10, 10) to (50, 50). |
1937 gfx::Rect paint_rect = | 1938 gfx::Rect paint_rect = |
1938 top_view->scheduled_paint_rects_[0].Union( | 1939 top_view->scheduled_paint_rects_[0].Union( |
1939 top_view->scheduled_paint_rects_[1]); | 1940 top_view->scheduled_paint_rects_[1]); |
1940 EXPECT_EQ(gfx::Rect(10, 10, 40, 40), paint_rect); | 1941 EXPECT_EQ(gfx::Rect(10, 10, 40, 40), paint_rect); |
1941 } | 1942 } |
OLD | NEW |