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 "components/update_client/request_sender.h" | 5 #include "components/update_client/request_sender.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 request_sender_->Send(false, "test", urls, | 155 request_sender_->Send(false, "test", urls, |
156 base::Bind(&RequestSenderTest::RequestSenderComplete, | 156 base::Bind(&RequestSenderTest::RequestSenderComplete, |
157 base::Unretained(this))); | 157 base::Unretained(this))); |
158 RunThreads(); | 158 RunThreads(); |
159 | 159 |
160 EXPECT_EQ(1, post_interceptor_1_->GetHitCount()) | 160 EXPECT_EQ(1, post_interceptor_1_->GetHitCount()) |
161 << post_interceptor_1_->GetRequestsAsString(); | 161 << post_interceptor_1_->GetRequestsAsString(); |
162 EXPECT_EQ(1, post_interceptor_1_->GetCount()) | 162 EXPECT_EQ(1, post_interceptor_1_->GetCount()) |
163 << post_interceptor_1_->GetRequestsAsString(); | 163 << post_interceptor_1_->GetRequestsAsString(); |
164 | 164 |
| 165 EXPECT_EQ(0, post_interceptor_2_->GetHitCount()) |
| 166 << post_interceptor_2_->GetRequestsAsString(); |
| 167 EXPECT_EQ(0, post_interceptor_2_->GetCount()) |
| 168 << post_interceptor_2_->GetRequestsAsString(); |
| 169 |
165 // Sanity check the request. | 170 // Sanity check the request. |
166 EXPECT_STREQ("test", post_interceptor_1_->GetRequests()[0].c_str()); | 171 EXPECT_STREQ("test", post_interceptor_1_->GetRequests()[0].c_str()); |
167 | 172 |
168 // Check the response post conditions. | 173 // Check the response post conditions. |
169 EXPECT_EQ(0, error_); | 174 EXPECT_EQ(0, error_); |
170 EXPECT_TRUE(base::StartsWith(response_, | 175 EXPECT_TRUE(base::StartsWith(response_, |
171 "<?xml version='1.0' encoding='UTF-8'?>", | 176 "<?xml version='1.0' encoding='UTF-8'?>", |
172 base::CompareCase::SENSITIVE)); | 177 base::CompareCase::SENSITIVE)); |
173 EXPECT_EQ(443ul, response_.size()); | 178 EXPECT_EQ(443ul, response_.size()); |
174 } | 179 } |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 << post_interceptor_1_->GetRequestsAsString(); | 267 << post_interceptor_1_->GetRequestsAsString(); |
263 EXPECT_EQ(1, post_interceptor_1_->GetCount()) | 268 EXPECT_EQ(1, post_interceptor_1_->GetCount()) |
264 << post_interceptor_1_->GetRequestsAsString(); | 269 << post_interceptor_1_->GetRequestsAsString(); |
265 | 270 |
266 EXPECT_STREQ("test", post_interceptor_1_->GetRequests()[0].c_str()); | 271 EXPECT_STREQ("test", post_interceptor_1_->GetRequests()[0].c_str()); |
267 EXPECT_EQ(RequestSender::kErrorResponseNotTrusted, error_); | 272 EXPECT_EQ(RequestSender::kErrorResponseNotTrusted, error_); |
268 EXPECT_TRUE(response_.empty()); | 273 EXPECT_TRUE(response_.empty()); |
269 } | 274 } |
270 | 275 |
271 } // namespace update_client | 276 } // namespace update_client |
OLD | NEW |