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

Side by Side Diff: chrome/browser/ui/cocoa/command_observer_bridge_unittest.mm

Issue 10677009: Move command handling and updating off Browser and onto a helper object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
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 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "base/memory/scoped_nsobject.h" 7 #include "base/memory/scoped_nsobject.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "chrome/browser/command_updater.h"
9 #import "chrome/browser/ui/cocoa/command_observer_bridge.h" 10 #import "chrome/browser/ui/cocoa/command_observer_bridge.h"
10 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
11 #include "testing/platform_test.h" 12 #include "testing/platform_test.h"
12 13
13 // Implements the callback interface. Records the last command id and 14 // Implements the callback interface. Records the last command id and
14 // enabled state it has received so it can be queried by the tests to see 15 // enabled state it has received so it can be queried by the tests to see
15 // if we got a notification or not. 16 // if we got a notification or not.
16 @interface CommandTestObserver : NSObject<CommandObserverProtocol> { 17 @interface CommandTestObserver : NSObject<CommandObserverProtocol> {
17 @private 18 @private
18 int lastCommand_; // id of last received state change 19 int lastCommand_; // id of last received state change
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 81
81 // Change something we're not watching and make sure the last state hasn't 82 // Change something we're not watching and make sure the last state hasn't
82 // changed. 83 // changed.
83 updater_->UpdateCommandEnabled(3, false); 84 updater_->UpdateCommandEnabled(3, false);
84 EXPECT_EQ([observer_ lastCommand], 1); 85 EXPECT_EQ([observer_ lastCommand], 1);
85 EXPECT_NE([observer_ lastCommand], 3); 86 EXPECT_NE([observer_ lastCommand], 3);
86 EXPECT_EQ([observer_ lastState], true); 87 EXPECT_EQ([observer_ lastState], true);
87 } 88 }
88 89
89 } // namespace 90 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/command_observer_bridge.mm ('k') | chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698