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

Side by Side Diff: chrome/browser/net/load_timing_browsertest.cc

Issue 686343002: Add MaybeInterceptRedirect/Response to URLRequestInterceptor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added tests, removed DRP Created 6 years, 1 month 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
OLDNEW
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
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* MaybeInterceptRedirect(
257 net::URLRequest* request,
258 net::NetworkDelegate* network_delegate,
259 const GURL& location) const override {
260 return NULL;
261 }
262
263 net::URLRequestJob* MaybeInterceptResponse(
264 net::URLRequest* request,
265 net::NetworkDelegate* network_delegate) 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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 navigation_deltas.send_start.GetDelta()); 600 navigation_deltas.send_start.GetDelta());
588 // The only times that are guaranteed to be distinct are send_start and 601 // The only times that are guaranteed to be distinct are send_start and
589 // received_headers_end. 602 // received_headers_end.
590 EXPECT_LT(navigation_deltas.send_start.GetDelta(), 603 EXPECT_LT(navigation_deltas.send_start.GetDelta(),
591 navigation_deltas.receive_headers_end.GetDelta()); 604 navigation_deltas.receive_headers_end.GetDelta());
592 605
593 EXPECT_TRUE(navigation_deltas.ssl_start.is_null()); 606 EXPECT_TRUE(navigation_deltas.ssl_start.is_null());
594 } 607 }
595 608
596 } // namespace 609 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698