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

Side by Side Diff: views/controls/menu/menu_model_adapter_unittest.cc

Issue 7044016: Replace ButtonDropDown menu implementation (Menu2) with MenuItemView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: One last little style fix. Created 9 years, 6 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
« no previous file with comments | « views/controls/menu/menu_model_adapter.cc ('k') | views/view_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/base/l10n/l10n_util.h" 5 #include "ui/base/l10n/l10n_util.h"
6 #include "ui/base/models/menu_model.h" 6 #include "ui/base/models/menu_model.h"
7 #include "ui/base/models/menu_model_delegate.h" 7 #include "ui/base/models/menu_model_delegate.h"
8 #include "views/controls/menu/menu_item_view.h" 8 #include "views/controls/menu/menu_item_view.h"
9 #include "views/controls/menu/menu_model_adapter.h" 9 #include "views/controls/menu/menu_model_adapter.h"
10 #include "views/controls/menu/submenu_view.h" 10 #include "views/controls/menu/submenu_view.h"
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 case ui::MenuModel::TYPE_SUBMENU: 286 case ui::MenuModel::TYPE_SUBMENU:
287 EXPECT_EQ(views::MenuItemView::SUBMENU, item->GetType()); 287 EXPECT_EQ(views::MenuItemView::SUBMENU, item->GetType());
288 break; 288 break;
289 } 289 }
290 290
291 // Check activation. 291 // Check activation.
292 static_cast<views::MenuDelegate*>(&delegate)->ExecuteCommand(id); 292 static_cast<views::MenuDelegate*>(&delegate)->ExecuteCommand(id);
293 EXPECT_EQ(i + kFirstItemIndex, submodel->last_activation()); 293 EXPECT_EQ(i + kFirstItemIndex, submodel->last_activation());
294 submodel->set_last_activation(-1); 294 submodel->set_last_activation(-1);
295 } 295 }
296
297 // Check that selecting the root item is safe. The MenuModel does
298 // not care about the root so MenuModelAdapter should do nothing
299 // (not hit the NOTREACHED check) when the root is selected.
300 static_cast<views::MenuDelegate*>(&delegate)->SelectionChanged(menu.get());
296 } 301 }
297 302
298 } // namespace views 303 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/menu/menu_model_adapter.cc ('k') | views/view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698