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 "net/test/embedded_test_server/embedded_test_server.h" | 5 #include "net/test/embedded_test_server/embedded_test_server.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 EXPECT_EQ("text/plain", GetContentTypeFromFetcher(*fetcher3)); | 382 EXPECT_EQ("text/plain", GetContentTypeFromFetcher(*fetcher3)); |
383 } | 383 } |
384 | 384 |
385 namespace { | 385 namespace { |
386 | 386 |
387 class CancelRequestDelegate : public TestDelegate { | 387 class CancelRequestDelegate : public TestDelegate { |
388 public: | 388 public: |
389 CancelRequestDelegate() {} | 389 CancelRequestDelegate() {} |
390 ~CancelRequestDelegate() override {} | 390 ~CancelRequestDelegate() override {} |
391 | 391 |
392 void OnResponseStarted(URLRequest* request) override { | 392 void OnResponseStarted(URLRequest* request, int net_error) override { |
393 TestDelegate::OnResponseStarted(request); | 393 TestDelegate::OnResponseStarted(request, net_error); |
394 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 394 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
395 FROM_HERE, run_loop_.QuitClosure(), base::TimeDelta::FromSeconds(1)); | 395 FROM_HERE, run_loop_.QuitClosure(), base::TimeDelta::FromSeconds(1)); |
396 } | 396 } |
397 | 397 |
398 void WaitUntilDone() { run_loop_.Run(); } | 398 void WaitUntilDone() { run_loop_.Run(); } |
399 | 399 |
400 private: | 400 private: |
401 base::RunLoop run_loop_; | 401 base::RunLoop run_loop_; |
402 | 402 |
403 DISALLOW_COPY_AND_ASSIGN(CancelRequestDelegate); | 403 DISALLOW_COPY_AND_ASSIGN(CancelRequestDelegate); |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 INSTANTIATE_TEST_CASE_P( | 597 INSTANTIATE_TEST_CASE_P( |
598 EmbeddedTestServerThreadingTestInstantiation, | 598 EmbeddedTestServerThreadingTestInstantiation, |
599 EmbeddedTestServerThreadingTest, | 599 EmbeddedTestServerThreadingTest, |
600 testing::Combine(testing::Bool(), | 600 testing::Combine(testing::Bool(), |
601 testing::Bool(), | 601 testing::Bool(), |
602 testing::Values(EmbeddedTestServer::TYPE_HTTP, | 602 testing::Values(EmbeddedTestServer::TYPE_HTTP, |
603 EmbeddedTestServer::TYPE_HTTPS))); | 603 EmbeddedTestServer::TYPE_HTTPS))); |
604 | 604 |
605 } // namespace test_server | 605 } // namespace test_server |
606 } // namespace net | 606 } // namespace net |
OLD | NEW |