OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <cryptohi.h> | 5 #include <cryptohi.h> |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "chrome/browser/chromeos/platform_keys/platform_keys_service.h" |
| 10 #include "chrome/browser/chromeos/platform_keys/platform_keys_service_factory.h" |
9 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" | 11 #include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h" |
10 #include "chrome/browser/extensions/extension_apitest.h" | 12 #include "chrome/browser/extensions/extension_apitest.h" |
11 #include "chrome/browser/net/nss_context.h" | 13 #include "chrome/browser/net/nss_context.h" |
12 #include "chromeos/chromeos_switches.h" | 14 #include "chromeos/chromeos_switches.h" |
13 #include "chromeos/login/user_names.h" | 15 #include "chromeos/login/user_names.h" |
14 #include "components/policy/core/browser/browser_policy_connector.h" | 16 #include "components/policy/core/browser/browser_policy_connector.h" |
15 #include "components/policy/core/common/policy_map.h" | 17 #include "components/policy/core/common/policy_map.h" |
16 #include "content/public/browser/notification_service.h" | 18 #include "content/public/browser/notification_service.h" |
17 #include "content/public/common/content_switches.h" | 19 #include "content/public/common/content_switches.h" |
18 #include "content/public/test/test_utils.h" | 20 #include "content/public/test/test_utils.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 ExtensionApiTest::SetUpOnMainThread(); | 92 ExtensionApiTest::SetUpOnMainThread(); |
91 | 93 |
92 { | 94 { |
93 base::RunLoop loop; | 95 base::RunLoop loop; |
94 GetNSSCertDatabaseForProfile( | 96 GetNSSCertDatabaseForProfile( |
95 browser()->profile(), | 97 browser()->profile(), |
96 base::Bind(&PlatformKeysTest::SetupTestCerts, base::Unretained(this), | 98 base::Bind(&PlatformKeysTest::SetupTestCerts, base::Unretained(this), |
97 loop.QuitClosure())); | 99 loop.QuitClosure())); |
98 loop.Run(); | 100 loop.Run(); |
99 } | 101 } |
| 102 |
| 103 chromeos::PlatformKeysServiceFactory::GetForBrowserContext( |
| 104 browser()->profile())->DisablePermissionCheckForTesting(); |
100 } | 105 } |
101 | 106 |
102 void TearDownOnMainThread() override { | 107 void TearDownOnMainThread() override { |
103 ExtensionApiTest::TearDownOnMainThread(); | 108 ExtensionApiTest::TearDownOnMainThread(); |
104 | 109 |
105 base::RunLoop loop; | 110 base::RunLoop loop; |
106 content::BrowserThread::PostTask( | 111 content::BrowserThread::PostTask( |
107 content::BrowserThread::IO, FROM_HERE, | 112 content::BrowserThread::IO, FROM_HERE, |
108 base::Bind(&PlatformKeysTest::TearDownTestSystemSlotOnIO, | 113 base::Bind(&PlatformKeysTest::TearDownTestSystemSlotOnIO, |
109 base::Unretained(this), loop.QuitClosure())); | 114 base::Unretained(this), loop.QuitClosure())); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 << message_; | 175 << message_; |
171 } | 176 } |
172 | 177 |
173 INSTANTIATE_TEST_CASE_P( | 178 INSTANTIATE_TEST_CASE_P( |
174 CheckSystemTokenAvailability, | 179 CheckSystemTokenAvailability, |
175 PlatformKeysTest, | 180 PlatformKeysTest, |
176 ::testing::Values( | 181 ::testing::Values( |
177 Params(DEVICE_STATUS_ENROLLED, USER_AFFILIATION_ENROLLED_DOMAIN), | 182 Params(DEVICE_STATUS_ENROLLED, USER_AFFILIATION_ENROLLED_DOMAIN), |
178 Params(DEVICE_STATUS_ENROLLED, USER_AFFILIATION_UNRELATED), | 183 Params(DEVICE_STATUS_ENROLLED, USER_AFFILIATION_UNRELATED), |
179 Params(DEVICE_STATUS_NOT_ENROLLED, USER_AFFILIATION_UNRELATED))); | 184 Params(DEVICE_STATUS_NOT_ENROLLED, USER_AFFILIATION_UNRELATED))); |
OLD | NEW |