Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(208)

Side by Side Diff: chrome/browser/policy/enterprise_metrics_browsertest.cc

Issue 7810025: Pass user_affiliation request parameter on user cloud policy requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Mac build breakage. Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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", request, &delegate); 79 backend_->ProcessPolicyRequest("token", "testid",
80 CloudPolicyDataStore::USER_AFFILIATION_NONE,
81 request, &delegate);
80 } 82 }
81 83
82 void UnmockCreateBackend() { 84 void UnmockCreateBackend() {
83 EXPECT_CALL(service_, CreateBackend()) 85 EXPECT_CALL(service_, CreateBackend())
84 .WillOnce(Invoke(&service_, 86 .WillOnce(Invoke(&service_,
85 &MockDeviceManagementService::CreateBackendNotMocked)); 87 &MockDeviceManagementService::CreateBackendNotMocked));
86 } 88 }
87 89
88 void ExpectStartJob(net::URLRequestStatus::Status status, int response_code, 90 void ExpectStartJob(net::URLRequestStatus::Status status, int response_code,
89 const std::string& data) { 91 const std::string& data) {
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 helper.CompleteRetrieve(chromeos::SignedSettings::NOT_FOUND); 842 helper.CompleteRetrieve(chromeos::SignedSettings::NOT_FOUND);
841 helper.SetData("\xff"); 843 helper.SetData("\xff");
842 helper.SetPolicy(); 844 helper.SetPolicy();
843 ExpectSample(kMetricPolicyFetchInvalidPolicy); 845 ExpectSample(kMetricPolicyFetchInvalidPolicy);
844 EXPECT_TRUE(CheckSamples()); 846 EXPECT_TRUE(CheckSamples());
845 } 847 }
846 848
847 #endif 849 #endif
848 850
849 } // namespace policy 851 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/device_management_service_unittest.cc ('k') | chrome/browser/policy/mock_device_management_backend.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698