| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/scoped_temp_dir.h" | 9 #include "base/scoped_temp_dir.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 EXPECT_CALL(delegate, HandleRegisterResponse(_)).Times(AnyNumber()); | 69 EXPECT_CALL(delegate, HandleRegisterResponse(_)).Times(AnyNumber()); |
| 70 backend_->ProcessRegisterRequest("gaia_auth_token", "oauth_token", | 70 backend_->ProcessRegisterRequest("gaia_auth_token", "oauth_token", |
| 71 "testid", request, &delegate); | 71 "testid", request, &delegate); |
| 72 } | 72 } |
| 73 | 73 |
| 74 void ProcessPolicyRequest() { | 74 void ProcessPolicyRequest() { |
| 75 em::DevicePolicyRequest request; | 75 em::DevicePolicyRequest request; |
| 76 DevicePolicyResponseDelegateMock delegate; | 76 DevicePolicyResponseDelegateMock delegate; |
| 77 EXPECT_CALL(delegate, OnError(_)).Times(AnyNumber()); | 77 EXPECT_CALL(delegate, OnError(_)).Times(AnyNumber()); |
| 78 EXPECT_CALL(delegate, HandlePolicyResponse(_)).Times(AnyNumber()); | 78 EXPECT_CALL(delegate, HandlePolicyResponse(_)).Times(AnyNumber()); |
| 79 backend_->ProcessPolicyRequest("token", "testid", | 79 backend_->ProcessPolicyRequest("token", "testid", request, &delegate); |
| 80 CloudPolicyDataStore::USER_AFFILIATION_NONE, | |
| 81 request, &delegate); | |
| 82 } | 80 } |
| 83 | 81 |
| 84 void UnmockCreateBackend() { | 82 void UnmockCreateBackend() { |
| 85 EXPECT_CALL(service_, CreateBackend()) | 83 EXPECT_CALL(service_, CreateBackend()) |
| 86 .WillOnce(Invoke(&service_, | 84 .WillOnce(Invoke(&service_, |
| 87 &MockDeviceManagementService::CreateBackendNotMocked)); | 85 &MockDeviceManagementService::CreateBackendNotMocked)); |
| 88 } | 86 } |
| 89 | 87 |
| 90 void ExpectStartJob(net::URLRequestStatus::Status status, int response_code, | 88 void ExpectStartJob(net::URLRequestStatus::Status status, int response_code, |
| 91 const std::string& data) { | 89 const std::string& data) { |
| (...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 842 helper.CompleteRetrieve(chromeos::SignedSettings::NOT_FOUND); | 840 helper.CompleteRetrieve(chromeos::SignedSettings::NOT_FOUND); |
| 843 helper.SetData("\xff"); | 841 helper.SetData("\xff"); |
| 844 helper.SetPolicy(); | 842 helper.SetPolicy(); |
| 845 ExpectSample(kMetricPolicyFetchInvalidPolicy); | 843 ExpectSample(kMetricPolicyFetchInvalidPolicy); |
| 846 EXPECT_TRUE(CheckSamples()); | 844 EXPECT_TRUE(CheckSamples()); |
| 847 } | 845 } |
| 848 | 846 |
| 849 #endif | 847 #endif |
| 850 | 848 |
| 851 } // namespace policy | 849 } // namespace policy |
| OLD | NEW |