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

Side by Side Diff: net/test/embedded_test_server/embedded_test_server_unittest.cc

Issue 2262653003: Make URLRequest::Read to return net errors or bytes read instead of a bool (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 3 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 #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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698