blob: c9cfcfd9a9359223ffd6e2bb06b68df9696d8729 [file] [log] [blame]
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from autotest_lib.client.bin import test
from autotest_lib.client.cros import power_suspend
class power_Resume(test.test):
version = 1
preserve_srcdir = True
def initialize(self):
self._suspender = power_suspend.Suspender(self.resultsdir,
throw=True, device_times=True)
def run_once(self, max_devs_returned=10):
# TODO: Reduce duration to 0 once stress tests have proven it to be safe
(results, device_times) = self._suspender.suspend(3)
# return as keyvals the slowest n devices
slowest_devs = sorted(
for dev in slowest_devs:
results[dev] = device_times[dev]
results['seconds_3G_disconnect'] = self._suspender.disconnect_3G_time