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

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

Issue 10440119: Introduce a delegate to avoid hardcoding "chrome-extension" in net/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review nit and merge to LKGR for commit. Created 8 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « net/base/network_delegate.cc ('k') | net/proxy/proxy_script_fetcher_impl_unittest.cc » ('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) 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 } 69 }
70 virtual bool OnCanSetCookie(const URLRequest& request, 70 virtual bool OnCanSetCookie(const URLRequest& request,
71 const std::string& cookie_line, 71 const std::string& cookie_line,
72 CookieOptions* options) OVERRIDE { 72 CookieOptions* options) OVERRIDE {
73 return true; 73 return true;
74 } 74 }
75 virtual bool OnCanAccessFile(const net::URLRequest& request, 75 virtual bool OnCanAccessFile(const net::URLRequest& request,
76 const FilePath& path) const OVERRIDE { 76 const FilePath& path) const OVERRIDE {
77 return true; 77 return true;
78 } 78 }
79 virtual bool OnCanThrottleRequest(const URLRequest& request) const OVERRIDE {
80 return false;
81 }
79 82
80 bool got_pac_error_; 83 bool got_pac_error_;
81 }; 84 };
82 85
83 } // namespace 86 } // namespace
84 87
85 // Check that the OnPACScriptError method can be called from an arbitrary 88 // Check that the OnPACScriptError method can be called from an arbitrary
86 // thread. 89 // thread.
87 TEST(NetworkDelegateErrorObserverTest, CallOnThread) { 90 TEST(NetworkDelegateErrorObserverTest, CallOnThread) {
88 base::Thread thread("test_thread"); 91 base::Thread thread("test_thread");
(...skipping 20 matching lines...) Expand all
109 thread.message_loop()->PostTask( 112 thread.message_loop()->PostTask(
110 FROM_HERE, 113 FROM_HERE,
111 base::Bind(&NetworkDelegateErrorObserver::OnPACScriptError, 114 base::Bind(&NetworkDelegateErrorObserver::OnPACScriptError,
112 base::Unretained(&observer), 42, string16())); 115 base::Unretained(&observer), 42, string16()));
113 thread.Stop(); 116 thread.Stop();
114 MessageLoop::current()->RunAllPending(); 117 MessageLoop::current()->RunAllPending();
115 // Shouldn't have crashed until here... 118 // Shouldn't have crashed until here...
116 } 119 }
117 120
118 } // namespace net 121 } // namespace net
OLDNEW
« no previous file with comments | « net/base/network_delegate.cc ('k') | net/proxy/proxy_script_fetcher_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698