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

Side by Side Diff: net/url_request/url_request_test_util.cc

Issue 1421983002: Include tab IDs when reporting data use accounting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@data_use_scoped_vector
Patch Set: Fixed external_data_use_observer test Created 5 years, 1 month 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 | « net/url_request/url_request_test_util.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "net/url_request/url_request_test_util.h" 5 #include "net/url_request/url_request_test_util.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 event_order_[req_id] += "OnResponseStarted\n"; 499 event_order_[req_id] += "OnResponseStarted\n";
500 EXPECT_TRUE(next_states_[req_id] & kStageResponseStarted) << 500 EXPECT_TRUE(next_states_[req_id] & kStageResponseStarted) <<
501 event_order_[req_id]; 501 event_order_[req_id];
502 next_states_[req_id] = kStageCompletedSuccess | kStageCompletedError; 502 next_states_[req_id] = kStageCompletedSuccess | kStageCompletedError;
503 if (request->status().status() == URLRequestStatus::FAILED) { 503 if (request->status().status() == URLRequestStatus::FAILED) {
504 error_count_++; 504 error_count_++;
505 last_error_ = request->status().error(); 505 last_error_ = request->status().error();
506 } 506 }
507 } 507 }
508 508
509 void TestNetworkDelegate::OnNetworkBytesReceived(const URLRequest& request, 509 void TestNetworkDelegate::OnNetworkBytesReceived(URLRequest* request,
510 int64_t bytes_received) { 510 int64_t bytes_received) {
511 event_order_[request.identifier()] += "OnNetworkBytesReceived\n"; 511 event_order_[request->identifier()] += "OnNetworkBytesReceived\n";
512 total_network_bytes_received_ += bytes_received; 512 total_network_bytes_received_ += bytes_received;
513 } 513 }
514 514
515 void TestNetworkDelegate::OnNetworkBytesSent(const URLRequest& request, 515 void TestNetworkDelegate::OnNetworkBytesSent(URLRequest* request,
516 int64_t bytes_sent) { 516 int64_t bytes_sent) {
517 event_order_[request.identifier()] += "OnNetworkBytesSent\n"; 517 event_order_[request->identifier()] += "OnNetworkBytesSent\n";
518 total_network_bytes_sent_ += bytes_sent; 518 total_network_bytes_sent_ += bytes_sent;
519 } 519 }
520 520
521 void TestNetworkDelegate::OnCompleted(URLRequest* request, bool started) { 521 void TestNetworkDelegate::OnCompleted(URLRequest* request, bool started) {
522 int req_id = request->identifier(); 522 int req_id = request->identifier();
523 InitRequestStatesIfNew(req_id); 523 InitRequestStatesIfNew(req_id);
524 event_order_[req_id] += "OnCompleted\n"; 524 event_order_[req_id] += "OnCompleted\n";
525 // Expect "Success -> (next_states_ & kStageCompletedSuccess)" 525 // Expect "Success -> (next_states_ & kStageCompletedSuccess)"
526 // is logically identical to 526 // is logically identical to
527 // Expect "!(Success) || (next_states_ & kStageCompletedSuccess)" 527 // Expect "!(Success) || (next_states_ & kStageCompletedSuccess)"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 URLRequestJob* job = main_intercept_job_; 637 URLRequestJob* job = main_intercept_job_;
638 main_intercept_job_ = NULL; 638 main_intercept_job_ = NULL;
639 return job; 639 return job;
640 } 640 }
641 641
642 void TestJobInterceptor::set_main_intercept_job(URLRequestJob* job) { 642 void TestJobInterceptor::set_main_intercept_job(URLRequestJob* job) {
643 main_intercept_job_ = job; 643 main_intercept_job_ = job;
644 } 644 }
645 645
646 } // namespace net 646 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_test_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698