1 # Copyright (c) 2013 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.
7 # pylint: disable=W0613
10 # pylint: disable=W0212
12 def __new__(cls, friendly_name, sortable_name, *args, **kwargs):
13 version = str.__new__(cls, friendly_name)
14 version._sortable_name = sortable_name
17 def __lt__(self, other):
18 return self._sortable_name < other._sortable_name
20 def __gt__(self, other):
21 return self._sortable_name > other._sortable_name
23 def __le__(self, other):
24 return self._sortable_name <= other._sortable_name
26 def __ge__(self, other):
27 return self._sortable_name >= other._sortable_name
30 class PlatformBackend(object):
31 def IsRawDisplayFrameRateSupported(self):
34 def StartRawDisplayFrameRateMeasurement(self):
35 raise NotImplementedError()
37 def StopRawDisplayFrameRateMeasurement(self):
38 raise NotImplementedError()
40 def GetRawDisplayFrameRateMeasurements(self):
41 raise NotImplementedError()
43 def SetFullPerformanceModeEnabled(self, enabled):
46 def CanMonitorThermalThrottling(self):
49 def IsThermallyThrottled(self):
50 raise NotImplementedError()
52 def HasBeenThermallyThrottled(self):
53 raise NotImplementedError()
55 def GetSystemCommitCharge(self):
56 raise NotImplementedError()
58 def GetSystemTotalPhysicalMemory(self):
59 raise NotImplementedError()
61 def GetCpuStats(self, pid):
64 def GetCpuTimestamp(self):
67 def PurgeUnpinnedMemory(self):
70 def GetMemoryStats(self, pid):
73 def GetIOStats(self, pid):
76 def GetChildPids(self, pid):
77 raise NotImplementedError()
79 def GetCommandLine(self, pid):
80 raise NotImplementedError()
83 raise NotImplementedError()
85 def GetOSVersionName(self):
86 raise NotImplementedError()
88 def CanFlushIndividualFilesFromSystemCache(self):
89 raise NotImplementedError()
91 def FlushEntireSystemCache(self):
92 raise NotImplementedError()
94 def FlushSystemCacheForDirectory(self, directory, ignoring=None):
95 raise NotImplementedError()
97 def LaunchApplication(
98 self, application, parameters=None, elevate_privilege=False):
99 raise NotImplementedError()
101 def IsApplicationRunning(self, application):
102 raise NotImplementedError()
104 def CanLaunchApplication(self, application):
107 def InstallApplication(self, application):
108 raise NotImplementedError()
110 def CanCaptureVideo(self):
113 def StartVideoCapture(self, min_bitrate_mbps):
114 raise NotImplementedError()
116 def StopVideoCapture(self):
117 raise NotImplementedError()
119 def CanMonitorPowerSync(self):
120 return self.CanMonitorPowerAsync()
122 def MonitorPowerSync(self, duration_ms):
123 self.StartMonitoringPowerAsync()
124 time.sleep(duration_ms / 1000.)
125 return self.StopMonitoringPowerAsync()
127 def CanMonitorPowerAsync(self):
130 def StartMonitoringPowerAsync(self):
131 raise NotImplementedError()
133 def StopMonitoringPowerAsync(self):
134 raise NotImplementedError()