OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/extensions/api/enterprise_platform_keys_private/enterpr
ise_platform_keys_private_api.h" | 5 #include "chrome/browser/extensions/api/enterprise_platform_keys_private/enterpr
ise_platform_keys_private_api.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
12 #include "base/threading/thread_task_runner_handle.h" | 12 #include "base/threading/thread_task_runner_handle.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" | 14 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" |
15 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" | 15 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" |
16 #include "chrome/browser/chromeos/policy/stub_enterprise_install_attributes.h" | |
17 #include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h" | 16 #include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h" |
| 17 #include "chrome/browser/chromeos/settings/stub_install_attributes.h" |
18 #include "chrome/browser/extensions/extension_function_test_utils.h" | 18 #include "chrome/browser/extensions/extension_function_test_utils.h" |
19 #include "chrome/browser/signin/signin_manager_factory.h" | 19 #include "chrome/browser/signin/signin_manager_factory.h" |
20 #include "chrome/browser/ui/browser.h" | 20 #include "chrome/browser/ui/browser.h" |
21 #include "chrome/common/pref_names.h" | 21 #include "chrome/common/pref_names.h" |
22 #include "chrome/test/base/browser_with_test_window_test.h" | 22 #include "chrome/test/base/browser_with_test_window_test.h" |
23 #include "chrome/test/base/testing_browser_process.h" | 23 #include "chrome/test/base/testing_browser_process.h" |
24 #include "chrome/test/base/testing_profile_manager.h" | 24 #include "chrome/test/base/testing_profile_manager.h" |
25 #include "chromeos/attestation/attestation_constants.h" | 25 #include "chromeos/attestation/attestation_constants.h" |
26 #include "chromeos/attestation/mock_attestation_flow.h" | 26 #include "chromeos/attestation/mock_attestation_flow.h" |
27 #include "chromeos/cryptohome/async_method_caller.h" | 27 #include "chromeos/cryptohome/async_method_caller.h" |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 virtual void SetAuthenticatedUser() { | 212 virtual void SetAuthenticatedUser() { |
213 SigninManagerFactory::GetForProfile(browser()->profile())-> | 213 SigninManagerFactory::GetForProfile(browser()->profile())-> |
214 SetAuthenticatedAccountInfo("12345", kUserEmail); | 214 SetAuthenticatedAccountInfo("12345", kUserEmail); |
215 } | 215 } |
216 | 216 |
217 NiceMock<chromeos::MockCryptohomeClient> mock_cryptohome_client_; | 217 NiceMock<chromeos::MockCryptohomeClient> mock_cryptohome_client_; |
218 NiceMock<cryptohome::MockAsyncMethodCaller> mock_async_method_caller_; | 218 NiceMock<cryptohome::MockAsyncMethodCaller> mock_async_method_caller_; |
219 NiceMock<chromeos::attestation::MockAttestationFlow> mock_attestation_flow_; | 219 NiceMock<chromeos::attestation::MockAttestationFlow> mock_attestation_flow_; |
220 chromeos::ScopedCrosSettingsTestHelper settings_helper_; | 220 chromeos::ScopedCrosSettingsTestHelper settings_helper_; |
221 scoped_refptr<extensions::Extension> extension_; | 221 scoped_refptr<extensions::Extension> extension_; |
222 policy::StubEnterpriseInstallAttributes stub_install_attributes_; | 222 chromeos::StubInstallAttributes stub_install_attributes_; |
223 TestingProfileManager profile_manager_; | 223 TestingProfileManager profile_manager_; |
224 // fake_user_manager_ is owned by user_manager_enabler_. | 224 // fake_user_manager_ is owned by user_manager_enabler_. |
225 chromeos::FakeChromeUserManager* fake_user_manager_; | 225 chromeos::FakeChromeUserManager* fake_user_manager_; |
226 chromeos::ScopedUserManagerEnabler user_manager_enabler_; | 226 chromeos::ScopedUserManagerEnabler user_manager_enabler_; |
227 PrefService* prefs_ = nullptr; | 227 PrefService* prefs_ = nullptr; |
228 }; | 228 }; |
229 | 229 |
230 class EPKPChallengeMachineKeyTest : public EPKPChallengeKeyTestBase { | 230 class EPKPChallengeMachineKeyTest : public EPKPChallengeKeyTestBase { |
231 protected: | 231 protected: |
232 static const char kArgs[]; | 232 static const char kArgs[]; |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 AccountId::FromUserEmailGaiaId("test@chromium.com", "12345"); | 577 AccountId::FromUserEmailGaiaId("test@chromium.com", "12345"); |
578 }; | 578 }; |
579 | 579 |
580 TEST_F(EPKPChallengeUserKeyUnmanagedUserTest, UserNotManaged) { | 580 TEST_F(EPKPChallengeUserKeyUnmanagedUserTest, UserNotManaged) { |
581 EXPECT_EQ(EPKPChallengeKeyBase::kUserNotManaged, | 581 EXPECT_EQ(EPKPChallengeKeyBase::kUserNotManaged, |
582 utils::RunFunctionAndReturnError(func_.get(), kArgs, browser())); | 582 utils::RunFunctionAndReturnError(func_.get(), kArgs, browser())); |
583 } | 583 } |
584 | 584 |
585 } // namespace | 585 } // namespace |
586 } // namespace extensions | 586 } // namespace extensions |
OLD | NEW |