xref: /aosp_15_r20/external/autotest/client/site_tests/power_LoadTest/control.docs_1hour (revision 9c5db1993ded3edbeafc8092d69fe5de2ee02df7)
1# Copyright (c) 2012 The Chromium OS 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
5AUTHOR = "ChromeOS Team"
6NAME = "power_LoadTest.docs_1hour"
7PURPOSE = "Measure power draw when system is under load."
8CRITERIA = "This test is a benchmark."
9TIME = "LENGTHY"
10TEST_CATEGORY = "Benchmark"
11TEST_CLASS = "power"
12TEST_TYPE = "client"
13EXTENDED_TIMEOUT = 4500
14PY_VERSION = 3
15
16DOC = """
17This test runs a load test consisting of cycling though web pages, playing
18videos, etc. and measures battery power draw. The duration of this test is
19determined by the seconds variable.
20
21
22The following manual steps need to be performed on the device under test
23before this test can be run:
24  - make sure that Ethernet cable is disconnected and WiFi is connected
25  - disconnect power cable
26
27You are now ready to run the test.
28"""
29
30# TODO (bleung): Find a way to do automatic Facebook login for test account.
31# TODO (tbroch): Find way to not replicate all these parameters that are common
32# between this control file and the original
33loop_time = 3600
34loop_count = 1
35
36# Task format:
37# This sets the tasks variable in the extension directly via javascript.
38#
39# Args:
40# type: [window, cycle] Window will open a window with tabs for the duration of
41# the window. Cycle will cycle through the urls for the duration of the window
42# every delay ms.
43# name: name of the window
44# start: start time (ms)
45# duration: duration of task (ms)
46# delay: time for each url for the cycle type (ms)
47# timeout: time before loading a url times out for the cycle type (ms)
48# focus: whether the window should be in the foreground
49# tabs: list of urls for the window type
50# urls: list of urls to cycle through for the cycle type
51
52
53tasks = """
54[
55  {
56    type: 'window',
57    name: 'background',
58    start: 0,
59    duration: minutes(60),
60    focus: false,
61    tabs: [
62      'https://www.google.com/search?q=google',
63      'https://news.google.com',
64      'https://www.reddit.com',
65      'https://www.amazon.com',
66      'https://www.instagram.com/instagram',
67    ],
68  },
69  {
70    type: 'cycle',
71    name: 'docs',
72    start: seconds(1),
73    duration: minutes(60),
74    delay: seconds(60),
75    timeout: seconds(10),
76    focus: true,
77    urls: [
78      ViewGDoc + '1ywpQGu18T9e2lB_QVMlihDqiF0V5hsYkhlXCfu9B8jY',
79      ViewGDoc + '12qBD7L6n9hLW1OFgLgpurx7WSgDM3l01dU6YYU-xdXU',
80    ],
81  },
82]
83"""
84
85args_dict = utils.args_to_dict(args)
86pdash_note = args_dict.get('pdash_note', '')
87job.run_test('power_LoadTest', loop_time=loop_time, loop_count=loop_count,
88             test_low_batt_p=6, tasks=tasks, tag=NAME.split('.')[1],
89             pdash_note=pdash_note)
90