summaryrefslogtreecommitdiffstats
path: root/chrome/test/tab_switching
diff options
context:
space:
mode:
authorchase@chromium.org <chase@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-11 01:09:39 +0000
committerchase@chromium.org <chase@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-11 01:09:39 +0000
commite896a4d2af4d4c15aeeeb66fb2b18950f777f103 (patch)
treed16bfa1dbbc232298f3cbd1369b26ea00c65dba3 /chrome/test/tab_switching
parentbd3dc94a54d7db7e08a3cbeacc690c6bc76ec0d8 (diff)
downloadchromium_src-e896a4d2af4d4c15aeeeb66fb2b18950f777f103.zip
chromium_src-e896a4d2af4d4c15aeeeb66fb2b18950f777f103.tar.gz
chromium_src-e896a4d2af4d4c15aeeeb66fb2b18950f777f103.tar.bz2
Add a RWH_TabSwitchPaintDuration histogram.
The RWH_TabSwitchPaintDuration histogram calculates the amount of time it took after a particular view was selected for it to be fully painted. I modified the tab switching test to use the new tab switch paint duration histogram in place of the whiteout duration histogram. As a measure, whiteout duration would not carry a value if we kept the backing store around for a tab, and we would end up with a result of zero instead of a useful result. Local results with the new measure are consistent with the number of operations we perform on the tabs. The tab switching test now fails if it cannot locate the correct histogram. BUG=4104 TEST=count of tab switch paint duration histogram results in tab switching test equals number of tabs used in test Review URL: http://codereview.chromium.org/378038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31632 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/tab_switching')
-rw-r--r--chrome/test/tab_switching/tab_switching_test.cc41
1 files changed, 21 insertions, 20 deletions
diff --git a/chrome/test/tab_switching/tab_switching_test.cc b/chrome/test/tab_switching/tab_switching_test.cc
index d23bef9..6b1eb00 100644
--- a/chrome/test/tab_switching/tab_switching_test.cc
+++ b/chrome/test/tab_switching/tab_switching_test.cc
@@ -25,7 +25,7 @@ namespace {
// time taken for each switch. It then prints out the times on the console,
// with the aim that the page cycler parser can interpret these numbers to
// draw graphs for page cycler Tab Switching Performance.
-// Usage Flags: -enable-logging -dump-histograms-on-exit -log-level=0
+// Usage Flags: --enable-logging --dump-histograms-on-exit --log-level=0
class TabSwitchingUITest : public UITest {
public:
TabSwitchingUITest() {
@@ -61,7 +61,7 @@ class TabSwitchingUITest : public UITest {
EXPECT_TRUE(CloseBrowser(browser_proxy_.get(), &application_closed));
// Now open the corresponding log file and collect average and std dev from
- // the histogram stats generated for RenderWidgetHostHWND_WhiteoutDuration
+ // the histogram stats generated for RenderWidgetHost_TabSwitchPaintDuration
FilePath log_file_name;
ASSERT_TRUE(PathService::Get(chrome::DIR_LOGS, &log_file_name));
log_file_name = log_file_name.AppendASCII("chrome_debug.log");
@@ -82,26 +82,27 @@ class TabSwitchingUITest : public UITest {
const std::string average_str("average = ");
const std::string std_dev_str("standard deviation = ");
std::string::size_type pos = contents.find(
- "Histogram: MPArch.RWHH_WhiteoutDuration", 0);
+ "Histogram: MPArch.RWH_TabSwitchPaintDuration", 0);
std::string::size_type comma_pos;
std::string::size_type number_length;
- if (pos != std::string::npos) {
- // Get the average.
- pos = contents.find(average_str, pos);
- comma_pos = contents.find(",", pos);
- pos += average_str.length();
- number_length = comma_pos - pos;
- average = contents.substr(pos, number_length);
-
- // Get the std dev.
- pos = contents.find(std_dev_str, pos);
- pos += std_dev_str.length();
- comma_pos = contents.find(" ", pos);
- number_length = comma_pos - pos;
- std_dev = contents.substr(pos, number_length);
- } else {
- LOG(WARNING) << "Histogram: MPArch.RWHH_WhiteoutDuration wasn't found";
- }
+
+ // Verify we found the TabSwitchPaintDuration histogram.
+ ASSERT_NE(pos, std::string::npos) <<
+ "Histogram: MPArch.RWH_TabSwitchPaintDuration wasn't found";
+
+ // Get the average.
+ pos = contents.find(average_str, pos);
+ comma_pos = contents.find(",", pos);
+ pos += average_str.length();
+ number_length = comma_pos - pos;
+ average = contents.substr(pos, number_length);
+
+ // Get the std dev.
+ pos = contents.find(std_dev_str, pos);
+ pos += std_dev_str.length();
+ comma_pos = contents.find(" ", pos);
+ number_length = comma_pos - pos;
+ std_dev = contents.substr(pos, number_length);
// Print the average and standard deviation.
PrintResultMeanAndError("tab_switch", "", "t",