OLD | NEW |
1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 AUTHOR = "Chrome OS Team" | 5 AUTHOR = "Chrome OS Team" |
6 NAME = "power_LoadTest" | 6 NAME = "power_LoadTest" |
7 PURPOSE = "Measure power draw when system is under load." | 7 PURPOSE = "Measure power draw when system is under load." |
8 CRITERIA = "This test is a benchmark." | 8 CRITERIA = "This test is a benchmark." |
9 TIME = "LONG" | 9 TIME = "LONG" |
10 TEST_CATEGORY = "Benchmark" | 10 TEST_CATEGORY = "Benchmark" |
11 TEST_CLASS = "power" | 11 TEST_CLASS = "power" |
12 TEST_TYPE = "client" | 12 TEST_TYPE = "client" |
13 | 13 |
14 DOC = """ | 14 DOC = """ |
15 This test runs a load test consisting of cycling though web pages, playing | 15 This test runs a load test consisting of cycling though web pages, playing |
16 videos, etc. and measures battery power draw. The duration of this test is | 16 videos, etc. and measures battery power draw. The duration of this test is |
17 determined by the seconds variable. | 17 determined by the seconds variable. |
18 | 18 |
19 | 19 |
20 The following manual steps need to be performed on the device under test | 20 The following manual steps need to be performed on the device under test |
21 before this test can be run: | 21 before this test can be run: |
22 - make sure that Ethernet cable is disconnected and WiFi is connected | 22 - make sure that Ethernet cable is disconnected and WiFi is connected |
23 - login to Chrome OS and open a terminal window (Ctrl-Alt-t) | |
24 - run the following command to launch a new browser window: | |
25 $ sudo su chronos -c "/opt/google/chrome/chrome --no-first-run" | |
26 - in the newly opened browser window: | |
27 - navigate to http://www.gmail.com. Logout if already logged in. Check the | |
28 "Stay signed in" box and log in. If the yellow "Do you want Chromium to | |
29 save password" bar comes up, click on "Save password" | |
30 - navigate to http://www.facebook.com. Logout if already logged in. Check | |
31 the "Keep me logged in" box and log in. If the yellow "Do you want | |
32 Chromium to save password" bar comes up, click on "Save password". | |
33 - close browser window | |
34 - disconnect power cable | 23 - disconnect power cable |
35 | 24 |
36 You are now ready to run the test. | 25 You are now ready to run the test. |
37 """ | 26 """ |
38 | 27 |
| 28 # TODO (bleung): Find a way to do automatic Facebook and Gmail login in |
| 29 # perf test account. |
| 30 # TODO (bleung): Seconds variable is used here, but is not in power_LoadTest |
| 31 # because of the change to packed external extension. Change ext to take arg. |
| 32 |
| 33 |
39 import time | 34 import time |
40 | 35 |
41 loop_time = 3600 | 36 loop_time = 3600 |
42 loop_count = 9 | 37 loop_count = 9 |
43 | 38 |
44 def run_audiovideo_V4L2(): | 39 def run_audiovideo_V4L2(): |
45 # TODO (snanda): Exit out of run_audiovideo_V4L2 earlier if | 40 # TODO (snanda): Exit out of run_audiovideo_V4L2 earlier if |
46 # run_power_load_test completes earlier than loop_time * loop_count | 41 # run_power_load_test completes earlier than loop_time * loop_count |
47 for i in range(loop_count): | 42 for i in range(loop_count): |
48 # enable webcam for 5% of the test time, 90% into the test | 43 # enable webcam for 5% of the test time, 90% into the test |
49 run_time = loop_time * 0.05 | 44 run_time = loop_time * 0.05 |
50 time.sleep(loop_time * 0.90) | 45 time.sleep(loop_time * 0.90) |
51 job.run_test('audiovideo_V4L2', time=run_time, run_capture_tests=False, | 46 job.run_test('audiovideo_V4L2', time=run_time, run_capture_tests=False, |
52 run_default_capture_test=True, assert_mandatory_controls=False, | 47 run_default_capture_test=True, assert_mandatory_controls=False, |
53 tag=i) | 48 tag=i) |
54 | 49 |
55 | 50 |
56 def run_power_load_test(): | 51 def run_power_load_test(): |
57 job.run_test('power_LoadTest', loop_time=loop_time, loop_count=loop_count, | 52 job.run_test('power_LoadTest', loop_time=loop_time, loop_count=loop_count, |
58 low_battery_threshold=3) | 53 low_battery_threshold=3) |
59 | 54 |
60 | 55 |
61 job.parallel([run_audiovideo_V4L2], [run_power_load_test]) | 56 job.parallel([run_audiovideo_V4L2], [run_power_load_test]) |
OLD | NEW |