OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/domain_reliability/uploader.h" | 5 #include "components/domain_reliability/uploader.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 result_(result) { | 45 result_(result) { |
46 int load_flags = request->load_flags(); | 46 int load_flags = request->load_flags(); |
47 EXPECT_TRUE(load_flags & net::LOAD_DO_NOT_SEND_COOKIES); | 47 EXPECT_TRUE(load_flags & net::LOAD_DO_NOT_SEND_COOKIES); |
48 EXPECT_TRUE(load_flags & net::LOAD_DO_NOT_SAVE_COOKIES); | 48 EXPECT_TRUE(load_flags & net::LOAD_DO_NOT_SAVE_COOKIES); |
49 } | 49 } |
50 | 50 |
51 protected: | 51 protected: |
52 void Start() override { | 52 void Start() override { |
53 int rv = upload_stream_->Init( | 53 int rv = upload_stream_->Init( |
54 base::Bind(&UploadMockURLRequestJob::OnStreamInitialized, | 54 base::Bind(&UploadMockURLRequestJob::OnStreamInitialized, |
55 base::Unretained(this))); | 55 base::Unretained(this)), |
| 56 net::BoundNetLog()); |
56 if (rv == net::ERR_IO_PENDING) | 57 if (rv == net::ERR_IO_PENDING) |
57 return; | 58 return; |
58 OnStreamInitialized(rv); | 59 OnStreamInitialized(rv); |
59 } | 60 } |
60 | 61 |
61 void SetUpload(net::UploadDataStream* upload_stream) override { | 62 void SetUpload(net::UploadDataStream* upload_stream) override { |
62 upload_stream_ = upload_stream; | 63 upload_stream_ = upload_stream; |
63 } | 64 } |
64 | 65 |
65 private: | 66 private: |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 TestUploadCallback c; | 273 TestUploadCallback c; |
273 uploader()->UploadReport("{}", 1, GURL(kUploadURL), c.callback()); | 274 uploader()->UploadReport("{}", 1, GURL(kUploadURL), c.callback()); |
274 base::RunLoop().RunUntilIdle(); | 275 base::RunLoop().RunUntilIdle(); |
275 EXPECT_EQ(1u, c.called_count()); | 276 EXPECT_EQ(1u, c.called_count()); |
276 | 277 |
277 EXPECT_EQ(2, interceptor()->last_upload_depth()); | 278 EXPECT_EQ(2, interceptor()->last_upload_depth()); |
278 } | 279 } |
279 | 280 |
280 } // namespace | 281 } // namespace |
281 } // namespace domain_reliability | 282 } // namespace domain_reliability |
OLD | NEW |