| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chrome_notification_types.h" | 5 #include "chrome/browser/chrome_notification_types.h" |
| 6 #include "chrome/browser/extensions/api/screenlock_private/screenlock_private_ap
i.h" | 6 #include "chrome/browser/extensions/api/screenlock_private/screenlock_private_ap
i.h" |
| 7 #include "chrome/browser/extensions/extension_apitest.h" | 7 #include "chrome/browser/extensions/extension_apitest.h" |
| 8 #include "chrome/browser/signin/signin_manager_factory.h" | 8 #include "chrome/browser/signin/signin_manager_factory.h" |
| 9 #include "components/signin/core/browser/signin_manager.h" | 9 #include "components/signin/core/browser/signin_manager.h" |
| 10 #include "components/signin/core/common/profile_management_switches.h" | 10 #include "components/signin/core/common/signin_switches.h" |
| 11 #include "content/public/browser/notification_service.h" | 11 #include "content/public/browser/notification_service.h" |
| 12 #include "extensions/browser/api/test/test_api.h" | 12 #include "extensions/browser/api/test/test_api.h" |
| 13 | 13 |
| 14 namespace extensions { | 14 namespace extensions { |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 const char kTestUser[] = "testuser@gmail.com"; | 18 const char kTestUser[] = "testuser@gmail.com"; |
| 19 const char kAttemptClickAuthMessage[] = "attemptClickAuth"; | 19 const char kAttemptClickAuthMessage[] = "attemptClickAuth"; |
| 20 | 20 |
| 21 } // namespace | 21 } // namespace |
| 22 | 22 |
| 23 class ScreenlockPrivateApiTest : public ExtensionApiTest, | 23 class ScreenlockPrivateApiTest : public ExtensionApiTest, |
| 24 public content::NotificationObserver { | 24 public content::NotificationObserver { |
| 25 public: | 25 public: |
| 26 ScreenlockPrivateApiTest() {} | 26 ScreenlockPrivateApiTest() {} |
| 27 | 27 |
| 28 virtual ~ScreenlockPrivateApiTest() {} | 28 virtual ~ScreenlockPrivateApiTest() {} |
| 29 | 29 |
| 30 // ExtensionApiTest | 30 // ExtensionApiTest |
| 31 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 31 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 32 ExtensionApiTest::SetUpCommandLine(command_line); | 32 ExtensionApiTest::SetUpCommandLine(command_line); |
| 33 | 33 |
| 34 #if !defined(OS_CHROMEOS) | 34 #if !defined(OS_CHROMEOS) |
| 35 // New profile management needs to be on for non-ChromeOS lock. | 35 // New profile management needs to be on for non-ChromeOS lock. |
| 36 switches::EnableNewProfileManagementForTesting(command_line); | 36 command_line->AppendSwitch(switches::kNewProfileManagement); |
| 37 #endif | 37 #endif |
| 38 } | 38 } |
| 39 | 39 |
| 40 virtual void SetUpOnMainThread() OVERRIDE { | 40 virtual void SetUpOnMainThread() OVERRIDE { |
| 41 SigninManagerFactory::GetForProfile(profile()) | 41 SigninManagerFactory::GetForProfile(profile()) |
| 42 ->SetAuthenticatedUsername(kTestUser); | 42 ->SetAuthenticatedUsername(kTestUser); |
| 43 ExtensionApiTest::SetUpOnMainThread(); | 43 ExtensionApiTest::SetUpOnMainThread(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 protected: | 46 protected: |
| (...skipping 28 matching lines...) Expand all Loading... |
| 75 | 75 |
| 76 IN_PROC_BROWSER_TEST_F(ScreenlockPrivateApiTest, LockUnlock) { | 76 IN_PROC_BROWSER_TEST_F(ScreenlockPrivateApiTest, LockUnlock) { |
| 77 ASSERT_TRUE(RunExtensionTest("screenlock_private/lock_unlock")) << message_; | 77 ASSERT_TRUE(RunExtensionTest("screenlock_private/lock_unlock")) << message_; |
| 78 } | 78 } |
| 79 | 79 |
| 80 IN_PROC_BROWSER_TEST_F(ScreenlockPrivateApiTest, AuthType) { | 80 IN_PROC_BROWSER_TEST_F(ScreenlockPrivateApiTest, AuthType) { |
| 81 ASSERT_TRUE(RunExtensionTest("screenlock_private/auth_type")) << message_; | 81 ASSERT_TRUE(RunExtensionTest("screenlock_private/auth_type")) << message_; |
| 82 } | 82 } |
| 83 | 83 |
| 84 } // namespace extensions | 84 } // namespace extensions |
| OLD | NEW |