From ca97a26cb1e8997126a7c94422725fc3507015fd Mon Sep 17 00:00:00 2001 From: "mbelshe@google.com" Date: Fri, 17 Jul 2009 21:32:23 +0000 Subject: Several changes to the benchmark extension: * Cleaned up the UI - can auto-start a benchmark from a given url * added bandwidth measurements for testing bandwidth efficiency * added time to docload, time to first paint, in addition to overall PLT. BUG=none TEST=none Review URL: http://codereview.chromium.org/155675 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21007 0039d316-1c4b-4281-b951-d872f2087c98 --- .../data/extensions/samples/benchmark/options.html | 490 +++++++++++---------- .../data/extensions/samples/benchmark/script.js | 57 +-- .../extensions/samples/benchmark/toolstrip.html | 388 ++++++++-------- 3 files changed, 504 insertions(+), 431 deletions(-) diff --git a/chrome/test/data/extensions/samples/benchmark/options.html b/chrome/test/data/extensions/samples/benchmark/options.html index 8145632..c806551 100644 --- a/chrome/test/data/extensions/samples/benchmark/options.html +++ b/chrome/test/data/extensions/samples/benchmark/options.html @@ -1,228 +1,262 @@ - - Page Benchmark Options - - - - - - - - - - - - - -

- -

Configuration

- -Iterations - - -Clear Connections? -Clear Cache? - -

- -

Results

- - - - - - - - - - - - - - - - - - -
urlavgstddevminmax -
,
- - - - + + Page Benchmark Options + + + + + + + + + + + + + +

+ +

Configuration

+ +Iterations + + +Clear Connections? +Clear Cache? +

+URL to load +

+

+ +

Results

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
urldoc load meanpaint meantotal meanstddevminmaxRead KBWrite KBRead KBpsWrite KBps +
,
+ + + + diff --git a/chrome/test/data/extensions/samples/benchmark/script.js b/chrome/test/data/extensions/samples/benchmark/script.js index cbd1bb5..75e07a4 100644 --- a/chrome/test/data/extensions/samples/benchmark/script.js +++ b/chrome/test/data/extensions/samples/benchmark/script.js @@ -1,28 +1,29 @@ -// The port for communicating back to the extension. -var benchmarkExtensionPort = chrome.extension.connect(); - -// The url is what this page is known to the benchmark as. -// The benchmark uses this id to differentiate the benchmark's -// results from random pages being browsed. - -// TODO(mbelshe): If the page redirects, the location changed and the -// benchmark stalls. -var benchmarkExtensionUrl = window.location.toString(); - -function sendTimesToExtension() { - var times = window.chromium.GetLoadTimes(); - if (times.finishLoadTime != 0) { - benchmarkExtensionPort.postMessage({message: "load", url: benchmarkExtensionUrl, values: times}); - } else { - window.setTimeout(sendTimesToExtension, 100); - } -} - -function loadComplete() { - // Only trigger for top-level frames (e.g. the one we benchmarked) - if (window.parent == window) { - sendTimesToExtension(); - } -} - -window.addEventListener("load", loadComplete); +// The port for communicating back to the extension. +var benchmarkExtensionPort = chrome.extension.connect(); + +// The url is what this page is known to the benchmark as. +// The benchmark uses this id to differentiate the benchmark's +// results from random pages being browsed. + +// TODO(mbelshe): If the page redirects, the location changed and the +// benchmark stalls. +var benchmarkExtensionUrl = window.location.toString(); + +function sendTimesToExtension() { + var times = window.chrome.loadTimes(); + + if (times.finishLoadTime != 0) { + benchmarkExtensionPort.postMessage({message: "load", url: benchmarkExtensionUrl, values: times}); + } else { + window.setTimeout(sendTimesToExtension, 100); + } +} + +function loadComplete() { + // Only trigger for top-level frames (e.g. the one we benchmarked) + if (window.parent == window) { + sendTimesToExtension(); + } +} + +window.addEventListener("load", loadComplete); diff --git a/chrome/test/data/extensions/samples/benchmark/toolstrip.html b/chrome/test/data/extensions/samples/benchmark/toolstrip.html index 4ca82af..a9e1230 100644 --- a/chrome/test/data/extensions/samples/benchmark/toolstrip.html +++ b/chrome/test/data/extensions/samples/benchmark/toolstrip.html @@ -1,175 +1,213 @@ - - - - - - -
- - -
-Go -
- -
+ + + + + + +
+ + +
-- cgit v1.1