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

Unified Diff: chrome/test/menu_model_test.h

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/base/testing_profile.cc ('k') | chrome/test/menu_model_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/menu_model_test.h
===================================================================
--- chrome/test/menu_model_test.h (revision 94974)
+++ chrome/test/menu_model_test.h (working copy)
@@ -1,50 +0,0 @@
-// Copyright (c) 2010 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.
-
-#ifndef CHROME_TEST_MENU_MODEL_TEST_H_
-#define CHROME_TEST_MENU_MODEL_TEST_H_
-#pragma once
-
-#include "ui/base/models/accelerator.h"
-#include "ui/base/models/simple_menu_model.h"
-
-// A mix-in class to be used in addition to something that derrives from
-// testing::Test to provide some extra functionality for testing menu models.
-class MenuModelTest {
- public:
- MenuModelTest() { }
- virtual ~MenuModelTest() { }
-
- protected:
- // A menu delegate that counts the number of times certain things are called
- // to make sure things are hooked up properly.
- class Delegate : public ui::SimpleMenuModel::Delegate,
- public ui::AcceleratorProvider {
- public:
- Delegate() : execute_count_(0), enable_count_(0) { }
-
- virtual bool IsCommandIdChecked(int command_id) const { return false; }
- virtual bool IsCommandIdEnabled(int command_id) const {
- ++enable_count_;
- return true;
- }
- virtual bool GetAcceleratorForCommandId(
- int command_id,
- ui::Accelerator* accelerator) { return false; }
- virtual void ExecuteCommand(int command_id) { ++execute_count_; }
-
- int execute_count_;
- mutable int enable_count_;
- };
-
- // 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 CountEnabledExecutable(ui::MenuModel* model, int* count);
-
- Delegate delegate_;
-};
-
-#endif // CHROME_TEST_MENU_MODEL_TEST_H_
« no previous file with comments | « chrome/test/base/testing_profile.cc ('k') | chrome/test/menu_model_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698