| 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 "base/strings/string16.h" | 5 #include "base/strings/string16.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/easy_unlock_service.h" | 8 #include "chrome/browser/signin/easy_unlock_service.h" |
| 9 #include "chrome/browser/signin/signin_manager_factory.h" | 9 #include "chrome/browser/signin/signin_manager_factory.h" |
| 10 #include "components/signin/core/browser/signin_manager.h" | 10 #include "components/signin/core/browser/signin_manager.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 const std::string& content = *content::Details<std::string>(details).ptr(); | 66 const std::string& content = *content::Details<std::string>(details).ptr(); |
| 67 if (content == kAttemptClickAuthMessage) { | 67 if (content == kAttemptClickAuthMessage) { |
| 68 ScreenlockBridge::Get()->lock_handler()->SetAuthType( | 68 ScreenlockBridge::Get()->lock_handler()->SetAuthType( |
| 69 kTestUser, | 69 kTestUser, |
| 70 ScreenlockBridge::LockHandler::USER_CLICK, | 70 ScreenlockBridge::LockHandler::USER_CLICK, |
| 71 base::string16()); | 71 base::string16()); |
| 72 EasyUnlockService::Get(profile())->AttemptAuth(kTestUser); | 72 EasyUnlockService::Get(profile())->AttemptAuth(kTestUser); |
| 73 } | 73 } |
| 74 } | 74 } |
| 75 | 75 |
| 76 // Loads |extension_name| as appropriate for the platform and waits for a | 76 // Loads |extension_name| and waits for a pass / fail notification. |
| 77 // pass / fail notification. | |
| 78 void RunTest(const std::string& extension_name) { | 77 void RunTest(const std::string& extension_name) { |
| 79 #if defined(OS_CHROMEOS) | |
| 80 ASSERT_TRUE(RunComponentExtensionTest(extension_name)) << message_; | 78 ASSERT_TRUE(RunComponentExtensionTest(extension_name)) << message_; |
| 81 #else | |
| 82 ASSERT_TRUE(RunExtensionTest(extension_name)) << message_; | |
| 83 #endif | |
| 84 } | 79 } |
| 85 | 80 |
| 86 private: | 81 private: |
| 87 content::NotificationRegistrar registrar_; | 82 content::NotificationRegistrar registrar_; |
| 88 | 83 |
| 89 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateApiTest); | 84 DISALLOW_COPY_AND_ASSIGN(ScreenlockPrivateApiTest); |
| 90 }; | 85 }; |
| 91 | 86 |
| 92 IN_PROC_BROWSER_TEST_F(ScreenlockPrivateApiTest, LockUnlock) { | 87 IN_PROC_BROWSER_TEST_F(ScreenlockPrivateApiTest, LockUnlock) { |
| 93 RunTest("screenlock_private/lock_unlock"); | 88 RunTest("screenlock_private/lock_unlock"); |
| 94 } | 89 } |
| 95 | 90 |
| 96 IN_PROC_BROWSER_TEST_F(ScreenlockPrivateApiTest, AuthType) { | 91 IN_PROC_BROWSER_TEST_F(ScreenlockPrivateApiTest, AuthType) { |
| 97 RunTest("screenlock_private/auth_type"); | 92 RunTest("screenlock_private/auth_type"); |
| 98 } | 93 } |
| 99 | 94 |
| 100 } // namespace extensions | 95 } // namespace extensions |
| OLD | NEW |