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

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

Issue 102913002: [Mac] User manager should show up as a standalone window. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 7 years 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/user_manager_mac_unittest.mm
diff --git a/chrome/browser/ui/cocoa/browser/user_manager_mac_unittest.mm b/chrome/browser/ui/cocoa/browser/user_manager_mac_unittest.mm
new file mode 100644
index 0000000000000000000000000000000000000000..cf8e3fda993ee79898f71238af3a4810f5507002
--- /dev/null
+++ b/chrome/browser/ui/cocoa/browser/user_manager_mac_unittest.mm
@@ -0,0 +1,47 @@
+// Copyright 2013 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.
+
+#include "chrome/browser/ui/cocoa/user_manager_mac.h"
+
+#include "base/run_loop.h"
+#include "chrome/browser/profiles/profile_window.h"
+#include "chrome/test/base/browser_with_test_window_test.h"
+#include "chrome/test/base/testing_browser_process.h"
+#include "chrome/test/base/testing_profile_manager.h"
+
+class UserManagerMacTest : public BrowserWithTestWindowTest {
+ public:
+ UserManagerMacTest()
+ : testing_profile_manager_(TestingBrowserProcess::GetGlobal()) {
+ }
+
+ virtual void SetUp() OVERRIDE {
+ BrowserWithTestWindowTest::SetUp();
+ ASSERT_TRUE(testing_profile_manager_.SetUp());
+ // Pre-load the guest profile so we don't have to wait for the User Manager
+ // to asynchronously create it.
+ testing_profile_manager_.CreateGuestProfile();
+ }
+
+ virtual void TearDown() OVERRIDE {
+ testing_profile_manager_.DeleteGuestProfile();
+ TestingBrowserProcess::GetGlobal()->SetProfileManager(NULL);
+ base::RunLoop().RunUntilIdle();
+ BrowserWithTestWindowTest::TearDown();
+ }
+
+ private:
+ TestingProfileManager testing_profile_manager_;
+
+ DISALLOW_COPY_AND_ASSIGN(UserManagerMacTest);
+};
+
+TEST_F(UserManagerMacTest, ShowUserManager) {
+ EXPECT_FALSE(UserManagerMac::IsShowing());
+ UserManagerMac::Show(base::FilePath());
+ EXPECT_TRUE(UserManagerMac::IsShowing());
+
+ UserManagerMac::Hide();
+ EXPECT_FALSE(UserManagerMac::IsShowing());
+}
« no previous file with comments | « chrome/browser/ui/cocoa/browser/profile_chooser_controller.mm ('k') | chrome/browser/ui/cocoa/task_manager_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698