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

Side by Side Diff: tools/telemetry/telemetry/internal/platform/mac_platform_backend_unittest.py

Issue 1458083003: [Telemetry + tools/perf] Modify the pylint disable message to use symbolic name (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
1 # Copyright 2014 The Chromium Authors. All rights reserved. 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 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import os 5 import os
6 import unittest 6 import unittest
7 7
8 from telemetry.core import platform as platform_module 8 from telemetry.core import platform as platform_module
9 from telemetry.core import os_version 9 from telemetry.core import os_version
10 from telemetry import decorators 10 from telemetry import decorators
11 11
12 12
13 class MacPlatformBackendTest(unittest.TestCase): 13 class MacPlatformBackendTest(unittest.TestCase):
14 def testVersionCamparison(self): 14 def testVersionCamparison(self):
15 self.assertGreater(os_version.YOSEMITE, os_version.MAVERICKS) 15 self.assertGreater(os_version.YOSEMITE, os_version.MAVERICKS)
16 self.assertGreater(os_version.MAVERICKS, os_version.SNOWLEOPARD) 16 self.assertGreater(os_version.MAVERICKS, os_version.SNOWLEOPARD)
17 self.assertGreater(os_version.LION, os_version.LEOPARD) 17 self.assertGreater(os_version.LION, os_version.LEOPARD)
18 self.assertEqual(os_version.YOSEMITE, 'yosemite') 18 self.assertEqual(os_version.YOSEMITE, 'yosemite')
19 self.assertEqual(os_version.MAVERICKS, 'mavericks') 19 self.assertEqual(os_version.MAVERICKS, 'mavericks')
20 self.assertEqual('%s2' % os_version.MAVERICKS, 'mavericks2') 20 self.assertEqual('%s2' % os_version.MAVERICKS, 'mavericks2')
21 self.assertEqual(''.join([os_version.MAVERICKS, '2']), 21 self.assertEqual(''.join([os_version.MAVERICKS, '2']),
22 'mavericks2') 22 'mavericks2')
23 self.assertEqual(os_version.LION.upper(), 'LION') 23 self.assertEqual(os_version.LION.upper(), 'LION')
24 24
25 @decorators.Enabled('mac') 25 @decorators.Enabled('mac')
26 def testGetCPUStats(self): 26 def testGetCPUStats(self):
27 platform = platform_module.GetHostPlatform() 27 platform = platform_module.GetHostPlatform()
28 28
29 backend = platform._platform_backend # pylint: disable=W0212 29 backend = platform._platform_backend # pylint: disable=protected-access
30 30
31 cpu_stats = backend.GetCpuStats(os.getpid()) 31 cpu_stats = backend.GetCpuStats(os.getpid())
32 self.assertGreater(cpu_stats['CpuProcessTime'], 0) 32 self.assertGreater(cpu_stats['CpuProcessTime'], 0)
33 self.assertTrue(cpu_stats.has_key('ContextSwitches')) 33 self.assertTrue(cpu_stats.has_key('ContextSwitches'))
34 if backend.GetOSVersionName() >= os_version.MAVERICKS: 34 if backend.GetOSVersionName() >= os_version.MAVERICKS:
35 self.assertTrue(cpu_stats.has_key('IdleWakeupCount')) 35 self.assertTrue(cpu_stats.has_key('IdleWakeupCount'))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698