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

Side by Side Diff: net/proxy/network_delegate_error_observer_unittest.cc

Issue 8743019: base::Bind: Convert net::NetworkDelegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fixes. Created 9 years 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 | Annotate | Revision Log
« no previous file with comments | « net/base/network_delegate.cc ('k') | net/url_request/url_request.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/proxy/network_delegate_error_observer.h" 5 #include "net/proxy/network_delegate_error_observer.h"
6 6
7 #include "base/message_loop_proxy.h" 7 #include "base/message_loop_proxy.h"
8 #include "base/threading/thread.h" 8 #include "base/threading/thread.h"
9 #include "net/base/net_errors.h" 9 #include "net/base/net_errors.h"
10 #include "net/base/network_delegate.h" 10 #include "net/base/network_delegate.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
13 DISABLE_RUNNABLE_METHOD_REFCOUNT(net::NetworkDelegateErrorObserver); 13 DISABLE_RUNNABLE_METHOD_REFCOUNT(net::NetworkDelegateErrorObserver);
14 14
15 namespace net { 15 namespace net {
16 16
17 namespace { 17 namespace {
18 18
19 class TestNetworkDelegate : public net::NetworkDelegate { 19 class TestNetworkDelegate : public net::NetworkDelegate {
20 public: 20 public:
21 TestNetworkDelegate() : got_pac_error_(false) {} 21 TestNetworkDelegate() : got_pac_error_(false) {}
22 virtual ~TestNetworkDelegate() {} 22 virtual ~TestNetworkDelegate() {}
23 23
24 bool got_pac_error() const { return got_pac_error_; } 24 bool got_pac_error() const { return got_pac_error_; }
25 25
26 private: 26 private:
27 // net::NetworkDelegate: 27 // net::NetworkDelegate implementation.
28 virtual int OnBeforeURLRequest(URLRequest* request, 28 virtual int OnBeforeURLRequest(URLRequest* request,
29 OldCompletionCallback* callback, 29 const CompletionCallback& callback,
30 GURL* new_url) OVERRIDE { 30 GURL* new_url) OVERRIDE {
31 return OK; 31 return OK;
32 } 32 }
33 virtual int OnBeforeSendHeaders(URLRequest* request, 33 virtual int OnBeforeSendHeaders(URLRequest* request,
34 OldCompletionCallback* callback, 34 const CompletionCallback& callback,
35 HttpRequestHeaders* headers) OVERRIDE { 35 HttpRequestHeaders* headers) OVERRIDE {
36 return OK; 36 return OK;
37 } 37 }
38 virtual void OnSendHeaders(URLRequest* request, 38 virtual void OnSendHeaders(URLRequest* request,
39 const HttpRequestHeaders& headers) OVERRIDE {} 39 const HttpRequestHeaders& headers) OVERRIDE {}
40 virtual int OnHeadersReceived( 40 virtual int OnHeadersReceived(
41 URLRequest* request, 41 URLRequest* request,
42 OldCompletionCallback* callback, 42 const CompletionCallback& callback,
43 HttpResponseHeaders* original_response_headers, 43 HttpResponseHeaders* original_response_headers,
44 scoped_refptr<HttpResponseHeaders>* override_response_headers) OVERRIDE { 44 scoped_refptr<HttpResponseHeaders>* override_response_headers) OVERRIDE {
45 return net::OK; 45 return net::OK;
46 } 46 }
47 virtual void OnBeforeRedirect(URLRequest* request, 47 virtual void OnBeforeRedirect(URLRequest* request,
48 const GURL& new_location) OVERRIDE {} 48 const GURL& new_location) OVERRIDE {}
49 virtual void OnResponseStarted(URLRequest* request) OVERRIDE {} 49 virtual void OnResponseStarted(URLRequest* request) OVERRIDE {}
50 virtual void OnRawBytesRead(const URLRequest& request, 50 virtual void OnRawBytesRead(const URLRequest& request,
51 int bytes_read) OVERRIDE {} 51 int bytes_read) OVERRIDE {}
52 virtual void OnCompleted(URLRequest* request) OVERRIDE {} 52 virtual void OnCompleted(URLRequest* request) OVERRIDE {}
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 FROM_HERE, 98 FROM_HERE,
99 NewRunnableMethod(&observer, 99 NewRunnableMethod(&observer,
100 &NetworkDelegateErrorObserver::OnPACScriptError, 100 &NetworkDelegateErrorObserver::OnPACScriptError,
101 42, string16())); 101 42, string16()));
102 thread.Stop(); 102 thread.Stop();
103 MessageLoop::current()->RunAllPending(); 103 MessageLoop::current()->RunAllPending();
104 // Shouldn't have crashed until here... 104 // Shouldn't have crashed until here...
105 } 105 }
106 106
107 } // namespace net 107 } // namespace net
OLDNEW
« no previous file with comments | « net/base/network_delegate.cc ('k') | net/url_request/url_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698