| OLD | NEW |
| 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 "chrome/browser/net/http_pipelining_compatibility_client.h" | 5 #include "chrome/browser/net/http_pipelining_compatibility_client.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 BrowserThread::ReleaseSoon(BrowserThread::IO, FROM_HERE, context_); | 111 BrowserThread::ReleaseSoon(BrowserThread::IO, FROM_HERE, context_); |
| 112 message_loop_.RunUntilIdle(); | 112 message_loop_.RunUntilIdle(); |
| 113 STLDeleteValues(&original_samples_); | 113 STLDeleteValues(&original_samples_); |
| 114 } | 114 } |
| 115 | 115 |
| 116 void RunTest( | 116 void RunTest( |
| 117 std::vector<RequestInfo> requests, | 117 std::vector<RequestInfo> requests, |
| 118 HttpPipeliningCompatibilityClient::Options options) { | 118 HttpPipeliningCompatibilityClient::Options options) { |
| 119 HttpPipeliningCompatibilityClient client(NULL); | 119 HttpPipeliningCompatibilityClient client(NULL); |
| 120 net::TestCompletionCallback callback; | 120 net::TestCompletionCallback callback; |
| 121 client.Start(test_server_.GetURL("").spec(), | 121 client.Start(test_server_.GetURL(std::string()).spec(), |
| 122 requests, options, callback.callback(), | 122 requests, |
| 123 options, |
| 124 callback.callback(), |
| 123 context_->GetURLRequestContext()); | 125 context_->GetURLRequestContext()); |
| 124 callback.WaitForResult(); | 126 callback.WaitForResult(); |
| 125 } | 127 } |
| 126 | 128 |
| 127 void ExpectHistogramCount(int expected_count, | 129 void ExpectHistogramCount(int expected_count, |
| 128 int expected_value, | 130 int expected_value, |
| 129 HistogramField field) { | 131 HistogramField field) { |
| 130 const char* name; | 132 const char* name; |
| 131 | 133 |
| 132 switch (field) { | 134 switch (field) { |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 callback.WaitForResult(); | 588 callback.WaitForResult(); |
| 587 | 589 |
| 588 ExpectHistogramCount(1, false, FIELD_CANARY); | 590 ExpectHistogramCount(1, false, FIELD_CANARY); |
| 589 ExpectHistogramCount(0, false, FIELD_SUCCESS); | 591 ExpectHistogramCount(0, false, FIELD_SUCCESS); |
| 590 ExpectHistogramCount(0, true, FIELD_SUCCESS); | 592 ExpectHistogramCount(0, true, FIELD_SUCCESS); |
| 591 } | 593 } |
| 592 | 594 |
| 593 } // anonymous namespace | 595 } // anonymous namespace |
| 594 | 596 |
| 595 } // namespace chrome_browser_net | 597 } // namespace chrome_browser_net |
| OLD | NEW |