Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / tools / telemetry / telemetry / core / platform / platform_backend.py
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.
4
5 # pylint: disable=W0613
6
7
8 # pylint: disable=W0212
9 class OSVersion(str):
10   def __new__(cls, friendly_name, sortable_name, *args, **kwargs):
11     version = str.__new__(cls, friendly_name)
12     version._sortable_name = sortable_name
13     return version
14
15   def __lt__(self, other):
16     return self._sortable_name < other._sortable_name
17
18   def __gt__(self, other):
19     return self._sortable_name > other._sortable_name
20
21   def __le__(self, other):
22     return self._sortable_name <= other._sortable_name
23
24   def __ge__(self, other):
25     return self._sortable_name >= other._sortable_name
26
27
28 class PlatformBackend(object):
29   def IsRawDisplayFrameRateSupported(self):
30     return False
31
32   def StartRawDisplayFrameRateMeasurement(self):
33     raise NotImplementedError()
34
35   def StopRawDisplayFrameRateMeasurement(self):
36     raise NotImplementedError()
37
38   def GetRawDisplayFrameRateMeasurements(self):
39     raise NotImplementedError()
40
41   def SetFullPerformanceModeEnabled(self, enabled):
42     pass
43
44   def CanMonitorThermalThrottling(self):
45     return False
46
47   def IsThermallyThrottled(self):
48     raise NotImplementedError()
49
50   def HasBeenThermallyThrottled(self):
51     raise NotImplementedError()
52
53   def GetSystemCommitCharge(self):
54     raise NotImplementedError()
55
56   def GetSystemTotalPhysicalMemory(self):
57     raise NotImplementedError()
58
59   def GetCpuStats(self, pid):
60     return {}
61
62   def GetCpuTimestamp(self):
63     return {}
64
65   def PurgeUnpinnedMemory(self):
66     pass
67
68   def GetMemoryStats(self, pid):
69     return {}
70
71   def GetIOStats(self, pid):
72     return {}
73
74   def GetChildPids(self, pid):
75     raise NotImplementedError()
76
77   def GetCommandLine(self, pid):
78     raise NotImplementedError()
79
80   def GetOSName(self):
81     raise NotImplementedError()
82
83   def GetOSVersionName(self):
84     raise NotImplementedError()
85
86   def CanFlushIndividualFilesFromSystemCache(self):
87     raise NotImplementedError()
88
89   def FlushEntireSystemCache(self):
90     raise NotImplementedError()
91
92   def FlushSystemCacheForDirectory(self, directory, ignoring=None):
93     raise NotImplementedError()
94
95   def FlushDnsCache(self):
96     pass
97
98   def LaunchApplication(
99       self, application, parameters=None, elevate_privilege=False):
100     raise NotImplementedError()
101
102   def IsApplicationRunning(self, application):
103     raise NotImplementedError()
104
105   def CanLaunchApplication(self, application):
106     return False
107
108   def InstallApplication(self, application):
109     raise NotImplementedError()
110
111   def CanCaptureVideo(self):
112     return False
113
114   def StartVideoCapture(self, min_bitrate_mbps):
115     raise NotImplementedError()
116
117   @property
118   def is_video_capture_running(self):
119     return False
120
121   def StopVideoCapture(self):
122     raise NotImplementedError()
123
124   def CanMonitorPower(self):
125     return False
126
127   def StartMonitoringPower(self, browser):
128     raise NotImplementedError()
129
130   def StopMonitoringPower(self):
131     raise NotImplementedError()