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

Side by Side Diff: tools/perf/measurements/__init__.py

Issue 714273004: mac: Expose keychain access frequency to Telemetry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mock_keychain_sleep
Patch Set: Add a common subclass to measurements. Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
(Empty)
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 import sys
6
7 from metrics import keychain_metric
8 from telemetry.page import page_test
9
10 class PageTestMeasurement(page_test.PageTest):
jeremy 2014/11/13 11:31:30 I'd just add the flag and stat as part of the info
erikchen 2014/11/13 18:11:09 I'm not sure that I understand your comment. I tho
11 """Base class for all telemetry measurements based on page_test."""
12
13 def __init__(self, *args, **kwargs):
14 super(PageTestMeasurement, self).__init__(*args, **kwargs)
15 self._in_unit_test = False
16
17 def CustomizeBrowserOptions(self, options):
18 """When subclasses override this method, they must still call this class's
19 implementation.
20 """
21 if sys.platform == 'darwin' and not self._in_unit_test:
22 options.AppendExtraBrowserArgs([
23 '--enable-stats-collection-bindings'
jeremy 2014/11/13 11:31:30 Is there a reason we need to collect this for test
erikchen 2014/11/13 22:52:59 Yes, as per our offline discussion. We will want a
24 ])
25
26 def ValidateAndMeasurePage(self, page, tab, results):
27 """When subclasses override this method, they must still call this class's
28 implementation.
29 """
30 if sys.platform == 'darwin' and not self._in_unit_test:
31 keychain_metric.KeychainMetric().AddResults(tab, results)
32
33 def SetInUnitTest(self):
34 self._in_unit_test = True
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698