OLD | NEW |
---|---|
1 // Copyright (c) 2010 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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/ref_counted.h" | 8 #include "base/ref_counted.h" |
9 #include "base/string_split.h" | 9 #include "base/string_split.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
11 #include "googleurl/src/gurl.h" | 11 #include "googleurl/src/gurl.h" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
170 if (allow_all_cookies_) | 170 if (allow_all_cookies_) |
171 callback->Run(OK); | 171 callback->Run(OK); |
172 else | 172 else |
173 callback->Run(ERR_ACCESS_DENIED); | 173 callback->Run(ERR_ACCESS_DENIED); |
174 } | 174 } |
175 | 175 |
176 bool allow_all_cookies_; | 176 bool allow_all_cookies_; |
177 CompletionCallback* callback_; | 177 CompletionCallback* callback_; |
178 }; | 178 }; |
179 | 179 |
180 class MockURLRequestContext : public URLRequestContext { | 180 class MockURLRequestContext : public net::URLRequestContext { |
wtc
2011/01/15 17:54:23
Undo this change (already in the 'net' namespace).
| |
181 public: | 181 public: |
182 MockURLRequestContext(CookieStore* cookie_store, | 182 MockURLRequestContext(CookieStore* cookie_store, |
183 CookiePolicy* cookie_policy) { | 183 CookiePolicy* cookie_policy) { |
184 cookie_store_ = cookie_store; | 184 cookie_store_ = cookie_store; |
185 cookie_policy_ = cookie_policy; | 185 cookie_policy_ = cookie_policy; |
186 } | 186 } |
187 | 187 |
188 private: | 188 private: |
189 friend class base::RefCountedThreadSafe<MockURLRequestContext>; | 189 friend class base::RefCountedThreadSafe<MockURLRequestContext>; |
190 virtual ~MockURLRequestContext() {} | 190 virtual ~MockURLRequestContext() {} |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
515 EXPECT_EQ(2U, cookie_store_->entries().size()); | 515 EXPECT_EQ(2U, cookie_store_->entries().size()); |
516 EXPECT_EQ(cookieUrl, cookie_store_->entries()[0].url); | 516 EXPECT_EQ(cookieUrl, cookie_store_->entries()[0].url); |
517 EXPECT_EQ("CR-test=1", cookie_store_->entries()[0].cookie_line); | 517 EXPECT_EQ("CR-test=1", cookie_store_->entries()[0].cookie_line); |
518 EXPECT_EQ(cookieUrl, cookie_store_->entries()[1].url); | 518 EXPECT_EQ(cookieUrl, cookie_store_->entries()[1].url); |
519 EXPECT_EQ("CR-test-httponly=1", cookie_store_->entries()[1].cookie_line); | 519 EXPECT_EQ("CR-test-httponly=1", cookie_store_->entries()[1].cookie_line); |
520 | 520 |
521 CloseWebSocketJob(); | 521 CloseWebSocketJob(); |
522 } | 522 } |
523 | 523 |
524 } // namespace net | 524 } // namespace net |
OLD | NEW |