diff options
author | lzheng@chromium.org <lzheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-07 21:58:09 +0000 |
---|---|---|
committer | lzheng@chromium.org <lzheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-07 21:58:09 +0000 |
commit | 696c54e70435d8a3be63b9519bbd35358c9c654a (patch) | |
tree | 1ef2a974a8ef6e7dda6db032a3e0d5c202e7a248 | |
parent | 6bb153eb3f16e75259d540a07d145a58cafa4006 (diff) | |
download | chromium_src-696c54e70435d8a3be63b9519bbd35358c9c654a.zip chromium_src-696c54e70435d8a3be63b9519bbd35358c9c654a.tar.gz chromium_src-696c54e70435d8a3be63b9519bbd35358c9c654a.tar.bz2 |
Clean up benchmarks and pop warning message on error triggered by redirect.
Clean up benchmarks[] between tests. Otherwise, if there is a bad url, it will stuck there forever till we result the extension.
Pop out a warning if the url is redirected and thus could not find an entry in benchmarks[]. This should have only to the parent frames since in script.js, we don't post event for subframes result (window.parent != window).
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/3318015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58763 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/common/extensions/docs/examples/extensions/benchmark/background.html | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/chrome/common/extensions/docs/examples/extensions/benchmark/background.html b/chrome/common/extensions/docs/examples/extensions/benchmark/background.html index 6a51042..a5e952a 100644 --- a/chrome/common/extensions/docs/examples/extensions/benchmark/background.html +++ b/chrome/common/extensions/docs/examples/extensions/benchmark/background.html @@ -351,6 +351,11 @@ chrome.extension.onConnect.addListener(function(port) { alert("blank page loaded!"); } var benchmark = findBenchmark(data.url); + if (benchmark == undefined) { + alert("Error: Loaded url(" + data.url + ") is not the same as what " + "you set in url box. This could happen if the request is " + "redirected. Please use the redirected url for testing."); + } if (benchmark != undefined && benchmark.isRunning()) { benchmark.pageFinished(data.values); } @@ -369,7 +374,7 @@ function run() { "between runs because Chrome is running in single-process mode."); } } - + benchmarks = []; var urls = testUrl.split(","); for (var i = 0; i < urls.length; i++) { var benchmark = new Benchmark(); |