| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 // net::URLRequestJobFactory::ProtocolHandler implementation: | 246 // net::URLRequestJobFactory::ProtocolHandler implementation: |
| 247 net::URLRequestJob* MaybeInterceptRequest( | 247 net::URLRequestJob* MaybeInterceptRequest( |
| 248 net::URLRequest* request, | 248 net::URLRequest* request, |
| 249 net::NetworkDelegate* network_delegate) const override { | 249 net::NetworkDelegate* network_delegate) const override { |
| 250 EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 250 EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 251 | 251 |
| 252 return new MockUrlRequestJobWithTiming(request, network_delegate, path_, | 252 return new MockUrlRequestJobWithTiming(request, network_delegate, path_, |
| 253 load_timing_deltas_); | 253 load_timing_deltas_); |
| 254 } | 254 } |
| 255 | 255 |
| 256 net::URLRequestJob* MaybeInterceptResponse( |
| 257 net::URLRequest* request, |
| 258 net::NetworkDelegate* network_delegate) const override { |
| 259 return NULL; |
| 260 } |
| 261 |
| 262 net::URLRequestJob* MaybeInterceptRedirect( |
| 263 net::URLRequest* request, |
| 264 net::NetworkDelegate* network_delegate, |
| 265 const GURL& location) const override { |
| 266 return NULL; |
| 267 } |
| 268 |
| 256 private: | 269 private: |
| 257 // Path of the file to use as the response body. | 270 // Path of the file to use as the response body. |
| 258 const base::FilePath path_; | 271 const base::FilePath path_; |
| 259 | 272 |
| 260 // Load times for each request to use, relative to when the Job starts. | 273 // Load times for each request to use, relative to when the Job starts. |
| 261 const TimingDeltas load_timing_deltas_; | 274 const TimingDeltas load_timing_deltas_; |
| 262 | 275 |
| 263 DISALLOW_COPY_AND_ASSIGN(TestInterceptor); | 276 DISALLOW_COPY_AND_ASSIGN(TestInterceptor); |
| 264 }; | 277 }; |
| 265 | 278 |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 navigation_deltas.send_start.GetDelta()); | 601 navigation_deltas.send_start.GetDelta()); |
| 589 // The only times that are guaranteed to be distinct are send_start and | 602 // The only times that are guaranteed to be distinct are send_start and |
| 590 // received_headers_end. | 603 // received_headers_end. |
| 591 EXPECT_LT(navigation_deltas.send_start.GetDelta(), | 604 EXPECT_LT(navigation_deltas.send_start.GetDelta(), |
| 592 navigation_deltas.receive_headers_end.GetDelta()); | 605 navigation_deltas.receive_headers_end.GetDelta()); |
| 593 | 606 |
| 594 EXPECT_TRUE(navigation_deltas.ssl_start.is_null()); | 607 EXPECT_TRUE(navigation_deltas.ssl_start.is_null()); |
| 595 } | 608 } |
| 596 | 609 |
| 597 } // namespace | 610 } // namespace |
| OLD | NEW |