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

Unified Diff: tools/telemetry/telemetry/core/platform/profiler/vtune_profiler_unittest.py

Issue 272183006: Telemetry: Clean up perf profiler unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove Browser getters and disable pylint warnings. Created 6 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
Index: tools/telemetry/telemetry/core/platform/profiler/vtune_profiler_unittest.py
diff --git a/tools/telemetry/telemetry/core/platform/profiler/vtune_profiler_unittest.py b/tools/telemetry/telemetry/core/platform/profiler/vtune_profiler_unittest.py
index 725b3e6c1676fca889bc722cb94c7ea34c605771..6b234678d1432920b90e37e8dd3b4948c5dac44d 100644
--- a/tools/telemetry/telemetry/core/platform/profiler/vtune_profiler_unittest.py
+++ b/tools/telemetry/telemetry/core/platform/profiler/vtune_profiler_unittest.py
@@ -31,8 +31,8 @@ class TestVTuneProfiler(tab_test_case.TabTestCase):
mock_subprocess = simple_mock.MockObject()
mock_subprocess.ExpectCall(
'Popen').WithArgs(simple_mock.DONT_CARE).WillReturn(MockPopen(0))
- mock_subprocess.PIPE = simple_mock.MockObject()
- mock_subprocess.STDOUT = simple_mock.MockObject()
+ mock_subprocess.SetAttribute('PIPE', simple_mock.MockObject())
+ mock_subprocess.SetAttribute('STDOUT', simple_mock.MockObject())
real_subprocess = vtune_profiler.subprocess
vtune_profiler.subprocess = mock_subprocess
@@ -46,7 +46,7 @@ class TestVTuneProfiler(tab_test_case.TabTestCase):
self.assertTrue(
vtune_profiler.VTuneProfiler.is_supported(options.browser_type) or
sys.platform != 'linux2' or
- browser_type.startswith('cros'))
+ options.browser_type.startswith('cros'))
finally:
vtune_profiler.subprocess = real_subprocess
@@ -63,23 +63,25 @@ class TestVTuneProfiler(tab_test_case.TabTestCase):
def testVTuneProfiler(self):
mock_subprocess = simple_mock.MockObject()
- mock_subprocess.PIPE = simple_mock.MockObject()
- mock_subprocess.STDOUT = simple_mock.MockObject()
+ mock_subprocess.SetAttribute('PIPE', simple_mock.MockObject())
+ mock_subprocess.SetAttribute('STDOUT', simple_mock.MockObject())
# For each profiled process, expect one call to start VTune and one to stop
# it.
+ # pylint: disable=W0212
num_processes = self._ComputeNumProcesses(self._browser._browser_backend,
self._browser._platform_backend)
- for i in xrange(num_processes):
+ for _ in xrange(num_processes):
mock_subprocess.ExpectCall(
'Popen').WithArgs(simple_mock.DONT_CARE).WillReturn(MockPopen(0))
- for i in xrange(num_processes):
+ for _ in xrange(num_processes):
mock_subprocess.ExpectCall('call').WithArgs(simple_mock.DONT_CARE)
real_subprocess = vtune_profiler.subprocess
vtune_profiler.subprocess = mock_subprocess
try:
+ # pylint: disable=W0212
profiler = vtune_profiler.VTuneProfiler(self._browser._browser_backend,
self._browser._platform_backend,
'tmp',

Powered by Google App Engine
This is Rietveld 408576698