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

Side by Side Diff: chrome/browser/extensions/api/screenlock_private/screenlock_private_apitest.cc

Issue 1096293003: Move screenlock_bridge to components/proximity_auth (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 8 months 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 unified diff | Download patch
OLDNEW
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 "base/strings/utf_string_conversions.h" 6 #include "base/strings/utf_string_conversions.h"
7 #include "chrome/browser/browser_process.h" 7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/extensions/api/screenlock_private/screenlock_private_ap i.h" 8 #include "chrome/browser/extensions/api/screenlock_private/screenlock_private_ap i.h"
9 #include "chrome/browser/extensions/extension_apitest.h" 9 #include "chrome/browser/extensions/extension_apitest.h"
10 #include "chrome/browser/profiles/profile_info_cache.h" 10 #include "chrome/browser/profiles/profile_info_cache.h"
11 #include "chrome/browser/profiles/profile_manager.h" 11 #include "chrome/browser/profiles/profile_manager.h"
12 #include "chrome/browser/signin/easy_unlock_service.h" 12 #include "chrome/browser/signin/easy_unlock_service.h"
13 #include "chrome/browser/signin/easy_unlock_util.h"
13 #include "chrome/browser/signin/signin_manager_factory.h" 14 #include "chrome/browser/signin/signin_manager_factory.h"
14 #include "components/signin/core/browser/signin_manager.h" 15 #include "components/signin/core/browser/signin_manager.h"
15 #include "components/signin/core/common/profile_management_switches.h" 16 #include "components/signin/core/common/profile_management_switches.h"
16 #include "content/public/browser/notification_service.h" 17 #include "content/public/browser/notification_service.h"
17 #include "extensions/browser/api/test/test_api.h" 18 #include "extensions/browser/api/test/test_api.h"
18 #include "extensions/browser/notification_types.h" 19 #include "extensions/browser/notification_types.h"
19 #include "extensions/common/switches.h" 20 #include "extensions/common/switches.h"
20 21
21 namespace extensions { 22 namespace extensions {
22 23
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 ExtensionApiTest::RunTestOnMainThreadLoop(); 69 ExtensionApiTest::RunTestOnMainThreadLoop();
69 registrar_.RemoveAll(); 70 registrar_.RemoveAll();
70 } 71 }
71 72
72 // content::NotificationObserver override: 73 // content::NotificationObserver override:
73 void Observe(int type, 74 void Observe(int type,
74 const content::NotificationSource& source, 75 const content::NotificationSource& source,
75 const content::NotificationDetails& details) override { 76 const content::NotificationDetails& details) override {
76 const std::string& content = *content::Details<std::string>(details).ptr(); 77 const std::string& content = *content::Details<std::string>(details).ptr();
77 if (content == kAttemptClickAuthMessage) { 78 if (content == kAttemptClickAuthMessage) {
78 ScreenlockBridge::Get()->lock_handler()->SetAuthType( 79 GetScreenlockBridgeInstance()->lock_handler()->SetAuthType(
79 kTestUser, 80 kTestUser, proximity_auth::ScreenlockBridge::LockHandler::USER_CLICK,
80 ScreenlockBridge::LockHandler::USER_CLICK,
81 base::string16()); 81 base::string16());
82 EasyUnlockService::Get(profile())->AttemptAuth(kTestUser); 82 EasyUnlockService::Get(profile())->AttemptAuth(kTestUser);
83 } 83 }
84 } 84 }
85 85
86 // Loads |extension_name| and waits for a pass / fail notification. 86 // Loads |extension_name| and waits for a pass / fail notification.
87 void RunTest(const std::string& extension_name) { 87 void RunTest(const std::string& extension_name) {
88 ASSERT_TRUE(RunComponentExtensionTest(extension_name)) << message_; 88 ASSERT_TRUE(RunComponentExtensionTest(extension_name)) << message_;
89 } 89 }
90 90
(...skipping 14 matching lines...) Expand all
105 105
106 IN_PROC_BROWSER_TEST_F(ScreenlockPrivateApiTest, MAYBE_LockUnlock) { 106 IN_PROC_BROWSER_TEST_F(ScreenlockPrivateApiTest, MAYBE_LockUnlock) {
107 RunTest("screenlock_private/lock_unlock"); 107 RunTest("screenlock_private/lock_unlock");
108 } 108 }
109 109
110 IN_PROC_BROWSER_TEST_F(ScreenlockPrivateApiTest, MAYBE_AuthType) { 110 IN_PROC_BROWSER_TEST_F(ScreenlockPrivateApiTest, MAYBE_AuthType) {
111 RunTest("screenlock_private/auth_type"); 111 RunTest("screenlock_private/auth_type");
112 } 112 }
113 113
114 } // namespace extensions 114 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698