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" | |
6 #include "chrome/browser/extensions/api/screenlock_private/screenlock_private_ap
i.h" | 5 #include "chrome/browser/extensions/api/screenlock_private/screenlock_private_ap
i.h" |
7 #include "chrome/browser/extensions/extension_apitest.h" | 6 #include "chrome/browser/extensions/extension_apitest.h" |
8 #include "chrome/browser/signin/signin_manager_factory.h" | 7 #include "chrome/browser/signin/signin_manager_factory.h" |
9 #include "components/signin/core/browser/signin_manager.h" | 8 #include "components/signin/core/browser/signin_manager.h" |
10 #include "components/signin/core/common/profile_management_switches.h" | 9 #include "components/signin/core/common/profile_management_switches.h" |
11 #include "content/public/browser/notification_service.h" | 10 #include "content/public/browser/notification_service.h" |
12 #include "extensions/browser/api/test/test_api.h" | 11 #include "extensions/browser/api/test/test_api.h" |
| 12 #include "extensions/browser/notification_types.h" |
13 #include "extensions/common/switches.h" | 13 #include "extensions/common/switches.h" |
14 | 14 |
15 namespace extensions { | 15 namespace extensions { |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
19 const char kAttemptClickAuthMessage[] = "attemptClickAuth"; | 19 const char kAttemptClickAuthMessage[] = "attemptClickAuth"; |
20 const char kTestExtensionId[] = "lkegkdgachcnekllcdfkijonogckdnjo"; | 20 const char kTestExtensionId[] = "lkegkdgachcnekllcdfkijonogckdnjo"; |
21 const char kTestUser[] = "testuser@gmail.com"; | 21 const char kTestUser[] = "testuser@gmail.com"; |
22 | 22 |
(...skipping 21 matching lines...) Expand all Loading... |
44 virtual void SetUpOnMainThread() OVERRIDE { | 44 virtual void SetUpOnMainThread() OVERRIDE { |
45 SigninManagerFactory::GetForProfile(profile()) | 45 SigninManagerFactory::GetForProfile(profile()) |
46 ->SetAuthenticatedUsername(kTestUser); | 46 ->SetAuthenticatedUsername(kTestUser); |
47 ExtensionApiTest::SetUpOnMainThread(); | 47 ExtensionApiTest::SetUpOnMainThread(); |
48 } | 48 } |
49 | 49 |
50 protected: | 50 protected: |
51 // ExtensionApiTest override: | 51 // ExtensionApiTest override: |
52 virtual void RunTestOnMainThreadLoop() OVERRIDE { | 52 virtual void RunTestOnMainThreadLoop() OVERRIDE { |
53 registrar_.Add(this, | 53 registrar_.Add(this, |
54 chrome::NOTIFICATION_EXTENSION_TEST_MESSAGE, | 54 extensions::NOTIFICATION_EXTENSION_TEST_MESSAGE, |
55 content::NotificationService::AllSources()); | 55 content::NotificationService::AllSources()); |
56 ExtensionApiTest::RunTestOnMainThreadLoop(); | 56 ExtensionApiTest::RunTestOnMainThreadLoop(); |
57 registrar_.RemoveAll(); | 57 registrar_.RemoveAll(); |
58 } | 58 } |
59 | 59 |
60 // content::NotificationObserver override: | 60 // content::NotificationObserver override: |
61 virtual void Observe(int type, | 61 virtual void Observe(int type, |
62 const content::NotificationSource& source, | 62 const content::NotificationSource& source, |
63 const content::NotificationDetails& details) OVERRIDE { | 63 const content::NotificationDetails& details) OVERRIDE { |
64 const std::string& content = *content::Details<std::string>(details).ptr(); | 64 const std::string& content = *content::Details<std::string>(details).ptr(); |
(...skipping 24 matching lines...) Expand all Loading... |
89 | 89 |
90 IN_PROC_BROWSER_TEST_F(ScreenlockPrivateApiTest, LockUnlock) { | 90 IN_PROC_BROWSER_TEST_F(ScreenlockPrivateApiTest, LockUnlock) { |
91 RunTest("screenlock_private/lock_unlock"); | 91 RunTest("screenlock_private/lock_unlock"); |
92 } | 92 } |
93 | 93 |
94 IN_PROC_BROWSER_TEST_F(ScreenlockPrivateApiTest, AuthType) { | 94 IN_PROC_BROWSER_TEST_F(ScreenlockPrivateApiTest, AuthType) { |
95 RunTest("screenlock_private/auth_type"); | 95 RunTest("screenlock_private/auth_type"); |
96 } | 96 } |
97 | 97 |
98 } // namespace extensions | 98 } // namespace extensions |
OLD | NEW |