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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 using testing::Field; | 76 using testing::Field; |
77 using testing::Invoke; | 77 using testing::Invoke; |
78 using testing::Return; | 78 using testing::Return; |
79 using testing::StrEq; | 79 using testing::StrEq; |
80 | 80 |
81 class HttpPipeliningCompatibilityClientTest : public testing::Test { | 81 class HttpPipeliningCompatibilityClientTest : public testing::Test { |
82 public: | 82 public: |
83 HttpPipeliningCompatibilityClientTest() | 83 HttpPipeliningCompatibilityClientTest() |
84 : test_server_(net::TestServer::TYPE_HTTP, | 84 : test_server_(net::TestServer::TYPE_HTTP, |
85 net::TestServer::kLocalhost, | 85 net::TestServer::kLocalhost, |
86 base::FilePath(FILE_PATH_LITERAL( | 86 net::TestServer::GetSourceRelativePath( |
87 "chrome/test/data/http_pipelining"))), | 87 base::FilePath(FILE_PATH_LITERAL( |
| 88 "chrome/test/data/http_pipelining")))), |
88 io_thread_(BrowserThread::IO, &message_loop_) { | 89 io_thread_(BrowserThread::IO, &message_loop_) { |
89 } | 90 } |
90 | 91 |
91 protected: | 92 protected: |
92 virtual void SetUp() OVERRIDE { | 93 virtual void SetUp() OVERRIDE { |
93 // Start up a histogram recorder. | 94 // Start up a histogram recorder. |
94 // TODO(rtenneti): Leaks StatisticsRecorder and will update suppressions. | 95 // TODO(rtenneti): Leaks StatisticsRecorder and will update suppressions. |
95 base::StatisticsRecorder::Initialize(); | 96 base::StatisticsRecorder::Initialize(); |
96 ASSERT_TRUE(test_server_.Start()); | 97 ASSERT_TRUE(test_server_.Start()); |
97 context_ = new net::TestURLRequestContextGetter( | 98 context_ = new net::TestURLRequestContextGetter( |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 callback.WaitForResult(); | 587 callback.WaitForResult(); |
587 | 588 |
588 ExpectHistogramCount(1, false, FIELD_CANARY); | 589 ExpectHistogramCount(1, false, FIELD_CANARY); |
589 ExpectHistogramCount(0, false, FIELD_SUCCESS); | 590 ExpectHistogramCount(0, false, FIELD_SUCCESS); |
590 ExpectHistogramCount(0, true, FIELD_SUCCESS); | 591 ExpectHistogramCount(0, true, FIELD_SUCCESS); |
591 } | 592 } |
592 | 593 |
593 } // anonymous namespace | 594 } // anonymous namespace |
594 | 595 |
595 } // namespace chrome_browser_net | 596 } // namespace chrome_browser_net |
OLD | NEW |