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 5 AUTHOR = "Chrome OS Team" 6 NAME = "power_LoadTest.single_page" 7 PURPOSE = "Measure power draw when system is under load." 8 CRITERIA = "This test is a benchmark." 9 TIME = "MEDIUM" 10 TEST_CATEGORY = "Benchmark" 11 TEST_CLASS = "power" 12 TEST_TYPE = "client" 13 14 DOC = """ 15 This test measures the power of a single webpage including stats such as 16 cpu usage. 17 18 @args: the website url to run the test with 19 20 The following manual steps need to be performed on the device under test 21 before this test can be run: 22 - make sure that Ethernet cable is disconnected and WiFi is connected 23 - disconnect power cable 24 25 You are now ready to run the test. 26 """ 27 28 # TODO (bleung): Find a way to do automatic Facebook login for test account. 29 # TODO (tbroch): Find way to not replicate all these parameters that are common 30 # between this control file and the original 31 loop_time = 300 32 loop_count = 1 33 34 # Task format: 35 # This sets the tasks variable in the extension directly via javascript. 36 # 37 # Args: 38 # type: [window, cycle] Window will open a window with tabs for the duration of 39 # the window. Cycle will cycle through the urls for the duration of the window 40 # every delay ms. 41 # name: name of the window 42 # start: start time (ms) 43 # duration: duration of task (ms) 44 # delay: time for each url for the cycle type (ms) 45 # timeout: time before loading a url times out for the cycle type (ms) 46 # focus: whether the window should be in the foreground 47 # tabs: list of urls for the window type 48 # urls: list of urls to cycle through for the cycle type 49 50 # The duration and delay are scaled by 1/12 due to the loop time being 300 51 # instead of 3600 seconds. This is why duration is minutes(60) instead of 52 # minutes(5) and delay is minutes(12) instead of minutes(1). 53 tasks='[{' + \ 54 ' type: \'cycle\',' + \ 55 ' name: \'web\',' + \ 56 ' start: seconds(1),' + \ 57 ' duration: minutes(60),' + \ 58 ' delay: minutes(12),' + \ 59 ' timeout: seconds(10),' + \ 60 ' focus: true,' + \ 61 ' urls: [' + \ 62 '\'' + \ 63 args[0] + \ 64 '\'' + \ 65 ']}]' 66 67 job.run_test('power_LoadTest', loop_time=loop_time, loop_count=loop_count, 68 test_low_batt_p=6, tasks=tasks) 69