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

Unified Diff: chrome/browser/ui/cocoa/browser/avatar_button_controller_unittest.mm

Issue 8172011: [Mac] Properly show and hide the avatar button for the one-profile case. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test Created 9 years, 2 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
Index: chrome/browser/ui/cocoa/browser/avatar_button_controller_unittest.mm
diff --git a/chrome/browser/ui/cocoa/browser/avatar_button_controller_unittest.mm b/chrome/browser/ui/cocoa/browser/avatar_button_controller_unittest.mm
new file mode 100644
index 0000000000000000000000000000000000000000..61abbb9645a1c1df1ffc51454d40b4e3e73ea98d
--- /dev/null
+++ b/chrome/browser/ui/cocoa/browser/avatar_button_controller_unittest.mm
@@ -0,0 +1,44 @@
+// 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.
+
+#import "chrome/browser/ui/cocoa/browser/avatar_button_controller.h"
+
+#include "base/memory/scoped_nsobject.h"
+#include "chrome/browser/ui/cocoa/cocoa_profile_test.h"
+#include "chrome/browser/ui/cocoa/run_loop_testing.h"
+
+class AvatarButtonControllerTest : public CocoaProfileTest {
+ public:
+ virtual void SetUp() {
+ CocoaProfileTest::SetUp();
+ ASSERT_TRUE(browser());
+ browser()->InitBrowserWindow();
+
+ controller_.reset(
+ [[AvatarButtonController alloc] initWithBrowser:browser()]);
+ [[controller_ view] setHidden:YES];
+ }
+
+ NSButton* button() { return [controller_ buttonView]; }
+
+ private:
+ scoped_nsobject<AvatarButtonController> controller_;
+};
+
+TEST_F(AvatarButtonControllerTest, AddRemoveProfiles) {
+ EXPECT_TRUE([button() isHidden]);
+
+ testing_profile_manager()->CreateTestingProfile("one");
+
+ EXPECT_FALSE([button() isHidden]);
+
+ testing_profile_manager()->CreateTestingProfile("two");
+ EXPECT_FALSE([button() isHidden]);
+
+ testing_profile_manager()->DeleteTestingProfile("one");
+ EXPECT_FALSE([button() isHidden]);
+
+ testing_profile_manager()->DeleteTestingProfile("two");
+ EXPECT_TRUE([button() isHidden]);
+}
« no previous file with comments | « chrome/browser/ui/cocoa/browser/avatar_button_controller.mm ('k') | chrome/browser/ui/cocoa/browser_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698