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

Unified Diff: tools/telemetry/telemetry/internal/platform/power_monitor/pm_mock.py

Issue 1647513002: Delete tools/telemetry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/internal/platform/power_monitor/pm_mock.py
diff --git a/tools/telemetry/telemetry/internal/platform/power_monitor/pm_mock.py b/tools/telemetry/telemetry/internal/platform/power_monitor/pm_mock.py
deleted file mode 100644
index d9bbab5ba870105a120d31713953f3c7e690b207..0000000000000000000000000000000000000000
--- a/tools/telemetry/telemetry/internal/platform/power_monitor/pm_mock.py
+++ /dev/null
@@ -1,61 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-class MockBrowserBackend(object):
- def __init__(self, package):
- self.package = package
-
-class MockBrowser(object):
- def __init__(self, package):
- self._browser_backend = MockBrowserBackend(package)
-
-class MockBattery(object):
- def __init__(self,
- power_results,
- starts_charging=True,
- voltage=4.0,
- fuelgauge=None):
- # voltage in millivolts
- self._power_results = power_results
- self._charging = starts_charging
- self._voltage = voltage
- self._fuelgauge = fuelgauge if fuelgauge else []
- self._fuel_idx = 0
-
- def SupportsFuelGauge(self):
- return len(self._fuelgauge) >= 0
-
- def GetFuelGaugeChargeCounter(self):
- try:
- x = self._fuelgauge[self._fuel_idx]
- self._fuel_idx += 1
- return x
- except IndexError:
- assert False, "Too many GetFuelGaugeChargeCounter() calls."
-
- def GetCharging(self):
- return self._charging
-
- def SetCharging(self, charging):
- if charging:
- assert not self._charging, "Mock battery already charging."
- self._charging = True
- else:
- assert self._charging, "Mock battery already not charging."
- self._charging = False
-
- def GetPowerData(self):
- return self._power_results
-
- def GetBatteryInfo(self):
- # the voltage returned by GetBatteryInfo() is in millivolts
- return {'voltage': int(self._voltage*1000)}
-
-class MockPlatformBackend(object):
- def __init__(self, command_dict=None):
- self._cdict = (command_dict if command_dict else {})
-
- def RunCommand(self, command):
- assert command in self._cdict, "Mock platform error: Unexpected command."
- return self._cdict[command]

Powered by Google App Engine
This is Rietveld 408576698