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/location.h" | 9 #include "base/location.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 bool OnCanGetCookies(const URLRequest& request, | 66 bool OnCanGetCookies(const URLRequest& request, |
67 const CookieList& cookie_list) override { | 67 const CookieList& cookie_list) override { |
68 return true; | 68 return true; |
69 } | 69 } |
70 bool OnCanSetCookie(const URLRequest& request, | 70 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 bool OnCanAccessFile(const URLRequest& request, | 75 bool OnCanAccessFile(const URLRequest& request, |
76 const base::FilePath& path) const override { | 76 const base::FilePath& original_path, |
| 77 const base::FilePath& absolute_path) const override { |
77 return true; | 78 return true; |
78 } | 79 } |
79 | 80 |
80 bool got_pac_error_; | 81 bool got_pac_error_; |
81 }; | 82 }; |
82 | 83 |
83 // Check that the OnPACScriptError method can be called from an arbitrary | 84 // Check that the OnPACScriptError method can be called from an arbitrary |
84 // thread. | 85 // thread. |
85 TEST(NetworkDelegateErrorObserverTest, CallOnThread) { | 86 TEST(NetworkDelegateErrorObserverTest, CallOnThread) { |
86 base::Thread thread("test_thread"); | 87 base::Thread thread("test_thread"); |
(...skipping 19 matching lines...) Expand all Loading... |
106 FROM_HERE, base::Bind(&NetworkDelegateErrorObserver::OnPACScriptError, | 107 FROM_HERE, base::Bind(&NetworkDelegateErrorObserver::OnPACScriptError, |
107 base::Unretained(&observer), 42, base::string16())); | 108 base::Unretained(&observer), 42, base::string16())); |
108 thread.Stop(); | 109 thread.Stop(); |
109 base::RunLoop().RunUntilIdle(); | 110 base::RunLoop().RunUntilIdle(); |
110 // Shouldn't have crashed until here... | 111 // Shouldn't have crashed until here... |
111 } | 112 } |
112 | 113 |
113 } // namespace | 114 } // namespace |
114 | 115 |
115 } // namespace net | 116 } // namespace net |
OLD | NEW |