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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/performance_tests/perftest_unittest.py

Issue 1839193004: Run auto-formatter (autopep8) on webkitpy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 9 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
Index: third_party/WebKit/Tools/Scripts/webkitpy/performance_tests/perftest_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/performance_tests/perftest_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/performance_tests/perftest_unittest.py
index 7da2e1e1dea1a8ceaee577b28bb9f40ce43b0694..2b81eac576f1f4ddc860e641e47e8d3503ea2fc9 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/performance_tests/perftest_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/performance_tests/perftest_unittest.py
@@ -44,11 +44,13 @@ from webkitpy.performance_tests.perftest import SingleProcessPerfTest
class MockPort(TestPort):
+
def __init__(self, custom_run_test=None):
super(MockPort, self).__init__(host=MockHost(), custom_run_test=custom_run_test)
class TestPerfTestMetric(unittest.TestCase):
+
def test_init_set_missing_unit(self):
self.assertEqual(PerfTestMetric('Time', iterations=[1, 2, 3, 4, 5]).unit(), 'ms')
self.assertEqual(PerfTestMetric('Malloc', iterations=[1, 2, 3, 4, 5]).unit(), 'bytes')
@@ -90,6 +92,7 @@ class TestPerfTestMetric(unittest.TestCase):
class TestPerfTest(unittest.TestCase):
+
def _assert_results_are_correct(self, test, output):
test.run_single = lambda driver, path, time_out_ms: output
self.assertTrue(test._run_with_driver(None, None))
@@ -176,9 +179,9 @@ Should not be ignored
[ERROR:main.cc] The sky has fallen""")
test._filter_output(output_with_lines_to_ignore)
self.assertEqual(output_with_lines_to_ignore.error,
- "Should not be ignored\n"
- "[WARNING:chrome.cc] Something went wrong\n"
- "[ERROR:main.cc] The sky has fallen")
+ "Should not be ignored\n"
+ "[WARNING:chrome.cc] Something went wrong\n"
+ "[ERROR:main.cc] The sky has fallen")
def test_parse_output_with_subtests(self):
output = DriverOutput("""
@@ -208,6 +211,7 @@ max 1120 ms
class TestSingleProcessPerfTest(unittest.TestCase):
+
def test_use_only_one_process(self):
called = [0]
@@ -232,6 +236,7 @@ max 1120 ms""", image=None, image_hash=None, audio=None)
class TestPerfTestFactory(unittest.TestCase):
+
def test_regular_test(self):
test = PerfTestFactory.create_perf_test(MockPort(), 'some-dir/some-test', '/path/some-dir/some-test')
self.assertEqual(test.__class__, PerfTest)

Powered by Google App Engine
This is Rietveld 408576698