| 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 #include <stddef.h> | 6 #include <stddef.h> |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 command_line->AppendSwitchASCII(::switches::kGoogleApisUrl, | 241 command_line->AppendSwitchASCII(::switches::kGoogleApisUrl, |
| 242 gaia_url.spec()); | 242 gaia_url.spec()); |
| 243 | 243 |
| 244 fake_gaia_.Initialize(); | 244 fake_gaia_.Initialize(); |
| 245 fake_gaia_.set_issue_oauth_code_cookie(true); | 245 fake_gaia_.set_issue_oauth_code_cookie(true); |
| 246 } | 246 } |
| 247 | 247 |
| 248 void SetUpInProcessBrowserTestFixture() override { | 248 void SetUpInProcessBrowserTestFixture() override { |
| 249 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); | 249 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); |
| 250 | 250 |
| 251 host_resolver()->AddRule("*", "127.0.0.1"); | |
| 252 | |
| 253 chromeos::FakeSessionManagerClient* fake_session_manager_client = | 251 chromeos::FakeSessionManagerClient* fake_session_manager_client = |
| 254 new chromeos::FakeSessionManagerClient; | 252 new chromeos::FakeSessionManagerClient; |
| 255 chromeos::DBusThreadManager::GetSetterForTesting()->SetSessionManagerClient( | 253 chromeos::DBusThreadManager::GetSetterForTesting()->SetSessionManagerClient( |
| 256 std::unique_ptr<chromeos::SessionManagerClient>( | 254 std::unique_ptr<chromeos::SessionManagerClient>( |
| 257 fake_session_manager_client)); | 255 fake_session_manager_client)); |
| 258 | 256 |
| 259 if (GetParam().device_status_ == DEVICE_STATUS_ENROLLED) { | 257 if (GetParam().device_status_ == DEVICE_STATUS_ENROLLED) { |
| 260 std::set<std::string> device_affiliation_ids; | 258 std::set<std::string> device_affiliation_ids; |
| 261 device_affiliation_ids.insert(kAffiliationID); | 259 device_affiliation_ids.insert(kAffiliationID); |
| 262 policy::affiliation_test_helper::SetDeviceAffiliationID( | 260 policy::affiliation_test_helper::SetDeviceAffiliationID( |
| (...skipping 13 matching lines...) Expand all Loading... |
| 276 | 274 |
| 277 | 275 |
| 278 EXPECT_CALL(policy_provider_, IsInitializationComplete(testing::_)) | 276 EXPECT_CALL(policy_provider_, IsInitializationComplete(testing::_)) |
| 279 .WillRepeatedly(testing::Return(true)); | 277 .WillRepeatedly(testing::Return(true)); |
| 280 policy_provider_.SetAutoRefresh(); | 278 policy_provider_.SetAutoRefresh(); |
| 281 policy::BrowserPolicyConnector::SetPolicyProviderForTesting( | 279 policy::BrowserPolicyConnector::SetPolicyProviderForTesting( |
| 282 &policy_provider_); | 280 &policy_provider_); |
| 283 } | 281 } |
| 284 | 282 |
| 285 void SetUpOnMainThread() override { | 283 void SetUpOnMainThread() override { |
| 284 host_resolver()->AddRule("*", "127.0.0.1"); |
| 286 // Start the accept thread as the sandbox host process has already been | 285 // Start the accept thread as the sandbox host process has already been |
| 287 // spawned. | 286 // spawned. |
| 288 embedded_test_server()->StartAcceptingConnections(); | 287 embedded_test_server()->StartAcceptingConnections(); |
| 289 | 288 |
| 290 FakeGaia::AccessTokenInfo token_info; | 289 FakeGaia::AccessTokenInfo token_info; |
| 291 token_info.scopes.insert(GaiaConstants::kDeviceManagementServiceOAuth); | 290 token_info.scopes.insert(GaiaConstants::kDeviceManagementServiceOAuth); |
| 292 token_info.scopes.insert(GaiaConstants::kOAuthWrapBridgeUserInfoScope); | 291 token_info.scopes.insert(GaiaConstants::kOAuthWrapBridgeUserInfoScope); |
| 293 token_info.audience = GaiaUrls::GetInstance()->oauth2_chrome_client_id(); | 292 token_info.audience = GaiaUrls::GetInstance()->oauth2_chrome_client_id(); |
| 294 token_info.token = kTestUserinfoToken; | 293 token_info.token = kTestUserinfoToken; |
| 295 token_info.email = kEnterpriseUser; | 294 token_info.email = kEnterpriseUser; |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 extensions::ExtensionRegistry* registry = | 507 extensions::ExtensionRegistry* registry = |
| 509 extensions::ExtensionRegistry::Get(profile()); | 508 extensions::ExtensionRegistry::Get(profile()); |
| 510 const extensions::Extension* extension = | 509 const extensions::Extension* extension = |
| 511 GetExtensionByPath(registry->enabled_extensions(), extension_path); | 510 GetExtensionByPath(registry->enabled_extensions(), extension_path); |
| 512 ASSERT_FALSE(extension->install_warnings().empty()); | 511 ASSERT_FALSE(extension->install_warnings().empty()); |
| 513 EXPECT_EQ( | 512 EXPECT_EQ( |
| 514 "'enterprise.platformKeys' is not allowed for specified install " | 513 "'enterprise.platformKeys' is not allowed for specified install " |
| 515 "location.", | 514 "location.", |
| 516 extension->install_warnings()[0].message); | 515 extension->install_warnings()[0].message); |
| 517 } | 516 } |
| OLD | NEW |