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

Unified Diff: chrome/browser/ui/cocoa/toolbar/toolbar_controller_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, 6 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/browser/ui/cocoa/toolbar/toolbar_controller.mm ('k') | chrome/browser/ui/fullscreen_exit_bubble.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/toolbar/toolbar_controller_unittest.mm
===================================================================
--- chrome/browser/ui/cocoa/toolbar/toolbar_controller_unittest.mm (revision 144460)
+++ chrome/browser/ui/cocoa/toolbar/toolbar_controller_unittest.mm (working copy)
@@ -6,6 +6,9 @@
#import "base/memory/scoped_nsobject.h"
#include "chrome/app/chrome_command_ids.h"
+#include "chrome/browser/command_updater.h"
+#include "chrome/browser/ui/browser_command_controller.h"
+#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/cocoa/cocoa_profile_test.h"
#import "chrome/browser/ui/cocoa/gradient_button_cell.h"
#import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h"
@@ -50,7 +53,8 @@
CocoaProfileTest::SetUp();
ASSERT_TRUE(browser());
- CommandUpdater* updater = browser()->command_updater();
+ CommandUpdater* updater =
+ browser()->command_controller()->command_updater();
// The default state for the commands is true, set a couple to false to
// ensure they get picked up correct on initialization
updater->UpdateCommandEnabled(IDC_BACK, false);
@@ -58,7 +62,7 @@
resizeDelegate_.reset([[ViewResizerPong alloc] init]);
bar_.reset(
[[ToolbarController alloc] initWithModel:browser()->toolbar_model()
- commands:browser()->command_updater()
+ commands:browser()->command_controller()->command_updater()
profile:profile()
browser:browser()
resizeDelegate:resizeDelegate_.get()]);
@@ -88,7 +92,7 @@
// Test the initial state that everything is sync'd up
TEST_F(ToolbarControllerTest, InitialState) {
- CommandUpdater* updater = browser()->command_updater();
+ CommandUpdater* updater = browser()->command_controller()->command_updater();
CompareState(updater, [bar_ toolbarViews]);
}
@@ -131,11 +135,11 @@
// Make some changes to the enabled state of a few of the buttons and ensure
// that we're still in sync.
TEST_F(ToolbarControllerTest, UpdateEnabledState) {
- CommandUpdater* updater = browser()->command_updater();
- EXPECT_FALSE(updater->IsCommandEnabled(IDC_BACK));
- EXPECT_FALSE(updater->IsCommandEnabled(IDC_FORWARD));
- updater->UpdateCommandEnabled(IDC_BACK, true);
- updater->UpdateCommandEnabled(IDC_FORWARD, true);
+ EXPECT_FALSE(chrome::IsCommandEnabled(browser(), IDC_BACK));
+ EXPECT_FALSE(chrome::IsCommandEnabled(browser(), IDC_FORWARD));
+ chrome::UpdateCommandEnabled(browser(), IDC_BACK, true);
+ chrome::UpdateCommandEnabled(browser(), IDC_FORWARD, true);
+ CommandUpdater* updater = browser()->command_controller()->command_updater();
CompareState(updater, [bar_ toolbarViews]);
}
« no previous file with comments | « chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm ('k') | chrome/browser/ui/fullscreen_exit_bubble.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698