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

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

Issue 2579933002: Add logging for ResourceScheduler events. (Closed)
Patch Set: DCHECK to make sure that all async starts have defined triggers. Created 3 years, 11 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 | « net/url_request/url_request_netlog_params.cc ('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 <memory> 5 #include <memory>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 4843 matching lines...) Expand 10 before | Expand all | Expand 10 after
4854 static size_t CheckDelegateInfo(const TestNetLogEntry::List& entries, 4854 static size_t CheckDelegateInfo(const TestNetLogEntry::List& entries,
4855 size_t log_position) { 4855 size_t log_position) {
4856 // There should be 4 DELEGATE_INFO events: Two begins and two ends. 4856 // There should be 4 DELEGATE_INFO events: Two begins and two ends.
4857 if (log_position + 3 >= entries.size()) { 4857 if (log_position + 3 >= entries.size()) {
4858 ADD_FAILURE() << "Not enough log entries"; 4858 ADD_FAILURE() << "Not enough log entries";
4859 return entries.size(); 4859 return entries.size();
4860 } 4860 }
4861 std::string delegate_info; 4861 std::string delegate_info;
4862 EXPECT_EQ(NetLogEventType::DELEGATE_INFO, entries[log_position].type); 4862 EXPECT_EQ(NetLogEventType::DELEGATE_INFO, entries[log_position].type);
4863 EXPECT_EQ(NetLogEventPhase::BEGIN, entries[log_position].phase); 4863 EXPECT_EQ(NetLogEventPhase::BEGIN, entries[log_position].phase);
4864 EXPECT_TRUE(entries[log_position].GetStringValue("delegate_info", 4864 EXPECT_TRUE(entries[log_position].GetStringValue("delegate_blocked_by",
4865 &delegate_info)); 4865 &delegate_info));
4866 EXPECT_EQ(kFirstDelegateInfo, delegate_info); 4866 EXPECT_EQ(kFirstDelegateInfo, delegate_info);
4867 4867
4868 ++log_position; 4868 ++log_position;
4869 EXPECT_EQ(NetLogEventType::DELEGATE_INFO, entries[log_position].type); 4869 EXPECT_EQ(NetLogEventType::DELEGATE_INFO, entries[log_position].type);
4870 EXPECT_EQ(NetLogEventPhase::END, entries[log_position].phase); 4870 EXPECT_EQ(NetLogEventPhase::END, entries[log_position].phase);
4871 4871
4872 ++log_position; 4872 ++log_position;
4873 EXPECT_EQ(NetLogEventType::DELEGATE_INFO, entries[log_position].type); 4873 EXPECT_EQ(NetLogEventType::DELEGATE_INFO, entries[log_position].type);
4874 EXPECT_EQ(NetLogEventPhase::BEGIN, entries[log_position].phase); 4874 EXPECT_EQ(NetLogEventPhase::BEGIN, entries[log_position].phase);
4875 EXPECT_TRUE(entries[log_position].GetStringValue("delegate_info", 4875 EXPECT_TRUE(entries[log_position].GetStringValue("delegate_blocked_by",
4876 &delegate_info)); 4876 &delegate_info));
4877 EXPECT_EQ(kSecondDelegateInfo, delegate_info); 4877 EXPECT_EQ(kSecondDelegateInfo, delegate_info);
4878 4878
4879 ++log_position; 4879 ++log_position;
4880 EXPECT_EQ(NetLogEventType::DELEGATE_INFO, entries[log_position].type); 4880 EXPECT_EQ(NetLogEventType::DELEGATE_INFO, entries[log_position].type);
4881 EXPECT_EQ(NetLogEventPhase::END, entries[log_position].phase); 4881 EXPECT_EQ(NetLogEventPhase::END, entries[log_position].phase);
4882 4882
4883 return log_position + 1; 4883 return log_position + 1;
4884 } 4884 }
4885 4885
(...skipping 5765 matching lines...) Expand 10 before | Expand all | Expand 10 after
10651 AddTestInterceptor()->set_main_intercept_job(std::move(job)); 10651 AddTestInterceptor()->set_main_intercept_job(std::move(job));
10652 10652
10653 req->Start(); 10653 req->Start();
10654 req->Cancel(); 10654 req->Cancel();
10655 base::RunLoop().RunUntilIdle(); 10655 base::RunLoop().RunUntilIdle();
10656 EXPECT_EQ(ERR_ABORTED, d.request_status()); 10656 EXPECT_EQ(ERR_ABORTED, d.request_status());
10657 EXPECT_EQ(0, d.received_redirect_count()); 10657 EXPECT_EQ(0, d.received_redirect_count());
10658 } 10658 }
10659 10659
10660 } // namespace net 10660 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_netlog_params.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698