Home | History | Annotate | Download | only in base
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef NET_BASE_LOAD_TIMING_INFO_TEST_UTIL_H_
      6 #define NET_BASE_LOAD_TIMING_INFO_TEST_UTIL_H_
      7 
      8 #include "net/base/load_timing_info.h"
      9 
     10 namespace net {
     11 
     12 // Flags indicating which times in a LoadTimingInfo::ConnectTiming struct should
     13 // be non-null.
     14 enum ConnectTimeFlags {
     15   CONNECT_TIMING_HAS_CONNECT_TIMES_ONLY = 0,
     16   CONNECT_TIMING_HAS_DNS_TIMES          = 1 << 0,
     17   CONNECT_TIMING_HAS_SSL_TIMES          = 1 << 1,
     18 };
     19 
     20 // Checks that all times in |connect_timing| are null.
     21 void ExpectConnectTimingHasNoTimes(
     22     const LoadTimingInfo::ConnectTiming& connect_timing);
     23 
     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
     26 // order of DNS times and SSL times based on |flags|, which must be a
     27 // combination of ConnectTimeFlags.
     28 void ExpectConnectTimingHasTimes(
     29     const LoadTimingInfo::ConnectTiming& connect_timing,
     30     int connect_timing_flags);
     31 
     32 // Tests that all non-connection establishment times in |load_timing_info| are
     33 // null.  Its |connect_timing| field is ignored.
     34 void ExpectLoadTimingHasOnlyConnectionTimes(
     35     const LoadTimingInfo& load_timing_info);
     36 
     37 }  // namespace net
     38 
     39 #endif  // NET_BASE_LOAD_TIMING_INFO_TEST_UTIL_H_
     40