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

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

Issue 9572001: Do cookie checks in NetworkDelegate instead of the URLRequest::Delegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: clang fix Created 8 years, 9 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
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 const string16& error) OVERRIDE { 56 const string16& error) OVERRIDE {
57 got_pac_error_ = true; 57 got_pac_error_ = true;
58 } 58 }
59 virtual AuthRequiredResponse OnAuthRequired( 59 virtual AuthRequiredResponse OnAuthRequired(
60 URLRequest* request, 60 URLRequest* request,
61 const AuthChallengeInfo& auth_info, 61 const AuthChallengeInfo& auth_info,
62 const AuthCallback& callback, 62 const AuthCallback& callback,
63 AuthCredentials* credentials) OVERRIDE { 63 AuthCredentials* credentials) OVERRIDE {
64 return AUTH_REQUIRED_RESPONSE_NO_ACTION; 64 return AUTH_REQUIRED_RESPONSE_NO_ACTION;
65 } 65 }
66 virtual bool OnReadingCookies(
67 const URLRequest* request,
68 const CookieList& cookie_list) {
willchan no longer on Chromium 2012/03/01 20:30:10 OVERRIDE
69 return true;
70 }
71 virtual bool OnSettingCookie(
72 const URLRequest* request,
73 const std::string& cookie_line,
74 CookieOptions* options) {
willchan no longer on Chromium 2012/03/01 20:30:10 OVERRIDE
75 return true;
76 }
66 77
67 bool got_pac_error_; 78 bool got_pac_error_;
68 }; 79 };
69 80
70 } // namespace 81 } // namespace
71 82
72 // Check that the OnPACScriptError method can be called from an arbitrary 83 // Check that the OnPACScriptError method can be called from an arbitrary
73 // thread. 84 // thread.
74 TEST(NetworkDelegateErrorObserverTest, CallOnThread) { 85 TEST(NetworkDelegateErrorObserverTest, CallOnThread) {
75 base::Thread thread("test_thread"); 86 base::Thread thread("test_thread");
(...skipping 20 matching lines...) Expand all
96 thread.message_loop()->PostTask( 107 thread.message_loop()->PostTask(
97 FROM_HERE, 108 FROM_HERE,
98 base::Bind(&NetworkDelegateErrorObserver::OnPACScriptError, 109 base::Bind(&NetworkDelegateErrorObserver::OnPACScriptError,
99 base::Unretained(&observer), 42, string16())); 110 base::Unretained(&observer), 42, string16()));
100 thread.Stop(); 111 thread.Stop();
101 MessageLoop::current()->RunAllPending(); 112 MessageLoop::current()->RunAllPending();
102 // Shouldn't have crashed until here... 113 // Shouldn't have crashed until here...
103 } 114 }
104 115
105 } // namespace net 116 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698