Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(411)

Side by Side Diff: content/common/resource_dispatcher_unittest.cc

Issue 7602023: Use a monotonic clock (TimeTicks) to report network times to WebCore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added comment Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 289
290 virtual void OnReceivedData(const char* data, 290 virtual void OnReceivedData(const char* data,
291 int data_length, 291 int data_length,
292 int encoded_data_length) { 292 int encoded_data_length) {
293 EXPECT_EQ(defer_loading_, false); 293 EXPECT_EQ(defer_loading_, false);
294 set_defer_loading(false); 294 set_defer_loading(false);
295 } 295 }
296 296
297 virtual void OnCompletedRequest(const net::URLRequestStatus& status, 297 virtual void OnCompletedRequest(const net::URLRequestStatus& status,
298 const std::string& security_info, 298 const std::string& security_info,
299 const base::Time& completion_time) { 299 const base::TimeTicks& completion_time) {
300 } 300 }
301 301
302 protected: 302 protected:
303 virtual void SetUp() { 303 virtual void SetUp() {
304 ResourceDispatcherTest::SetUp(); 304 ResourceDispatcherTest::SetUp();
305 shared_handle_.Delete(kShmemSegmentName); 305 shared_handle_.Delete(kShmemSegmentName);
306 EXPECT_TRUE(shared_handle_.CreateNamed(kShmemSegmentName, false, 100)); 306 EXPECT_TRUE(shared_handle_.CreateNamed(kShmemSegmentName, false, 100));
307 } 307 }
308 308
309 virtual void TearDown() { 309 virtual void TearDown() {
(...skipping 21 matching lines...) Expand all
331 331
332 ResourceLoaderBridge* bridge = CreateBridge(); 332 ResourceLoaderBridge* bridge = CreateBridge();
333 333
334 bridge->Start(this); 334 bridge->Start(this);
335 InitMessages(); 335 InitMessages();
336 336
337 // Dispatch deferred messages. 337 // Dispatch deferred messages.
338 message_loop.RunAllPending(); 338 message_loop.RunAllPending();
339 delete bridge; 339 delete bridge;
340 } 340 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698