Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/browser/command_updater.h" | 5 #include "chrome/browser/command_updater.h" |
| 6 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
| 7 | 7 |
| 8 class TestingCommandHandlerMock | 8 class TestingCommandHandlerMock |
| 9 : public CommandUpdater::CommandUpdaterDelegate { | 9 : public CommandUpdater::CommandUpdaterDelegate { |
| 10 public: | 10 public: |
| 11 virtual void ExecuteCommand(int id) { | 11 virtual void ExecuteCommandWithDisposition(int id, WindowOpenDisposition) { |
|
sky
2012/03/12 20:59:19
OVERRIDE
altimofeev
2012/03/13 15:38:05
Done.
| |
| 12 EXPECT_EQ(1, id); | 12 EXPECT_EQ(1, id); |
| 13 } | 13 } |
| 14 }; | 14 }; |
| 15 | 15 |
| 16 class CommandUpdaterTest : public testing::Test { | 16 class CommandUpdaterTest : public testing::Test { |
| 17 }; | 17 }; |
| 18 | 18 |
| 19 class TestingCommandObserverMock : public CommandUpdater::CommandObserver { | 19 class TestingCommandObserverMock : public CommandUpdater::CommandObserver { |
| 20 public: | 20 public: |
| 21 TestingCommandObserverMock() : enabled_(true) {} | 21 TestingCommandObserverMock() : enabled_(true) {} |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 98 | 98 |
| 99 // Remove one observer and update the command. Check the states, which | 99 // Remove one observer and update the command. Check the states, which |
| 100 // should be different. | 100 // should be different. |
| 101 command_updater.RemoveCommandObserver(&observer_remove); | 101 command_updater.RemoveCommandObserver(&observer_remove); |
| 102 command_updater.UpdateCommandEnabled(1, false); | 102 command_updater.UpdateCommandEnabled(1, false); |
| 103 command_updater.UpdateCommandEnabled(2, false); | 103 command_updater.UpdateCommandEnabled(2, false); |
| 104 command_updater.UpdateCommandEnabled(3, false); | 104 command_updater.UpdateCommandEnabled(3, false); |
| 105 EXPECT_TRUE(observer_remove.enabled()); | 105 EXPECT_TRUE(observer_remove.enabled()); |
| 106 EXPECT_FALSE(observer_keep.enabled()); | 106 EXPECT_FALSE(observer_keep.enabled()); |
| 107 } | 107 } |
| OLD | NEW |