diff options
author | zelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-27 23:03:52 +0000 |
---|---|---|
committer | zelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-27 23:03:52 +0000 |
commit | 7539603d969a54673aff6cbdc69319a2ad4a843d (patch) | |
tree | 13a8822ffb09ffaf916377ec373653284716230c /chrome | |
parent | 7699dfe771c34738bb06066a3e507197c5ae7097 (diff) | |
download | chromium_src-7539603d969a54673aff6cbdc69319a2ad4a843d.zip chromium_src-7539603d969a54673aff6cbdc69319a2ad4a843d.tar.gz chromium_src-7539603d969a54673aff6cbdc69319a2ad4a843d.tar.bz2 |
Removed page cycler tests since they already exist somewhere else.
TBR=zbehan
BUG=none
TEST=none
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57746 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
3 files changed, 0 insertions, 179 deletions
diff --git a/chrome/test/chromeos/autotest/files/client/site_tests/desktopui_PageCyclerTests/control b/chrome/test/chromeos/autotest/files/client/site_tests/desktopui_PageCyclerTests/control deleted file mode 100644 index 91c6eb0..0000000 --- a/chrome/test/chromeos/autotest/files/client/site_tests/desktopui_PageCyclerTests/control +++ /dev/null @@ -1,28 +0,0 @@ -# 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. - -AUTHOR = "Chrome OS Team" -NAME = "desktopui_PageCyclerTests" -PURPOSE = "Benchmark page loading times of the Chrome web browser." -CRITERIA = """ -No specific criteria. -""" -TIME = "LONG" -TEST_CATEGORY = "Benchmark" -TEST_CLASS = "desktopui" -TEST_TYPE = "client" - -DOC = """ -The page cycler consists of the following tests: - 'PageCyclerTest.Alexa_usFile', 'PageCyclerTest.MozFile', - 'PageCyclerTest.Intl1File', 'PageCyclerTest.Intl2File', - 'PageCyclerTest.DhtmlFile', 'PageCyclerTest.Moz2File', - 'PageCyclerTest.BloatFile', 'PageCyclerTest.DomFile', - 'PageCyclerTest.MorejsFile', 'PageCyclerTest.MorejsnpFile' - -At the end of the test, a message is printed with the median latency. - -""" - -job.run_test('desktopui_PageCyclerTests') diff --git a/chrome/test/chromeos/autotest/files/client/site_tests/desktopui_PageCyclerTests/desktopui_PageCyclerTests.py b/chrome/test/chromeos/autotest/files/client/site_tests/desktopui_PageCyclerTests/desktopui_PageCyclerTests.py deleted file mode 100644 index 24c64c9..0000000 --- a/chrome/test/chromeos/autotest/files/client/site_tests/desktopui_PageCyclerTests/desktopui_PageCyclerTests.py +++ /dev/null @@ -1,39 +0,0 @@ -# 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. - -import commands, logging, os, shutil, time -from autotest_lib.client.bin import test, utils -from autotest_lib.client.common_lib import error, site_httpd, site_ui -from page_cycler_results_parser import PageCyclerResultsParser - - -class desktopui_PageCyclerTests(test.test): - version = 1 - results = {} - - def run_page_cycler(self, gtest_filter = ''): - # TODO: Disable screensaver? - assert(gtest_filter != ''), gtest_filter+' cannot be empty!' - cmd = ('CR_SOURCE_ROOT=/home/chronos/chromium/src /home/chronos/' - 'chromium/src/x86-generic_out/Release/page_cycler_tests' - ' --gtest_filter=')+gtest_filter - xcmd = site_ui.xcommand(cmd) - logging.debug('Running: '+gtest_filter) - output = utils.system_output(xcmd) - pcrp = PageCyclerResultsParser() - result = pcrp.parse_results(output) - logging.debug(result) - self.results[gtest_filter] = result - - def run_once(self): - # Use a smaller input set for testing purposes, if needed: -### testNames=['PageCyclerTest.MozFile'] - testNames=['PageCyclerTest.Alexa_usFile', 'PageCyclerTest.MozFile', - 'PageCyclerTest.Intl1File', 'PageCyclerTest.Intl2File', - 'PageCyclerTest.DhtmlFile', 'PageCyclerTest.Moz2File', - 'PageCyclerTest.BloatFile', 'PageCyclerTest.DomFile', - 'PageCyclerTest.MorejsFile', 'PageCyclerTest.MorejsnpFile'] - for testName in testNames: - self.run_page_cycler(testName) - self.write_perf_keyval(self.results) diff --git a/chrome/test/chromeos/autotest/files/client/site_tests/desktopui_PageCyclerTests/page_cycler_results_parser.py b/chrome/test/chromeos/autotest/files/client/site_tests/desktopui_PageCyclerTests/page_cycler_results_parser.py deleted file mode 100644 index 1d8e15a..0000000 --- a/chrome/test/chromeos/autotest/files/client/site_tests/desktopui_PageCyclerTests/page_cycler_results_parser.py +++ /dev/null @@ -1,112 +0,0 @@ -import subprocess as sub -import re -import sys -import math, functools - -class SiteTimes(object): - def __init__(self): - self.site='UNDEFINED' - self.times=[] - -# helper function found online here: -# http://code.activestate.com/recipes/511478-finding-the-percentile- -# of-the-values/ -def percentile(N, percent, key=lambda x:x): - """ - Find the percentile of a list of values. - - @parameter N - is a list of values. Note N MUST BE already sorted. - @parameter percent - a float value from 0.0 to 1.0. - @parameter key - optional key function to compute value from each - element of N. - - @return - the percentile of the values - """ - if not N: - return None - k = (len(N)-1) * percent - f = math.floor(k) - c = math.ceil(k) - if f == c: - return key(N[int(k)]) - d0 = key(N[int(f)]) * (k-f) - d1 = key(N[int(c)]) * (c-k) - return d0+d1 - -def mean(numbers): - assert(len(numbers) != 0), 'list should not be empty!' - return sum(numbers)/len(numbers) - -class PageCyclerResultsParser: - def parse_file(self, outfile = 'out.txt'): - # output is the output of the page_cycler tests. - output = open(outfile).read() - return self.parse_results(output) - - def parse_results(self, output = ''): - # median is 50th percentile. - median = functools.partial(percentile, percent=0.5) - - assert(output != ''), 'Output cannot be empty!' - - # split it up into lines - lines = output.split('\n') - - # figure out where the results are... - found = False - # This is our anchor in the text - token = '*RESULT times:' - for index, line in enumerate(lines): - if(line.startswith(token)): - found = True - break - - assert(found==True), token+' not found!?' - timesline = lines[index] - sitesline = lines[index-1] - - # we have a line called times and a line called sites - m = re.search('\[(.*?)\]', sitesline) - sites = m.group(1).split(',') - - m = re.search('\[(.*?)\]', timesline) - times = m.group(1).split(',') - - assert(len(times) % len(sites) == 0), 'Times not divisible by sites!' - - iterations = len(times)/len(sites) - - # now we have a list called sites and a list called times - # let's do some statistics on it. - stList = [] - - # go over all the sites and populate the stlist data structure - for ii, site in enumerate(sites): - st = SiteTimes() - st.site = site - for jj in range(0, iterations): - mytime = float(times[jj*len(sites)+ii]) - st.times.append(mytime) - stList.append(st) - - # For debugging use something like this: - ###for ii, st in enumerate(stList): - ### print st.site - ### print st.times - - # now remove the lowest element and print out mean of medians - medianList = [] - - totalTime = 0 - for ii, st in enumerate(stList): - sortedTimes=sorted(st.times) - # drop highest time in the sortedTimes - sortedTimes.pop() - # TODO: Perhaps this should be a weighted mean? - totalTime += mean(sortedTimes) - - return totalTime/len(stList) - -# This is how to use this class -###pcrp=PageCyclerResultsParser() -###print pcrp.parse_file('out.txt') |