| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/process.h" | 9 #include "base/process.h" |
| 10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 // Listens for request response data and stores it so that it can be compared | 28 // Listens for request response data and stores it so that it can be compared |
| 29 // to the reference data. | 29 // to the reference data. |
| 30 class TestRequestCallback : public ResourceLoaderBridge::Peer { | 30 class TestRequestCallback : public ResourceLoaderBridge::Peer { |
| 31 public: | 31 public: |
| 32 TestRequestCallback() : complete_(false) { | 32 TestRequestCallback() : complete_(false) { |
| 33 } | 33 } |
| 34 | 34 |
| 35 virtual bool OnReceivedRedirect( | 35 virtual bool OnReceivedRedirect( |
| 36 const GURL& new_url, | 36 const GURL& new_url, |
| 37 const ResourceLoaderBridge::ResponseInfo& info, | 37 const ResourceLoaderBridge::ResponseInfo& info, |
| 38 bool* has_new_first_party_for_cookies, |
| 38 GURL* new_first_party_for_cookies) { | 39 GURL* new_first_party_for_cookies) { |
| 39 *new_first_party_for_cookies = GURL(); | 40 *has_new_first_party_for_cookies = false; |
| 40 return true; | 41 return true; |
| 41 } | 42 } |
| 42 | 43 |
| 43 virtual void OnReceivedResponse( | 44 virtual void OnReceivedResponse( |
| 44 const ResourceLoaderBridge::ResponseInfo& info, | 45 const ResourceLoaderBridge::ResponseInfo& info, |
| 45 bool content_filtered) { | 46 bool content_filtered) { |
| 46 } | 47 } |
| 47 | 48 |
| 48 virtual void OnReceivedData(const char* data, int len) { | 49 virtual void OnReceivedData(const char* data, int len) { |
| 49 EXPECT_FALSE(complete_); | 50 EXPECT_FALSE(complete_); |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 virtual void OnReceivedResponse( | 240 virtual void OnReceivedResponse( |
| 240 const ResourceLoaderBridge::ResponseInfo& info, | 241 const ResourceLoaderBridge::ResponseInfo& info, |
| 241 bool content_filtered) { | 242 bool content_filtered) { |
| 242 EXPECT_EQ(defer_loading_, false); | 243 EXPECT_EQ(defer_loading_, false); |
| 243 set_defer_loading(true); | 244 set_defer_loading(true); |
| 244 } | 245 } |
| 245 | 246 |
| 246 virtual bool OnReceivedRedirect( | 247 virtual bool OnReceivedRedirect( |
| 247 const GURL& new_url, | 248 const GURL& new_url, |
| 248 const ResourceLoaderBridge::ResponseInfo& info, | 249 const ResourceLoaderBridge::ResponseInfo& info, |
| 250 bool* has_new_first_party_for_cookies, |
| 249 GURL* new_first_party_for_cookies) { | 251 GURL* new_first_party_for_cookies) { |
| 250 *new_first_party_for_cookies = GURL(); | 252 *has_new_first_party_for_cookies = false; |
| 251 return true; | 253 return true; |
| 252 } | 254 } |
| 253 | 255 |
| 254 virtual void OnReceivedData(const char* data, int len) { | 256 virtual void OnReceivedData(const char* data, int len) { |
| 255 EXPECT_EQ(defer_loading_, false); | 257 EXPECT_EQ(defer_loading_, false); |
| 256 set_defer_loading(false); | 258 set_defer_loading(false); |
| 257 } | 259 } |
| 258 | 260 |
| 259 virtual void OnUploadProgress(uint64 position, uint64 size) { | 261 virtual void OnUploadProgress(uint64 position, uint64 size) { |
| 260 } | 262 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 ResourceLoaderBridge* bridge = CreateBridge(); | 301 ResourceLoaderBridge* bridge = CreateBridge(); |
| 300 | 302 |
| 301 bridge->Start(this); | 303 bridge->Start(this); |
| 302 InitMessages(); | 304 InitMessages(); |
| 303 | 305 |
| 304 // Dispatch deferred messages. | 306 // Dispatch deferred messages. |
| 305 message_loop.RunAllPending(); | 307 message_loop.RunAllPending(); |
| 306 delete bridge; | 308 delete bridge; |
| 307 } | 309 } |
| 308 | 310 |
| OLD | NEW |