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

Side by Side Diff: extensions/browser/extension_throttle_simulation_unittest.cc

Issue 2137013005: [Extensions] Code Cleanup - Remove redundant smart-ptr get()s (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
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 // The tests in this file attempt to verify the following through simulation: 5 // The tests in this file attempt to verify the following through simulation:
6 // a) That a server experiencing overload will actually benefit from the 6 // a) That a server experiencing overload will actually benefit from the
7 // anti-DDoS throttling logic, i.e. that its traffic spike will subside 7 // anti-DDoS throttling logic, i.e. that its traffic spike will subside
8 // and be distributed over a longer period of time; 8 // and be distributed over a longer period of time;
9 // b) That "well-behaved" clients of a server under DDoS attack actually 9 // b) That "well-behaved" clients of a server under DDoS attack actually
10 // benefit from the anti-DDoS throttling logic; and 10 // benefit from the anti-DDoS throttling logic; and
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 186
187 return 200; 187 return 200;
188 } 188 }
189 189
190 int num_overloaded_ticks() const { return num_overloaded_ticks_; } 190 int num_overloaded_ticks() const { return num_overloaded_ticks_; }
191 191
192 int max_experienced_queries_per_tick() const { 192 int max_experienced_queries_per_tick() const {
193 return max_experienced_queries_per_tick_; 193 return max_experienced_queries_per_tick_;
194 } 194 }
195 195
196 const URLRequest& mock_request() const { return *mock_request_.get(); } 196 const URLRequest& mock_request() const { return *mock_request_; }
197 197
198 std::string VisualizeASCII(int terminal_width) { 198 std::string VisualizeASCII(int terminal_width) {
199 // Account for | characters we place at left of graph. 199 // Account for | characters we place at left of graph.
200 terminal_width -= 1; 200 terminal_width -= 1;
201 201
202 VerboseOut("Overloaded for %d of %d ticks.\n", num_overloaded_ticks_, 202 VerboseOut("Overloaded for %d of %d ticks.\n", num_overloaded_ticks_,
203 requests_per_tick_.size()); 203 requests_per_tick_.size());
204 VerboseOut("Got maximum of %d requests in a tick.\n\n", 204 VerboseOut("Got maximum of %d requests in a tick.\n\n",
205 max_experienced_queries_per_tick_); 205 max_experienced_queries_per_tick_);
206 206
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 trials[i].PrintTrialDescription(); 737 trials[i].PrintTrialDescription();
738 trials[i].stats.ReportTrialResult(increase_ratio); 738 trials[i].stats.ReportTrialResult(increase_ratio);
739 } 739 }
740 740
741 VerboseOut("Average increase ratio was %.4f\n", average_increase_ratio); 741 VerboseOut("Average increase ratio was %.4f\n", average_increase_ratio);
742 VerboseOut("Maximum increase ratio was %.4f\n", max_increase_ratio); 742 VerboseOut("Maximum increase ratio was %.4f\n", max_increase_ratio);
743 } 743 }
744 744
745 } // namespace 745 } // namespace
746 } // namespace extensions 746 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api_test_utils.cc ('k') | extensions/browser/guest_view/mime_handler_view/test_mime_handler_view_guest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698