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

Side by Side Diff: components/cronet/android/test/javatests/src/org/chromium/net/MetricsTestUtil.java

Issue 2401933002: Rename RequestFinishedInfo.Metrics.getResponseEnd() to getRequestEnd() (Closed)
Patch Set: Created 4 years, 2 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 package org.chromium.net; 5 package org.chromium.net;
6 6
7 import static junit.framework.Assert.assertNotNull; 7 import static junit.framework.Assert.assertNotNull;
8 import static junit.framework.Assert.assertNull; 8 import static junit.framework.Assert.assertNull;
9 import static junit.framework.Assert.assertTrue; 9 import static junit.framework.Assert.assertTrue;
10 10
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 public static void checkTimingMetrics( 102 public static void checkTimingMetrics(
103 RequestFinishedInfo.Metrics metrics, Date startTime, Date endTime) { 103 RequestFinishedInfo.Metrics metrics, Date startTime, Date endTime) {
104 assertNotNull(metrics.getRequestStart()); 104 assertNotNull(metrics.getRequestStart());
105 assertAfter(metrics.getRequestStart(), startTime); 105 assertAfter(metrics.getRequestStart(), startTime);
106 assertNotNull(metrics.getSendingStart()); 106 assertNotNull(metrics.getSendingStart());
107 assertAfter(metrics.getSendingStart(), startTime); 107 assertAfter(metrics.getSendingStart(), startTime);
108 assertNotNull(metrics.getSendingEnd()); 108 assertNotNull(metrics.getSendingEnd());
109 assertTrue(metrics.getSendingEnd().before(endTime)); 109 assertTrue(metrics.getSendingEnd().before(endTime));
110 assertNotNull(metrics.getResponseStart()); 110 assertNotNull(metrics.getResponseStart());
111 assertTrue(metrics.getResponseStart().after(startTime)); 111 assertTrue(metrics.getResponseStart().after(startTime));
112 assertNotNull(metrics.getResponseEnd()); 112 assertNotNull(metrics.getRequestEnd());
113 assertAfter(endTime, metrics.getResponseEnd()); 113 assertAfter(endTime, metrics.getRequestEnd());
114 // Entire request should take more than 0 ms 114 // Entire request should take more than 0 ms
115 assertTrue(metrics.getResponseEnd().getTime() - metrics.getRequestStart( ).getTime() > 0); 115 assertTrue(metrics.getRequestEnd().getTime() - metrics.getRequestStart() .getTime() > 0);
116 } 116 }
117 117
118 /** 118 /**
119 * Check that the timing metrics which come from net::LoadTimingInfo::Connec tTiming exist, 119 * Check that the timing metrics which come from net::LoadTimingInfo::Connec tTiming exist,
120 * except SSL times in the case of non-https requests. 120 * except SSL times in the case of non-https requests.
121 */ 121 */
122 public static void checkHasConnectTiming( 122 public static void checkHasConnectTiming(
123 RequestFinishedInfo.Metrics metrics, Date startTime, Date endTime, b oolean isSsl) { 123 RequestFinishedInfo.Metrics metrics, Date startTime, Date endTime, b oolean isSsl) {
124 assertNotNull(metrics.getDnsStart()); 124 assertNotNull(metrics.getDnsStart());
125 assertAfter(metrics.getDnsStart(), startTime); 125 assertAfter(metrics.getDnsStart(), startTime);
(...skipping 19 matching lines...) Expand all
145 */ 145 */
146 public static void checkNoConnectTiming(RequestFinishedInfo.Metrics metrics) { 146 public static void checkNoConnectTiming(RequestFinishedInfo.Metrics metrics) {
147 assertNull(metrics.getDnsStart()); 147 assertNull(metrics.getDnsStart());
148 assertNull(metrics.getDnsEnd()); 148 assertNull(metrics.getDnsEnd());
149 assertNull(metrics.getSslStart()); 149 assertNull(metrics.getSslStart());
150 assertNull(metrics.getSslEnd()); 150 assertNull(metrics.getSslEnd());
151 assertNull(metrics.getConnectStart()); 151 assertNull(metrics.getConnectStart());
152 assertNull(metrics.getConnectEnd()); 152 assertNull(metrics.getConnectEnd());
153 } 153 }
154 } 154 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698