| 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 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 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 GURL* new_first_party_for_cookies) { |
| 39 *new_first_party_for_cookies = GURL(); |
| 38 return true; | 40 return true; |
| 39 } | 41 } |
| 40 | 42 |
| 41 virtual void OnReceivedResponse( | 43 virtual void OnReceivedResponse( |
| 42 const ResourceLoaderBridge::ResponseInfo& info, | 44 const ResourceLoaderBridge::ResponseInfo& info, |
| 43 bool content_filtered) { | 45 bool content_filtered) { |
| 44 } | 46 } |
| 45 | 47 |
| 46 virtual void OnReceivedData(const char* data, int len) { | 48 virtual void OnReceivedData(const char* data, int len) { |
| 47 EXPECT_FALSE(complete_); | 49 EXPECT_FALSE(complete_); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 // ResourceLoaderBridge::Peer methods. | 238 // ResourceLoaderBridge::Peer methods. |
| 237 virtual void OnReceivedResponse( | 239 virtual void OnReceivedResponse( |
| 238 const ResourceLoaderBridge::ResponseInfo& info, | 240 const ResourceLoaderBridge::ResponseInfo& info, |
| 239 bool content_filtered) { | 241 bool content_filtered) { |
| 240 EXPECT_EQ(defer_loading_, false); | 242 EXPECT_EQ(defer_loading_, false); |
| 241 set_defer_loading(true); | 243 set_defer_loading(true); |
| 242 } | 244 } |
| 243 | 245 |
| 244 virtual bool OnReceivedRedirect( | 246 virtual bool OnReceivedRedirect( |
| 245 const GURL& new_url, | 247 const GURL& new_url, |
| 246 const ResourceLoaderBridge::ResponseInfo& info) { | 248 const ResourceLoaderBridge::ResponseInfo& info, |
| 249 GURL* new_first_party_for_cookies) { |
| 250 *new_first_party_for_cookies = GURL(); |
| 247 return true; | 251 return true; |
| 248 } | 252 } |
| 249 | 253 |
| 250 virtual void OnReceivedData(const char* data, int len) { | 254 virtual void OnReceivedData(const char* data, int len) { |
| 251 EXPECT_EQ(defer_loading_, false); | 255 EXPECT_EQ(defer_loading_, false); |
| 252 set_defer_loading(false); | 256 set_defer_loading(false); |
| 253 } | 257 } |
| 254 | 258 |
| 255 virtual void OnUploadProgress(uint64 position, uint64 size) { | 259 virtual void OnUploadProgress(uint64 position, uint64 size) { |
| 256 } | 260 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 ResourceLoaderBridge* bridge = CreateBridge(); | 299 ResourceLoaderBridge* bridge = CreateBridge(); |
| 296 | 300 |
| 297 bridge->Start(this); | 301 bridge->Start(this); |
| 298 InitMessages(); | 302 InitMessages(); |
| 299 | 303 |
| 300 // Dispatch deferred messages. | 304 // Dispatch deferred messages. |
| 301 message_loop.RunAllPending(); | 305 message_loop.RunAllPending(); |
| 302 delete bridge; | 306 delete bridge; |
| 303 } | 307 } |
| 304 | 308 |
| OLD | NEW |