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

Side by Side Diff: remoting/base/telemetry_log_writer_unittest.cc

Issue 2729423003: Network traffic annotation added to chromium_url_request. (Closed)
Patch Set: Annotation updated. Created 3 years, 7 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
« no previous file with comments | « remoting/base/telemetry_log_writer.cc ('k') | remoting/base/url_request.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "remoting/base/telemetry_log_writer.h" 5 #include "remoting/base/telemetry_log_writer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 FakeUrlRequest* fakeRequest = new FakeUrlRequest(exp_post, ret_result); 54 FakeUrlRequest* fakeRequest = new FakeUrlRequest(exp_post, ret_result);
55 base::Closure closure = 55 base::Closure closure =
56 base::Bind(&FakeUrlRequest::Respond, base::Unretained(fakeRequest)); 56 base::Bind(&FakeUrlRequest::Respond, base::Unretained(fakeRequest));
57 expected_requests_.push_back(std::unique_ptr<UrlRequest>(fakeRequest)); 57 expected_requests_.push_back(std::unique_ptr<UrlRequest>(fakeRequest));
58 return closure; 58 return closure;
59 } 59 }
60 60
61 // request_factory_ override. 61 // request_factory_ override.
62 std::unique_ptr<UrlRequest> CreateUrlRequest( 62 std::unique_ptr<UrlRequest> CreateUrlRequest(
63 UrlRequest::Type type, 63 UrlRequest::Type type,
64 const std::string& url) override { 64 const std::string& url,
65 const net::NetworkTrafficAnnotationTag& traffic_annotation) override {
65 EXPECT_FALSE(expected_requests_.empty()); 66 EXPECT_FALSE(expected_requests_.empty());
66 if (expected_requests_.empty()) { 67 if (expected_requests_.empty()) {
67 return std::unique_ptr<UrlRequest>(nullptr); 68 return std::unique_ptr<UrlRequest>(nullptr);
68 } 69 }
69 EXPECT_EQ(type, UrlRequest::Type::POST); 70 EXPECT_EQ(type, UrlRequest::Type::POST);
70 std::unique_ptr<UrlRequest> request(std::move(expected_requests_.front())); 71 std::unique_ptr<UrlRequest> request(std::move(expected_requests_.front()));
71 expected_requests_.pop_front(); 72 expected_requests_.pop_front();
72 return request; 73 return request;
73 } 74 }
74 75
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 224
224 auto respond2 = request_factory_->AddExpectedRequest( 225 auto respond2 = request_factory_->AddExpectedRequest(
225 "{\"event\":[{\"id\":0}]}", success_result_); 226 "{\"event\":[{\"id\":0}]}", success_result_);
226 respond1.Run(); 227 respond1.Run();
227 respond2.Run(); 228 respond2.Run();
228 229
229 EXPECT_EQ(0, set_auth_count_); 230 EXPECT_EQ(0, set_auth_count_);
230 } 231 }
231 232
232 } // namespace remoting 233 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/base/telemetry_log_writer.cc ('k') | remoting/base/url_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698