Home | History | Annotate | Download | only in measurements
      1 # Copyright 2014 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 from measurements import loading_trace
      6 from telemetry.core import wpr_modes
      7 from telemetry.unittest import options_for_unittests
      8 from telemetry.unittest import page_test_test_case
      9 
     10 class LoadingTraceUnitTest(page_test_test_case.PageTestTestCase):
     11   def setUp(self):
     12     self._options = options_for_unittests.GetCopy()
     13     self._options.browser_options.wpr_mode = wpr_modes.WPR_OFF
     14 
     15   def testLoadingTraceBasic(self):
     16     ps = self.CreatePageSetFromFileInUnittestDataDir('scrollable_page.html')
     17     measurement = loading_trace.LoadingTrace()
     18     trace_options = self._options
     19     results = self.RunMeasurement(measurement, ps, options = trace_options)
     20     self.assertEquals(0, len(results.failures))
     21 
     22   def testCleanUpTrace(self):
     23     self.TestTracingCleanedUp(loading_trace.LoadingTrace, self._options)
     24