Delete chrome.mediaGalleriesPrivate because the functionality unique to it has since...
[chromium-blink-merge.git] / tools / perf / measurements / oilpan_gc_times_unittest.py
blobae359758d27c9db6134da4adb7f6fb445c8732b5
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.
5 from measurements import oilpan_gc_times
6 from telemetry.unittest_util import options_for_unittests
7 from telemetry.unittest_util import page_test_test_case
9 class OilpanGCTimesTest(page_test_test_case.PageTestTestCase):
10 """Smoke test for Oilpan GC pause time measurements.
12 Runs OilpanGCTimes measurement on some simple pages and verifies
13 that all metrics were added to the results. The test is purely functional,
14 i.e. it only checks if the metrics are present and non-zero.
15 """
16 def setUp(self):
17 self._options = options_for_unittests.GetCopy()
19 def testForSmoothness(self):
20 ps = self.CreatePageSetFromFileInUnittestDataDir('create_many_objects.html')
21 measurement = oilpan_gc_times.OilpanGCTimesForSmoothness()
22 results = self.RunMeasurement(measurement, ps, options=self._options)
23 self.assertEquals(0, len(results.failures))
25 precise = results.FindAllPageSpecificValuesNamed('oilpan_precise_mark')
26 conservative = results.FindAllPageSpecificValuesNamed(
27 'oilpan_conservative_mark')
28 self.assertLess(0, len(precise) + len(conservative))
30 def testForBlinkPerf(self):
31 ps = self.CreatePageSetFromFileInUnittestDataDir('create_many_objects.html')
32 measurement = oilpan_gc_times.OilpanGCTimesForBlinkPerf()
33 results = self.RunMeasurement(measurement, ps, options=self._options)
34 self.assertEquals(0, len(results.failures))
36 precise = results.FindAllPageSpecificValuesNamed('oilpan_precise_mark')
37 conservative = results.FindAllPageSpecificValuesNamed(
38 'oilpan_conservative_mark')
39 self.assertLess(0, len(precise) + len(conservative))