Chromium Code Reviews| 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 #ifndef NET_BASE_LOAD_TIMING_INFO_TEST_UTIL_H_ | 5 #ifndef NET_BASE_LOAD_TIMING_INFO_TEST_UTIL_H_ |
| 6 #define NET_BASE_LOAD_TIMING_INFO_TEST_UTIL_H_ | 6 #define NET_BASE_LOAD_TIMING_INFO_TEST_UTIL_H_ |
| 7 | 7 |
| 8 #include "net/base/load_timing_info.h" | 8 #include "net/base/load_timing_info.h" |
| 9 | 9 |
| 10 namespace net { | 10 namespace net { |
| 11 | 11 |
| 12 // Flags indicating which times in a LoadTimingInfo::ConnectTiming struct should | 12 // Flags indicating which times in a LoadTimingInfo::ConnectTiming struct should |
| 13 // be non-null. | 13 // be non-null. |
| 14 enum ConnectTimeFlags { | 14 enum ConnectTimeFlags { |
| 15 CONNECT_TIMING_HAS_CONNECT_TIMES_ONLY = 0, | 15 CONNECT_TIMING_HAS_CONNECT_TIMES_ONLY = 0, |
| 16 CONNECT_TIMING_HAS_DNS_TIMES = 1 << 0, | 16 CONNECT_TIMING_HAS_DNS_TIMES = 1 << 0, |
| 17 CONNECT_TIMING_HAS_SSL_TIMES = 1 << 1, | 17 CONNECT_TIMING_HAS_SSL_TIMES = 1 << 1, |
|
davidben
2014/10/10 20:24:16
No action: loses some alignment, but I think eithe
| |
| 18 }; | 18 }; |
| 19 | 19 |
| 20 // Checks that all times in |connect_timing| are null. | 20 // Checks that all times in |connect_timing| are null. |
| 21 void ExpectConnectTimingHasNoTimes( | 21 void ExpectConnectTimingHasNoTimes( |
| 22 const LoadTimingInfo::ConnectTiming& connect_timing); | 22 const LoadTimingInfo::ConnectTiming& connect_timing); |
| 23 | 23 |
| 24 // Checks that |connect_timing|'s times are in the correct order. | 24 // Checks that |connect_timing|'s times are in the correct order. |
| 25 // |connect_start| and |connect_end| must be non-null. Checks null state and | 25 // |connect_start| and |connect_end| must be non-null. Checks null state and |
| 26 // order of DNS times and SSL times based on |flags|, which must be a | 26 // order of DNS times and SSL times based on |flags|, which must be a |
| 27 // combination of ConnectTimeFlags. | 27 // combination of ConnectTimeFlags. |
| 28 void ExpectConnectTimingHasTimes( | 28 void ExpectConnectTimingHasTimes( |
| 29 const LoadTimingInfo::ConnectTiming& connect_timing, | 29 const LoadTimingInfo::ConnectTiming& connect_timing, |
| 30 int connect_timing_flags); | 30 int connect_timing_flags); |
| 31 | 31 |
| 32 // Tests that all non-connection establishment times in |load_timing_info| are | 32 // Tests that all non-connection establishment times in |load_timing_info| are |
| 33 // null. Its |connect_timing| field is ignored. | 33 // null. Its |connect_timing| field is ignored. |
| 34 void ExpectLoadTimingHasOnlyConnectionTimes( | 34 void ExpectLoadTimingHasOnlyConnectionTimes( |
| 35 const LoadTimingInfo& load_timing_info); | 35 const LoadTimingInfo& load_timing_info); |
| 36 | 36 |
| 37 } // namespace net | 37 } // namespace net |
| 38 | 38 |
| 39 #endif // NET_BASE_LOAD_TIMING_INFO_TEST_UTIL_H_ | 39 #endif // NET_BASE_LOAD_TIMING_INFO_TEST_UTIL_H_ |
| OLD | NEW |