| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 extensions::NOTIFICATION_EXTENSION_TEST_MESSAGE, | 73 extensions::NOTIFICATION_EXTENSION_TEST_MESSAGE, |
| 74 content::NotificationService::AllSources()); | 74 content::NotificationService::AllSources()); |
| 75 ExtensionApiTest::RunTestOnMainThreadLoop(); | 75 ExtensionApiTest::RunTestOnMainThreadLoop(); |
| 76 registrar_.RemoveAll(); | 76 registrar_.RemoveAll(); |
| 77 } | 77 } |
| 78 | 78 |
| 79 // content::NotificationObserver override: | 79 // content::NotificationObserver override: |
| 80 void Observe(int type, | 80 void Observe(int type, |
| 81 const content::NotificationSource& source, | 81 const content::NotificationSource& source, |
| 82 const content::NotificationDetails& details) override { | 82 const content::NotificationDetails& details) override { |
| 83 const std::string& content = *content::Details<std::string>(details).ptr(); | 83 const std::string& message = |
| 84 if (content == kAttemptClickAuthMessage) { | 84 content::Details<std::pair<std::string, bool*>>(details).ptr()->first; |
| 85 if (message == kAttemptClickAuthMessage) { |
| 85 proximity_auth::ScreenlockBridge::Get()->lock_handler()->SetAuthType( | 86 proximity_auth::ScreenlockBridge::Get()->lock_handler()->SetAuthType( |
| 86 test_account_id_, | 87 test_account_id_, |
| 87 proximity_auth::ScreenlockBridge::LockHandler::USER_CLICK, | 88 proximity_auth::ScreenlockBridge::LockHandler::USER_CLICK, |
| 88 base::string16()); | 89 base::string16()); |
| 89 EasyUnlockService::Get(profile())->AttemptAuth(test_account_id_); | 90 EasyUnlockService::Get(profile())->AttemptAuth(test_account_id_); |
| 90 } | 91 } |
| 91 } | 92 } |
| 92 | 93 |
| 93 // Loads |extension_name| and waits for a pass / fail notification. | 94 // Loads |extension_name| and waits for a pass / fail notification. |
| 94 void RunTest(const std::string& extension_name) { | 95 void RunTest(const std::string& extension_name) { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 117 RunTest("screenlock_private/lock_unlock"); | 118 RunTest("screenlock_private/lock_unlock"); |
| 118 } | 119 } |
| 119 | 120 |
| 120 IN_PROC_BROWSER_TEST_F(ScreenlockPrivateApiTest, AuthType) { | 121 IN_PROC_BROWSER_TEST_F(ScreenlockPrivateApiTest, AuthType) { |
| 121 RunTest("screenlock_private/auth_type"); | 122 RunTest("screenlock_private/auth_type"); |
| 122 } | 123 } |
| 123 | 124 |
| 124 #endif // defined(OS_CHROMEOS) | 125 #endif // defined(OS_CHROMEOS) |
| 125 | 126 |
| 126 } // namespace extensions | 127 } // namespace extensions |
| OLD | NEW |