Commit fa830869 authored by Scott Violet's avatar Scott Violet Committed by Commit Bot

minor style cleanup in app_menu_model_unittest

BUG=none
TEST=none

Change-Id: Ie15c8408db968af61e1ee341c82af646dcf5ba2a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2116788
Commit-Queue: Scott Violet <sky@chromium.org>
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#752669}
parent 3d4009f3
...@@ -165,24 +165,25 @@ TEST_F(AppMenuModelTest, Basics) { ...@@ -165,24 +165,25 @@ TEST_F(AppMenuModelTest, Basics) {
// Choose something from the bookmark submenu and make sure it makes it back // Choose something from the bookmark submenu and make sure it makes it back
// to the delegate as well. // to the delegate as well.
int bookmarksModelIndex = -1; int bookmarks_model_index = -1;
for (int i = 0; i < itemCount; ++i) { for (int i = 0; i < itemCount; ++i) {
if (model.GetTypeAt(i) == ui::MenuModel::TYPE_SUBMENU) { if (model.GetTypeAt(i) == ui::MenuModel::TYPE_SUBMENU) {
// The bookmarks submenu comes after the Tabs and Downloads items. // The bookmarks submenu comes after the Tabs and Downloads items.
bookmarksModelIndex = i + 2; bookmarks_model_index = i + 2;
break; break;
} }
} }
EXPECT_GT(bookmarksModelIndex, -1); EXPECT_GT(bookmarks_model_index, -1);
ui::MenuModel* bookmarksModel = model.GetSubmenuModelAt(bookmarksModelIndex); ui::MenuModel* bookmarks_model =
EXPECT_TRUE(bookmarksModel); model.GetSubmenuModelAt(bookmarks_model_index);
EXPECT_TRUE(bookmarks_model);
// The bookmarks model may be empty until we tell it we're going to show it. // The bookmarks model may be empty until we tell it we're going to show it.
bookmarksModel->MenuWillShow(); bookmarks_model->MenuWillShow();
EXPECT_GT(bookmarksModel->GetItemCount(), 1); EXPECT_GT(bookmarks_model->GetItemCount(), 1);
// Bookmark manager item. // Bookmark manager item.
bookmarksModel->ActivatedAt(4); bookmarks_model->ActivatedAt(4);
EXPECT_TRUE(bookmarksModel->IsEnabledAt(4)); EXPECT_TRUE(bookmarks_model->IsEnabledAt(4));
EXPECT_EQ(model.execute_count_, 1); EXPECT_EQ(model.execute_count_, 1);
EXPECT_EQ(model.enable_count_, 1); EXPECT_EQ(model.enable_count_, 1);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment