OLD | NEW |
1 // Copyright (c) 2011 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/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/process.h" | 10 #include "base/process.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 virtual void OnReceivedData(const char* data, | 60 virtual void OnReceivedData(const char* data, |
61 int data_length, | 61 int data_length, |
62 int encoded_data_length) { | 62 int encoded_data_length) { |
63 EXPECT_FALSE(complete_); | 63 EXPECT_FALSE(complete_); |
64 data_.append(data, data_length); | 64 data_.append(data, data_length); |
65 total_encoded_data_length_ += encoded_data_length; | 65 total_encoded_data_length_ += encoded_data_length; |
66 } | 66 } |
67 | 67 |
68 virtual void OnCompletedRequest(const net::URLRequestStatus& status, | 68 virtual void OnCompletedRequest(const net::URLRequestStatus& status, |
69 const std::string& security_info, | 69 const std::string& security_info, |
70 const base::Time& completion_time) { | 70 const base::TimeTicks& completion_time) { |
71 EXPECT_FALSE(complete_); | 71 EXPECT_FALSE(complete_); |
72 complete_ = true; | 72 complete_ = true; |
73 } | 73 } |
74 | 74 |
75 bool complete() const { | 75 bool complete() const { |
76 return complete_; | 76 return complete_; |
77 } | 77 } |
78 const std::string& data() const { | 78 const std::string& data() const { |
79 return data_; | 79 return data_; |
80 } | 80 } |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 | 291 |
292 virtual void OnReceivedData(const char* data, | 292 virtual void OnReceivedData(const char* data, |
293 int data_length, | 293 int data_length, |
294 int encoded_data_length) { | 294 int encoded_data_length) { |
295 EXPECT_EQ(defer_loading_, false); | 295 EXPECT_EQ(defer_loading_, false); |
296 set_defer_loading(false); | 296 set_defer_loading(false); |
297 } | 297 } |
298 | 298 |
299 virtual void OnCompletedRequest(const net::URLRequestStatus& status, | 299 virtual void OnCompletedRequest(const net::URLRequestStatus& status, |
300 const std::string& security_info, | 300 const std::string& security_info, |
301 const base::Time& completion_time) { | 301 const base::TimeTicks& completion_time) { |
302 } | 302 } |
303 | 303 |
304 protected: | 304 protected: |
305 virtual void SetUp() { | 305 virtual void SetUp() { |
306 ResourceDispatcherTest::SetUp(); | 306 ResourceDispatcherTest::SetUp(); |
307 shared_handle_.Delete(kShmemSegmentName); | 307 shared_handle_.Delete(kShmemSegmentName); |
308 EXPECT_TRUE(shared_handle_.CreateNamed(kShmemSegmentName, false, 100)); | 308 EXPECT_TRUE(shared_handle_.CreateNamed(kShmemSegmentName, false, 100)); |
309 } | 309 } |
310 | 310 |
311 virtual void TearDown() { | 311 virtual void TearDown() { |
(...skipping 21 matching lines...) Expand all Loading... |
333 | 333 |
334 ResourceLoaderBridge* bridge = CreateBridge(); | 334 ResourceLoaderBridge* bridge = CreateBridge(); |
335 | 335 |
336 bridge->Start(this); | 336 bridge->Start(this); |
337 InitMessages(); | 337 InitMessages(); |
338 | 338 |
339 // Dispatch deferred messages. | 339 // Dispatch deferred messages. |
340 message_loop.RunAllPending(); | 340 message_loop.RunAllPending(); |
341 delete bridge; | 341 delete bridge; |
342 } | 342 } |
OLD | NEW |