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

Unified Diff: tools/perf/measurements/oilpan_gc_times_unittest.py

Issue 1124033004: [Telemetry] Kill PageTest.DidRunActions hook. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix task_execution_time. Thanks unittest! Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/perf/measurements/oilpan_gc_times.py ('k') | tools/perf/measurements/task_execution_time.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/measurements/oilpan_gc_times_unittest.py
diff --git a/tools/perf/measurements/oilpan_gc_times_unittest.py b/tools/perf/measurements/oilpan_gc_times_unittest.py
index 9b448d8314f459beba0cdf6170ecb0a34a3eea73..87e1bcda9318e49ce384261a3fbd4a08a5558575 100644
--- a/tools/perf/measurements/oilpan_gc_times_unittest.py
+++ b/tools/perf/measurements/oilpan_gc_times_unittest.py
@@ -4,6 +4,7 @@
from measurements import oilpan_gc_times
+from telemetry.core import util
from telemetry.results import page_test_results
from telemetry.timeline import model
from telemetry.timeline import slice as slice_data
@@ -11,6 +12,9 @@ from telemetry.unittest_util import options_for_unittests
from telemetry.unittest_util import page_test_test_case
from telemetry.page import page as page_module
+util.AddDirToPythonPath(util.GetTelemetryDir(), 'third_party', 'mock')
+import mock # pylint: disable=import-error
+
class TestOilpanGCTimesPage(page_module.Page):
def __init__(self, page_set):
@@ -90,9 +94,12 @@ class OilpanGCTimesTest(page_test_test_case.PageTestTestCase):
data = self._GenerateDataForParsingOldFormat()
measurement = oilpan_gc_times._OilpanGCTimesBase()
- measurement._renderer_process = data._renderer_process
- measurement._timeline_model = data._model
- measurement.ValidateAndMeasurePage(None, None, data.results)
+
+ tab = mock.MagicMock()
+ with mock.patch(
+ 'measurements.oilpan_gc_times.TimelineModel') as MockTimelineModel:
+ MockTimelineModel.return_value = data._model
+ measurement.ValidateAndMeasurePage(None, tab, data.results)
results = data.results
self.assertEquals(7, len(getMetric(results, 'oilpan_coalesce')))
@@ -121,9 +128,12 @@ class OilpanGCTimesTest(page_test_test_case.PageTestTestCase):
data = self._GenerateDataForParsing()
measurement = oilpan_gc_times._OilpanGCTimesBase()
- measurement._renderer_process = data._renderer_process
measurement._timeline_model = data._model
- measurement.ValidateAndMeasurePage(None, None, data.results)
+ tab = mock.MagicMock()
+ with mock.patch(
+ 'measurements.oilpan_gc_times.TimelineModel') as MockTimelineModel:
+ MockTimelineModel.return_value = data._model
+ measurement.ValidateAndMeasurePage(None, tab, data.results)
results = data.results
self.assertEquals(8, len(getMetric(results, 'oilpan_coalesce')))
« no previous file with comments | « tools/perf/measurements/oilpan_gc_times.py ('k') | tools/perf/measurements/task_execution_time.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698