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/proxy/network_delegate_error_observer.h" | 5 #include "net/proxy/network_delegate_error_observer.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 return true; | 77 return true; |
78 } | 78 } |
79 virtual bool OnCanThrottleRequest(const URLRequest& request) const OVERRIDE { | 79 virtual bool OnCanThrottleRequest(const URLRequest& request) const OVERRIDE { |
80 return false; | 80 return false; |
81 } | 81 } |
82 virtual int OnBeforeSocketStreamConnect( | 82 virtual int OnBeforeSocketStreamConnect( |
83 SocketStream* stream, | 83 SocketStream* stream, |
84 const CompletionCallback& callback) OVERRIDE { | 84 const CompletionCallback& callback) OVERRIDE { |
85 return OK; | 85 return OK; |
86 } | 86 } |
87 virtual void OnCacheWaitStateChange(const net::URLRequest& request, | 87 virtual void OnRequestWaitStateChange(const net::URLRequest& request, |
88 CacheWaitState state) OVERRIDE { | 88 RequestWaitState state) OVERRIDE { |
89 } | 89 } |
90 | 90 |
91 bool got_pac_error_; | 91 bool got_pac_error_; |
92 }; | 92 }; |
93 | 93 |
94 } // namespace | 94 } // namespace |
95 | 95 |
96 // Check that the OnPACScriptError method can be called from an arbitrary | 96 // Check that the OnPACScriptError method can be called from an arbitrary |
97 // thread. | 97 // thread. |
98 TEST(NetworkDelegateErrorObserverTest, CallOnThread) { | 98 TEST(NetworkDelegateErrorObserverTest, CallOnThread) { |
(...skipping 21 matching lines...) Expand all Loading... |
120 thread.message_loop()->PostTask( | 120 thread.message_loop()->PostTask( |
121 FROM_HERE, | 121 FROM_HERE, |
122 base::Bind(&NetworkDelegateErrorObserver::OnPACScriptError, | 122 base::Bind(&NetworkDelegateErrorObserver::OnPACScriptError, |
123 base::Unretained(&observer), 42, string16())); | 123 base::Unretained(&observer), 42, string16())); |
124 thread.Stop(); | 124 thread.Stop(); |
125 MessageLoop::current()->RunAllPending(); | 125 MessageLoop::current()->RunAllPending(); |
126 // Shouldn't have crashed until here... | 126 // Shouldn't have crashed until here... |
127 } | 127 } |
128 | 128 |
129 } // namespace net | 129 } // namespace net |
OLD | NEW |