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

Unified Diff: chrome/test/menu_model_test.cc

Issue 7537033: Move more files from chrome/test to chrome/test/base, part #5 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/menu_model_test.h ('k') | chrome/test/out_of_proc_test_runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/menu_model_test.cc
===================================================================
--- chrome/test/menu_model_test.cc (revision 94974)
+++ chrome/test/menu_model_test.cc (working copy)
@@ -1,32 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/test/menu_model_test.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-// Recursively checks the enabled state and executes a command on every item
-// that's not a separator or a submenu parent item. The returned count should
-// match the number of times the delegate is called to ensure every item works.
-void MenuModelTest::CountEnabledExecutable(ui::MenuModel* model,
- int* count) {
- for (int i = 0; i < model->GetItemCount(); ++i) {
- ui::MenuModel::ItemType type = model->GetTypeAt(i);
- switch (type) {
- case ui::MenuModel::TYPE_SEPARATOR:
- continue;
- case ui::MenuModel::TYPE_SUBMENU:
- CountEnabledExecutable(model->GetSubmenuModelAt(i), count);
- break;
- case ui::MenuModel::TYPE_COMMAND:
- case ui::MenuModel::TYPE_CHECK:
- case ui::MenuModel::TYPE_RADIO:
- model->IsEnabledAt(i); // Check if it's enabled (ignore answer).
- model->ActivatedAt(i); // Execute it.
- (*count)++; // Increment the count of executable items seen.
- break;
- default:
- FAIL(); // Ensure every case is tested.
- }
- }
-}
« no previous file with comments | « chrome/test/menu_model_test.h ('k') | chrome/test/out_of_proc_test_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698