| 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/threading/thread.h" | 10 #include "base/threading/thread.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 "testid", request, &delegate); | 74 "testid", request, &delegate); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void ProcessPolicyRequest() { | 77 void ProcessPolicyRequest() { |
| 78 em::DevicePolicyRequest request; | 78 em::DevicePolicyRequest request; |
| 79 DevicePolicyResponseDelegateMock delegate; | 79 DevicePolicyResponseDelegateMock delegate; |
| 80 EXPECT_CALL(delegate, OnError(_)).Times(AnyNumber()); | 80 EXPECT_CALL(delegate, OnError(_)).Times(AnyNumber()); |
| 81 EXPECT_CALL(delegate, HandlePolicyResponse(_)).Times(AnyNumber()); | 81 EXPECT_CALL(delegate, HandlePolicyResponse(_)).Times(AnyNumber()); |
| 82 backend_->ProcessPolicyRequest("token", "testid", | 82 backend_->ProcessPolicyRequest("token", "testid", |
| 83 CloudPolicyDataStore::USER_AFFILIATION_NONE, | 83 CloudPolicyDataStore::USER_AFFILIATION_NONE, |
| 84 request, &delegate); | 84 request, NULL, &delegate); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void UnmockCreateBackend() { | 87 void UnmockCreateBackend() { |
| 88 EXPECT_CALL(service_, CreateBackend()) | 88 EXPECT_CALL(service_, CreateBackend()) |
| 89 .WillOnce(Invoke(&service_, | 89 .WillOnce(Invoke(&service_, |
| 90 &MockDeviceManagementService::CreateBackendNotMocked)); | 90 &MockDeviceManagementService::CreateBackendNotMocked)); |
| 91 } | 91 } |
| 92 | 92 |
| 93 void ExpectStartJob(net::URLRequestStatus::Status status, int response_code, | 93 void ExpectStartJob(net::URLRequestStatus::Status status, int response_code, |
| 94 const std::string& data) { | 94 const std::string& data) { |
| (...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 helper.CompleteRetrieve(chromeos::SignedSettings::NOT_FOUND); | 858 helper.CompleteRetrieve(chromeos::SignedSettings::NOT_FOUND); |
| 859 helper.SetData("\xff"); | 859 helper.SetData("\xff"); |
| 860 helper.SetPolicy(); | 860 helper.SetPolicy(); |
| 861 ExpectSample(kMetricPolicyFetchInvalidPolicy); | 861 ExpectSample(kMetricPolicyFetchInvalidPolicy); |
| 862 EXPECT_TRUE(CheckSamples()); | 862 EXPECT_TRUE(CheckSamples()); |
| 863 } | 863 } |
| 864 | 864 |
| 865 #endif | 865 #endif |
| 866 | 866 |
| 867 } // namespace policy | 867 } // namespace policy |
| OLD | NEW |