[Telemetry] Enable import-error, bad-indentation, bad-whitespace lint check.
BUG=475714 Review URL: https://codereview.chromium.org/1125633002 Cr-Commit-Position: refs/heads/master@{#328163}
This commit is contained in:
tools/telemetry
pylintrc
telemetry
benchmark.pybenchmark_runner_unittest.py
core
backends
platform
image_processing
internal
actions
timeline
user_story
util
web_perf
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# Disable the message, report, category or checker with the given id(s).
|
# Disable the message, report, category or checker with the given id(s).
|
||||||
# TODO(telemetry-team): Shrink this list to as small as possible.
|
# TODO(telemetry-team): Shrink this list to as small as possible.
|
||||||
disable=I0010,I0011,abstract-class-little-used,abstract-class-not-used,anomalous-backslash-in-string,bad-builtin,bad-continuation,bad-indentation,bad-str-strip-call,bad-whitespace,broad-except,cell-var-from-loop,deprecated-lambda,deprecated-module,duplicate-code,fixme,global-statement,import-error,interface-not-implemented,invalid-name,locally-enabled,logging-not-lazy,missing-docstring,no-init,no-member,no-name-in-module,no-self-use,not-callable,old-style-class,protected-access,star-args,superfluous-parens,too-few-public-methods,too-many-ancestors,too-many-arguments,too-many-branches,too-many-function-args,too-many-instance-attributes,too-many-lines,too-many-locals,too-many-public-methods,too-many-return-statements,too-many-statements,unpacking-non-sequence,unused-argument
|
disable=I0010,I0011,abstract-class-little-used,abstract-class-not-used,anomalous-backslash-in-string,bad-builtin,bad-continuation,bad-str-strip-call,broad-except,cell-var-from-loop,deprecated-lambda,deprecated-module,duplicate-code,fixme,global-statement,interface-not-implemented,invalid-name,locally-enabled,logging-not-lazy,missing-docstring,no-init,no-member,no-name-in-module,no-self-use,not-callable,old-style-class,protected-access,star-args,superfluous-parens,too-few-public-methods,too-many-ancestors,too-many-arguments,too-many-branches,too-many-function-args,too-many-instance-attributes,too-many-lines,too-many-locals,too-many-public-methods,too-many-return-statements,too-many-statements,unpacking-non-sequence,unused-argument
|
||||||
|
|
||||||
|
|
||||||
[REPORTS]
|
[REPORTS]
|
||||||
|
@ -44,11 +44,11 @@ class BenchmarkMetadata(object):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def description(self):
|
def description(self):
|
||||||
return self._description
|
return self._description
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def rerun_options(self):
|
def rerun_options(self):
|
||||||
return self._rerun_options
|
return self._rerun_options
|
||||||
|
|
||||||
|
|
||||||
class Benchmark(command_line.Command):
|
class Benchmark(command_line.Command):
|
||||||
|
@ -56,7 +56,7 @@ class BenchmarkRunnerUnittest(unittest.TestCase):
|
|||||||
' BarBenchmarkkkkk Benchmark Bar for testing long description line.\n'
|
' BarBenchmarkkkkk Benchmark Bar for testing long description line.\n'
|
||||||
'Pass --browser to list benchmarks for another browser.\n\n')
|
'Pass --browser to list benchmarks for another browser.\n\n')
|
||||||
with mock.patch('telemetry.benchmark_runner.decorators') as mock_module:
|
with mock.patch('telemetry.benchmark_runner.decorators') as mock_module:
|
||||||
def FakeIsEnabled(benchmark_class, _):
|
def FakeIsEnabled(benchmark_class, _):
|
||||||
if benchmark_class is BenchmarkFoo:
|
if benchmark_class is BenchmarkFoo:
|
||||||
return True, None
|
return True, None
|
||||||
else:
|
else:
|
||||||
|
@ -161,7 +161,7 @@ class DevToolsClientBackend(object):
|
|||||||
Raises:
|
Raises:
|
||||||
devtools_http.DevToolsClientConnectionError
|
devtools_http.DevToolsClientConnectionError
|
||||||
"""
|
"""
|
||||||
contexts = self._ListInspectableContexts()
|
contexts = self._ListInspectableContexts()
|
||||||
return tab_id in [c['id'] for c in contexts]
|
return tab_id in [c['id'] for c in contexts]
|
||||||
|
|
||||||
def GetUpdatedInspectableContexts(self):
|
def GetUpdatedInspectableContexts(self):
|
||||||
|
@ -344,7 +344,7 @@ class TrybotBrowserFinderTest(unittest.TestCase):
|
|||||||
|
|
||||||
def test_config_android(self):
|
def test_config_android(self):
|
||||||
config = self._GetConfigForBrowser(
|
config = self._GetConfigForBrowser(
|
||||||
'trybot-android-nexus4', 'android','somebranch',
|
'trybot-android-nexus4', 'android', 'somebranch',
|
||||||
'tools/run-perf-test.cfg')
|
'tools/run-perf-test.cfg')
|
||||||
self.assertEquals(
|
self.assertEquals(
|
||||||
('config = {\n'
|
('config = {\n'
|
||||||
|
@ -153,7 +153,7 @@ class LinuxBasedPlatformBackend(platform_backend.PlatformBackend):
|
|||||||
Multi-CPU machines will have multiple 'jiffies:' lines, all of which will be
|
Multi-CPU machines will have multiple 'jiffies:' lines, all of which will be
|
||||||
essentially the same. Return the first one."""
|
essentially the same. Return the first one."""
|
||||||
jiffies_timer_lines = self.RunCommand(
|
jiffies_timer_lines = self.RunCommand(
|
||||||
['grep', 'jiffies','/proc/timer_list'])
|
['grep', 'jiffies', '/proc/timer_list'])
|
||||||
if not jiffies_timer_lines:
|
if not jiffies_timer_lines:
|
||||||
raise Exception('Unable to find jiffies from /proc/timer_list')
|
raise Exception('Unable to find jiffies from /proc/timer_list')
|
||||||
jiffies_timer_list = jiffies_timer_lines.splitlines()
|
jiffies_timer_list = jiffies_timer_lines.splitlines()
|
||||||
|
@ -66,7 +66,7 @@ jiffies a1111
|
|||||||
result = backend.GetCpuTimestamp()
|
result = backend.GetCpuTimestamp()
|
||||||
self.assertEquals(result, {'TotalTime': 105054633.0})
|
self.assertEquals(result, {'TotalTime': 105054633.0})
|
||||||
mock_method.assert_call_once_with(
|
mock_method.assert_call_once_with(
|
||||||
['grep', '-m', '1', 'jiffies:','/proc/timer_list'])
|
['grep', '-m', '1', 'jiffies:', '/proc/timer_list'])
|
||||||
|
|
||||||
def testGetMemoryStatsBasic(self):
|
def testGetMemoryStatsBasic(self):
|
||||||
if not linux_based_platform_backend.resource:
|
if not linux_based_platform_backend.resource:
|
||||||
|
@ -57,24 +57,24 @@ class PosixPlatformBackendTest(unittest.TestCase):
|
|||||||
posix_platform_backend._BinaryExistsInSudoersFiles(binary_path, ''))
|
posix_platform_backend._BinaryExistsInSudoersFiles(binary_path, ''))
|
||||||
self.assertFalse(
|
self.assertFalse(
|
||||||
posix_platform_backend._BinaryExistsInSudoersFiles(
|
posix_platform_backend._BinaryExistsInSudoersFiles(
|
||||||
binary_path,' (ALL) ALL'))
|
binary_path, ' (ALL) ALL'))
|
||||||
self.assertFalse(
|
self.assertFalse(
|
||||||
posix_platform_backend._BinaryExistsInSudoersFiles(
|
posix_platform_backend._BinaryExistsInSudoersFiles(
|
||||||
binary_path,' (root) NOPASSWD: /usr/bin/pkill_DUMMY'))
|
binary_path, ' (root) NOPASSWD: /usr/bin/pkill_DUMMY'))
|
||||||
self.assertFalse(
|
self.assertFalse(
|
||||||
posix_platform_backend._BinaryExistsInSudoersFiles(
|
posix_platform_backend._BinaryExistsInSudoersFiles(
|
||||||
binary_path,' (root) NOPASSWD: pkill'))
|
binary_path, ' (root) NOPASSWD: pkill'))
|
||||||
|
|
||||||
|
|
||||||
self.assertTrue(
|
self.assertTrue(
|
||||||
posix_platform_backend._BinaryExistsInSudoersFiles(
|
posix_platform_backend._BinaryExistsInSudoersFiles(
|
||||||
binary_path,'(root) NOPASSWD: /usr/bin/pkill'))
|
binary_path, '(root) NOPASSWD: /usr/bin/pkill'))
|
||||||
self.assertTrue(
|
self.assertTrue(
|
||||||
posix_platform_backend._BinaryExistsInSudoersFiles(
|
posix_platform_backend._BinaryExistsInSudoersFiles(
|
||||||
binary_path,' (root) NOPASSWD: /usr/bin/pkill'))
|
binary_path, ' (root) NOPASSWD: /usr/bin/pkill'))
|
||||||
self.assertTrue(
|
self.assertTrue(
|
||||||
posix_platform_backend._BinaryExistsInSudoersFiles(
|
posix_platform_backend._BinaryExistsInSudoersFiles(
|
||||||
binary_path,' (root) NOPASSWD: /usr/bin/pkill arg1 arg2'))
|
binary_path, ' (root) NOPASSWD: /usr/bin/pkill arg1 arg2'))
|
||||||
|
|
||||||
@decorators.Enabled('linux', 'mac')
|
@decorators.Enabled('linux', 'mac')
|
||||||
def testIsApplicationRunning(self):
|
def testIsApplicationRunning(self):
|
||||||
|
@ -50,9 +50,9 @@ class HistogramDistanceTest(unittest.TestCase):
|
|||||||
|
|
||||||
class HistogramTest(unittest.TestCase):
|
class HistogramTest(unittest.TestCase):
|
||||||
def testHistogram(self):
|
def testHistogram(self):
|
||||||
pixels = [1,2,3, 1,2,3, 1,2,3, 1,2,3,
|
pixels = [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3,
|
||||||
1,2,3, 8,7,6, 5,4,6, 1,2,3,
|
1, 2, 3, 8, 7, 6, 5, 4, 6, 1, 2, 3,
|
||||||
1,2,3, 8,7,6, 5,4,6, 1,2,3]
|
1, 2, 3, 8, 7, 6, 5, 4, 6, 1, 2, 3]
|
||||||
bmp = image_util.FromRGBPixels(4, 3, pixels)
|
bmp = image_util.FromRGBPixels(4, 3, pixels)
|
||||||
bmp = image_util.Crop(bmp, 1, 1, 2, 2)
|
bmp = image_util.Crop(bmp, 1, 1, 2, 2)
|
||||||
|
|
||||||
@ -70,9 +70,9 @@ class HistogramTest(unittest.TestCase):
|
|||||||
self.assertEquals(hist.b[6], 4)
|
self.assertEquals(hist.b[6], 4)
|
||||||
|
|
||||||
def testHistogramIgnoreColor(self):
|
def testHistogramIgnoreColor(self):
|
||||||
pixels = [1,2,3, 1,2,3, 1,2,3, 1,2,3,
|
pixels = [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3,
|
||||||
1,2,3, 8,7,6, 5,4,6, 1,2,3,
|
1, 2, 3, 8, 7, 6, 5, 4, 6, 1, 2, 3,
|
||||||
1,2,3, 8,7,6, 5,4,6, 1,2,3]
|
1, 2, 3, 8, 7, 6, 5, 4, 6, 1, 2, 3]
|
||||||
bmp = image_util.FromRGBPixels(4, 3, pixels)
|
bmp = image_util.FromRGBPixels(4, 3, pixels)
|
||||||
|
|
||||||
hist = image_util.GetColorHistogram(bmp,
|
hist = image_util.GetColorHistogram(bmp,
|
||||||
@ -87,8 +87,8 @@ class HistogramTest(unittest.TestCase):
|
|||||||
self.assertEquals(hist.b[6], 4)
|
self.assertEquals(hist.b[6], 4)
|
||||||
|
|
||||||
def testHistogramIgnoreColorTolerance(self):
|
def testHistogramIgnoreColorTolerance(self):
|
||||||
pixels = [1,2,3, 4,5,6,
|
pixels = [1, 2, 3, 4, 5, 6,
|
||||||
7,8,9, 8,7,6]
|
7, 8, 9, 8, 7, 6]
|
||||||
bmp = image_util.FromRGBPixels(2, 2, pixels)
|
bmp = image_util.FromRGBPixels(2, 2, pixels)
|
||||||
|
|
||||||
hist = image_util.GetColorHistogram(
|
hist = image_util.GetColorHistogram(
|
||||||
@ -106,8 +106,8 @@ class HistogramTest(unittest.TestCase):
|
|||||||
self.assertEquals(hist.b[9], 1)
|
self.assertEquals(hist.b[9], 1)
|
||||||
|
|
||||||
def testHistogramDistanceIgnoreColor(self):
|
def testHistogramDistanceIgnoreColor(self):
|
||||||
pixels = [1,2,3, 1,2,3,
|
pixels = [1, 2, 3, 1, 2, 3,
|
||||||
1,2,3, 1,2,3]
|
1, 2, 3, 1, 2, 3]
|
||||||
bmp = image_util.FromRGBPixels(2, 2, pixels)
|
bmp = image_util.FromRGBPixels(2, 2, pixels)
|
||||||
|
|
||||||
hist1 = image_util.GetColorHistogram(bmp, ignore_color=RgbaColor(1, 2, 3))
|
hist1 = image_util.GetColorHistogram(bmp, ignore_color=RgbaColor(1, 2, 3))
|
||||||
|
@ -174,7 +174,7 @@ def GetColorHistogram(image, ignore_color, tolerance):
|
|||||||
in_range = ((filtered[:, 0] < colorm[0]) | (filtered[:, 0] > colorp[0]) |
|
in_range = ((filtered[:, 0] < colorm[0]) | (filtered[:, 0] > colorp[0]) |
|
||||||
(filtered[:, 1] < colorm[1]) | (filtered[:, 1] > colorp[1]) |
|
(filtered[:, 1] < colorm[1]) | (filtered[:, 1] > colorp[1]) |
|
||||||
(filtered[:, 2] < colorm[2]) | (filtered[:, 2] > colorp[2]))
|
(filtered[:, 2] < colorm[2]) | (filtered[:, 2] > colorp[2]))
|
||||||
filtered = np.compress(in_range, filtered, axis = 0)
|
filtered = np.compress(in_range, filtered, axis=0)
|
||||||
if len(filtered[:, 0]) == 0:
|
if len(filtered[:, 0]) == 0:
|
||||||
return histogram.ColorHistogram(np.zeros((256)), np.zeros((256)),
|
return histogram.ColorHistogram(np.zeros((256)), np.zeros((256)),
|
||||||
np.zeros((256)), ignore_color)
|
np.zeros((256)), ignore_color)
|
||||||
|
@ -57,8 +57,8 @@ class ImageUtilTest(unittest.TestCase):
|
|||||||
orig, temp_file)
|
orig, temp_file)
|
||||||
|
|
||||||
def testWriteCroppedBmpToPngFile(self):
|
def testWriteCroppedBmpToPngFile(self):
|
||||||
pixels = [255,0,0, 255,255,0, 0,0,0,
|
pixels = [255, 0, 0, 255, 255, 0, 0, 0, 0,
|
||||||
255,255,0, 0,255,0, 0,0,0]
|
255, 255, 0, 0, 255, 0, 0, 0, 0]
|
||||||
orig = image_util.FromRGBPixels(3, 2, pixels)
|
orig = image_util.FromRGBPixels(3, 2, pixels)
|
||||||
orig = image_util.Crop(orig, 0, 0, 2, 2)
|
orig = image_util.Crop(orig, 0, 0, 2, 2)
|
||||||
temp_file = tempfile.NamedTemporaryFile(suffix='.png').name
|
temp_file = tempfile.NamedTemporaryFile(suffix='.png').name
|
||||||
@ -102,9 +102,9 @@ class ImageUtilTest(unittest.TestCase):
|
|||||||
image_util.GetPixelColor(diff_bmp, 2, 2).AssertIsRGB(255, 255, 255)
|
image_util.GetPixelColor(diff_bmp, 2, 2).AssertIsRGB(255, 255, 255)
|
||||||
|
|
||||||
def testGetBoundingBox(self):
|
def testGetBoundingBox(self):
|
||||||
pixels = [0,0,0, 0,0,0, 0,0,0, 0,0,0,
|
pixels = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0,0,0, 1,0,0, 1,0,0, 0,0,0,
|
0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0,
|
||||||
0,0,0, 0,0,0, 0,0,0, 0,0,0]
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||||
bmp = image_util.FromRGBPixels(4, 3, pixels)
|
bmp = image_util.FromRGBPixels(4, 3, pixels)
|
||||||
box, count = image_util.GetBoundingBox(bmp, RgbaColor(1, 0, 0))
|
box, count = image_util.GetBoundingBox(bmp, RgbaColor(1, 0, 0))
|
||||||
self.assertEquals(box, (1, 1, 2, 1))
|
self.assertEquals(box, (1, 1, 2, 1))
|
||||||
@ -115,9 +115,9 @@ class ImageUtilTest(unittest.TestCase):
|
|||||||
self.assertEquals(count, 0)
|
self.assertEquals(count, 0)
|
||||||
|
|
||||||
def testCrop(self):
|
def testCrop(self):
|
||||||
pixels = [0,0,0, 1,0,0, 2,0,0, 3,0,0,
|
pixels = [0, 0, 0, 1, 0, 0, 2, 0, 0, 3, 0, 0,
|
||||||
0,1,0, 1,1,0, 2,1,0, 3,1,0,
|
0, 1, 0, 1, 1, 0, 2, 1, 0, 3, 1, 0,
|
||||||
0,2,0, 1,2,0, 2,2,0, 3,2,0]
|
0, 2, 0, 1, 2, 0, 2, 2, 0, 3, 2, 0]
|
||||||
bmp = image_util.FromRGBPixels(4, 3, pixels)
|
bmp = image_util.FromRGBPixels(4, 3, pixels)
|
||||||
bmp = image_util.Crop(bmp, 1, 2, 2, 1)
|
bmp = image_util.Crop(bmp, 1, 2, 2, 1)
|
||||||
|
|
||||||
@ -125,4 +125,4 @@ class ImageUtilTest(unittest.TestCase):
|
|||||||
self.assertEquals(1, image_util.Height(bmp))
|
self.assertEquals(1, image_util.Height(bmp))
|
||||||
image_util.GetPixelColor(bmp, 0, 0).AssertIsRGB(1, 2, 0)
|
image_util.GetPixelColor(bmp, 0, 0).AssertIsRGB(1, 2, 0)
|
||||||
image_util.GetPixelColor(bmp, 1, 0).AssertIsRGB(2, 2, 0)
|
image_util.GetPixelColor(bmp, 1, 0).AssertIsRGB(2, 2, 0)
|
||||||
self.assertEquals(image_util.Pixels(bmp), bytearray([1,2,0, 2,2,0]))
|
self.assertEquals(image_util.Pixels(bmp), bytearray([1, 2, 0, 2, 2, 0]))
|
||||||
|
@ -8,7 +8,7 @@ from telemetry.internal.actions import page_action
|
|||||||
|
|
||||||
def read_js():
|
def read_js():
|
||||||
with open(os.path.join(os.path.dirname(__file__), 'mouse_click.js')) as f:
|
with open(os.path.join(os.path.dirname(__file__), 'mouse_click.js')) as f:
|
||||||
return f.read()
|
return f.read()
|
||||||
|
|
||||||
|
|
||||||
class MouseClickAction(page_action.PageAction):
|
class MouseClickAction(page_action.PageAction):
|
||||||
|
@ -10,7 +10,7 @@ from telemetry.timeline import trace_data
|
|||||||
|
|
||||||
class TraceDataTest(unittest.TestCase):
|
class TraceDataTest(unittest.TestCase):
|
||||||
def testSerialize(self):
|
def testSerialize(self):
|
||||||
ri = trace_data.TraceData({'traceEvents': [1,2,3]})
|
ri = trace_data.TraceData({'traceEvents': [1, 2, 3]})
|
||||||
f = cStringIO.StringIO()
|
f = cStringIO.StringIO()
|
||||||
ri.Serialize(f)
|
ri.Serialize(f)
|
||||||
d = f.getvalue()
|
d = f.getvalue()
|
||||||
@ -68,7 +68,7 @@ class TraceDataTest(unittest.TestCase):
|
|||||||
class TraceDataBuilderTest(unittest.TestCase):
|
class TraceDataBuilderTest(unittest.TestCase):
|
||||||
def testBasicChrome(self):
|
def testBasicChrome(self):
|
||||||
builder = trace_data.TraceDataBuilder()
|
builder = trace_data.TraceDataBuilder()
|
||||||
builder.AddEventsTo(trace_data.CHROME_TRACE_PART, [1,2,3])
|
builder.AddEventsTo(trace_data.CHROME_TRACE_PART, [1, 2, 3])
|
||||||
builder.AddEventsTo(trace_data.TAB_ID_PART, ['tab-7'])
|
builder.AddEventsTo(trace_data.TAB_ID_PART, ['tab-7'])
|
||||||
|
|
||||||
d = builder.AsData()
|
d = builder.AsData()
|
||||||
|
@ -26,9 +26,9 @@ class SharedAppState(shared_state.SharedState):
|
|||||||
super(SharedAppState, self).__init__(test, finder_options, user_story_set)
|
super(SharedAppState, self).__init__(test, finder_options, user_story_set)
|
||||||
if not isinstance(
|
if not isinstance(
|
||||||
test, timeline_based_measurement.TimelineBasedMeasurement):
|
test, timeline_based_measurement.TimelineBasedMeasurement):
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
'SharedAppState only accepts TimelineBasedMeasurement tests'
|
'SharedAppState only accepts TimelineBasedMeasurement tests'
|
||||||
' (not %s).' % test.__class__)
|
' (not %s).' % test.__class__)
|
||||||
self._test = test
|
self._test = test
|
||||||
self._finder_options = finder_options
|
self._finder_options = finder_options
|
||||||
self._android_app = None
|
self._android_app = None
|
||||||
|
@ -44,9 +44,9 @@ class UserStorySetTest(unittest.TestCase):
|
|||||||
self.assertEqual(base_dir, os.path.dirname(__file__))
|
self.assertEqual(base_dir, os.path.dirname(__file__))
|
||||||
|
|
||||||
def testFilePath(self):
|
def testFilePath(self):
|
||||||
uss = UserStorySetFoo()
|
uss = UserStorySetFoo()
|
||||||
self.assertEqual(os.path.abspath(__file__).replace('.pyc', '.py'),
|
self.assertEqual(os.path.abspath(__file__).replace('.pyc', '.py'),
|
||||||
uss.file_path)
|
uss.file_path)
|
||||||
|
|
||||||
def testCloudBucket(self):
|
def testCloudBucket(self):
|
||||||
blank_uss = user_story_set.UserStorySet()
|
blank_uss = user_story_set.UserStorySet()
|
||||||
|
@ -45,9 +45,9 @@ class CloudStorageUnitTest(unittest.TestCase):
|
|||||||
cloud_storage.FindGsutil = orig_find_gs_util
|
cloud_storage.FindGsutil = orig_find_gs_util
|
||||||
|
|
||||||
def testRunCommandCredentialsError(self):
|
def testRunCommandCredentialsError(self):
|
||||||
strs = ['You are attempting to access protected data with no configured',
|
strs = ['You are attempting to access protected data with no configured',
|
||||||
'Failure: No handler was ready to authenticate.']
|
'Failure: No handler was ready to authenticate.']
|
||||||
self._assertRunCommandRaisesError(strs, cloud_storage.CredentialsError)
|
self._assertRunCommandRaisesError(strs, cloud_storage.CredentialsError)
|
||||||
|
|
||||||
def testRunCommandPermissionError(self):
|
def testRunCommandPermissionError(self):
|
||||||
strs = ['status=403', 'status 403', '403 Forbidden']
|
strs = ['status=403', 'status 403', '403 Forbidden']
|
||||||
@ -134,7 +134,7 @@ class CloudStorageUnitTest(unittest.TestCase):
|
|||||||
'dir2':['2file.txt'], 'dir3':['3file1.sha1']}
|
'dir2':['2file.txt'], 'dir3':['3file1.sha1']}
|
||||||
stubs.os.path.dirs = ['real_dir_path']
|
stubs.os.path.dirs = ['real_dir_path']
|
||||||
def IncrementFilesUpdated(*_):
|
def IncrementFilesUpdated(*_):
|
||||||
IncrementFilesUpdated.files_updated +=1
|
IncrementFilesUpdated.files_updated += 1
|
||||||
IncrementFilesUpdated.files_updated = 0
|
IncrementFilesUpdated.files_updated = 0
|
||||||
orig_get_if_changed = cloud_storage.GetIfChanged
|
orig_get_if_changed = cloud_storage.GetIfChanged
|
||||||
cloud_storage.GetIfChanged = IncrementFilesUpdated
|
cloud_storage.GetIfChanged = IncrementFilesUpdated
|
||||||
|
@ -17,9 +17,9 @@ TOPLEVEL_DEVICE_CATEGORY = 'disabled-by-default-gpu.device'
|
|||||||
SERVICE_FRAME_END_MARKER = (TOPLEVEL_SERVICE_CATEGORY, 'SwapBuffer')
|
SERVICE_FRAME_END_MARKER = (TOPLEVEL_SERVICE_CATEGORY, 'SwapBuffer')
|
||||||
DEVICE_FRAME_END_MARKER = (TOPLEVEL_DEVICE_CATEGORY, 'SwapBuffer')
|
DEVICE_FRAME_END_MARKER = (TOPLEVEL_DEVICE_CATEGORY, 'SwapBuffer')
|
||||||
|
|
||||||
TRACKED_GL_CONTEXT_NAME = { 'RenderCompositor': 'render_compositor',
|
TRACKED_GL_CONTEXT_NAME = {'RenderCompositor': 'render_compositor',
|
||||||
'BrowserCompositor': 'browser_compositor',
|
'BrowserCompositor': 'browser_compositor',
|
||||||
'Compositor': 'browser_compositor' }
|
'Compositor': 'browser_compositor'}
|
||||||
|
|
||||||
|
|
||||||
class GPUTimelineListOfValues(list_of_scalar_values.ListOfScalarValues):
|
class GPUTimelineListOfValues(list_of_scalar_values.ListOfScalarValues):
|
||||||
@ -47,14 +47,14 @@ def _CPUFrameTimes(events_per_frame):
|
|||||||
# CPU event frames are calculated using the event thread duration.
|
# CPU event frames are calculated using the event thread duration.
|
||||||
# Some platforms do not support thread_duration, convert those to 0.
|
# Some platforms do not support thread_duration, convert those to 0.
|
||||||
return _CalculateFrameTimes(events_per_frame,
|
return _CalculateFrameTimes(events_per_frame,
|
||||||
lambda event : event.thread_duration or 0)
|
lambda event: event.thread_duration or 0)
|
||||||
|
|
||||||
|
|
||||||
def _GPUFrameTimes(events_per_frame):
|
def _GPUFrameTimes(events_per_frame):
|
||||||
"""Given a list of events per frame, returns a list of GPU frame times."""
|
"""Given a list of events per frame, returns a list of GPU frame times."""
|
||||||
# GPU event frames are asynchronous slices which use the event duration.
|
# GPU event frames are asynchronous slices which use the event duration.
|
||||||
return _CalculateFrameTimes(events_per_frame,
|
return _CalculateFrameTimes(events_per_frame,
|
||||||
lambda event : event.duration)
|
lambda event: event.duration)
|
||||||
|
|
||||||
|
|
||||||
def TimelineName(name, source_type, value_type):
|
def TimelineName(name, source_type, value_type):
|
||||||
|
@ -23,7 +23,7 @@ INTERACTION_RECORDS = [tir_module.TimelineInteractionRecord("test-record",
|
|||||||
|
|
||||||
|
|
||||||
def _CreateGPUSlices(parent_thread, name, start_time, duration, offset=0):
|
def _CreateGPUSlices(parent_thread, name, start_time, duration, offset=0):
|
||||||
args = { 'gl_category': gpu_timeline.TOPLEVEL_GL_CATEGORY }
|
args = {'gl_category': gpu_timeline.TOPLEVEL_GL_CATEGORY}
|
||||||
return (slice_module.Slice(parent_thread,
|
return (slice_module.Slice(parent_thread,
|
||||||
gpu_timeline.TOPLEVEL_SERVICE_CATEGORY,
|
gpu_timeline.TOPLEVEL_SERVICE_CATEGORY,
|
||||||
name, start_time,
|
name, start_time,
|
||||||
@ -36,7 +36,7 @@ def _CreateGPUSlices(parent_thread, name, start_time, duration, offset=0):
|
|||||||
duration=duration))
|
duration=duration))
|
||||||
|
|
||||||
def _CreateFrameEndSlices(parent_thread, start_time, duration, offset=0):
|
def _CreateFrameEndSlices(parent_thread, start_time, duration, offset=0):
|
||||||
args = { 'gl_category': gpu_timeline.TOPLEVEL_GL_CATEGORY }
|
args = {'gl_category': gpu_timeline.TOPLEVEL_GL_CATEGORY}
|
||||||
return (slice_module.Slice(parent_thread,
|
return (slice_module.Slice(parent_thread,
|
||||||
SERVICE_FRAME_END_CATEGORY,
|
SERVICE_FRAME_END_CATEGORY,
|
||||||
SERVICE_FRAME_END_NAME,
|
SERVICE_FRAME_END_NAME,
|
||||||
|
@ -135,7 +135,7 @@ class SmoothGestureTest(page_test_test_case.PageTestTestCase):
|
|||||||
tab_ids.append(tab.id)
|
tab_ids.append(tab.id)
|
||||||
|
|
||||||
def ValidateAndMeasurePage(self, _page, _tab, _results):
|
def ValidateAndMeasurePage(self, _page, _tab, _results):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
self.RunMeasurement(ScrollingGestureTestMeasurement(), ps)
|
self.RunMeasurement(ScrollingGestureTestMeasurement(), ps)
|
||||||
timeline_model = models[0]
|
timeline_model = models[0]
|
||||||
|
Reference in New Issue
Block a user