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/chromeos/login/lock/screen_locker.h" | 6 #include "chrome/browser/chromeos/login/lock/screen_locker.h" |
7 #include "chrome/browser/chromeos/login/users/user.h" | 7 #include "chrome/browser/chromeos/login/users/user.h" |
8 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 | 52 |
53 // content::NotificationObserver override: | 53 // content::NotificationObserver override: |
54 virtual void Observe(int type, | 54 virtual void Observe(int type, |
55 const content::NotificationSource& source, | 55 const content::NotificationSource& source, |
56 const content::NotificationDetails& details) OVERRIDE { | 56 const content::NotificationDetails& details) OVERRIDE { |
57 const std::string& content = *content::Details<std::string>(details).ptr(); | 57 const std::string& content = *content::Details<std::string>(details).ptr(); |
58 if (content == kAttemptClickAuthMessage) { | 58 if (content == kAttemptClickAuthMessage) { |
59 chromeos::ScreenLocker* locker = GetScreenLocker(); | 59 chromeos::ScreenLocker* locker = GetScreenLocker(); |
60 const chromeos::UserList& users = locker->users(); | 60 const chromeos::UserList& users = locker->users(); |
61 EXPECT_GE(1u, users.size()); | 61 EXPECT_GE(1u, users.size()); |
62 GetScreenLocker()->Authenticate( | 62 GetScreenLocker()->Authenticate(chromeos::UserContext(users[0]->email())); |
63 chromeos::UserContext(users[0]->email(), "", "")); | |
64 } | 63 } |
65 } | 64 } |
66 | 65 |
67 content::NotificationRegistrar registrar_; | 66 content::NotificationRegistrar registrar_; |
68 }; | 67 }; |
69 | 68 |
70 IN_PROC_BROWSER_TEST_F(ScreenlockPrivateApiTest, LockUnlock) { | 69 IN_PROC_BROWSER_TEST_F(ScreenlockPrivateApiTest, LockUnlock) { |
71 ASSERT_TRUE(RunExtensionTest("screenlock_private/lock_unlock")) << message_; | 70 ASSERT_TRUE(RunExtensionTest("screenlock_private/lock_unlock")) << message_; |
72 } | 71 } |
73 | 72 |
74 IN_PROC_BROWSER_TEST_F(ScreenlockPrivateApiTest, AuthType) { | 73 IN_PROC_BROWSER_TEST_F(ScreenlockPrivateApiTest, AuthType) { |
75 ASSERT_TRUE(RunExtensionTest("screenlock_private/auth_type")) << message_; | 74 ASSERT_TRUE(RunExtensionTest("screenlock_private/auth_type")) << message_; |
76 } | 75 } |
77 | 76 |
78 } // namespace extensions | 77 } // namespace extensions |
OLD | NEW |