summaryrefslogtreecommitdiffstats
path: root/chrome/test/startup/feature_startup_test.cc
diff options
context:
space:
mode:
authorpamg@google.com <pamg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-18 23:32:34 +0000
committerpamg@google.com <pamg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-18 23:32:34 +0000
commitf7daade0fd1b9c4607c31de021ffbdaa877ff792 (patch)
tree09ca9bd88a554e5c67aaa868204b9e9ae5056dff /chrome/test/startup/feature_startup_test.cc
parent425254cdc9b7ff515285250c30976858f0f17abf (diff)
downloadchromium_src-f7daade0fd1b9c4607c31de021ffbdaa877ff792.zip
chromium_src-f7daade0fd1b9c4607c31de021ffbdaa877ff792.tar.gz
chromium_src-f7daade0fd1b9c4607c31de021ffbdaa877ff792.tar.bz2
Switch various performance tests to produce output for use by the new generic
plotting log parser. BUG=b/1221588 TEST=once scripts and data are also switched, perf tests still plot Review URL: http://codereview.chromium.org/6431 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3602 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/startup/feature_startup_test.cc')
-rw-r--r--chrome/test/startup/feature_startup_test.cc49
1 files changed, 12 insertions, 37 deletions
diff --git a/chrome/test/startup/feature_startup_test.cc b/chrome/test/startup/feature_startup_test.cc
index 08b44e1..ce37879 100644
--- a/chrome/test/startup/feature_startup_test.cc
+++ b/chrome/test/startup/feature_startup_test.cc
@@ -39,20 +39,18 @@ class NewTabUIStartupTest : public UITest {
static const int kNumCycles = 5;
- void PrintTimings(const char* label, TimeDelta timings[kNumCycles]) {
- printf("\n%s = [", label);
- for (int i = 0; i < kNumCycles; ++i) {
- if (i > 0)
- printf(",");
- printf("%.2f", timings[i].InMillisecondsF());
- }
- printf("]\n");
+ void PrintTimings(const wchar_t* label, TimeDelta timings[kNumCycles],
+ bool important) {
+ std::wstring times;
+ for (int i = 0; i < kNumCycles; ++i)
+ StringAppendF(&times, L"%.2f,", timings[i].InMillisecondsF());
+ PrintResultList(L"new_tab", L"", label, times, L"ms", important);
}
// Run the test, by bringing up a browser and timing the new tab startup.
// |want_warm| is true if we should output warm-disk timings, false if
// we should report cold timings.
- void RunStartupTest(bool want_warm) {
+ void RunStartupTest(const wchar_t* label, bool want_warm, bool important) {
// Install the location of the test profile file.
set_template_user_data(ComputeTypicalUserDataSource());
@@ -94,41 +92,18 @@ class NewTabUIStartupTest : public UITest {
UITest::TearDown();
}
- // The buildbot log-scraper looks for this "__.._pages" line to tell when
- // the test has completed and how many pages it loaded.
- printf("\n__ts_pages = [about:blank]\n");
- PrintTimings("__ts_timings", timings);
+ PrintTimings(label, timings, important);
}
};
-// The name of this test is important, since the buildbot runs with a gTest
-// filter.
-typedef NewTabUIStartupTest NewTabUIStartupTestReference;
-
} // namespace
+// TODO(pamg): run these tests with a reference build?
+
TEST_F(NewTabUIStartupTest, PerfCold) {
- RunStartupTest(false);
+ RunStartupTest(L"tab_cold", false /* not cold */, true /* important */);
}
TEST_F(NewTabUIStartupTest, DISABLED_PerfWarm) {
- RunStartupTest(true);
-}
-
-TEST_F(NewTabUIStartupTestReference, FakePerfForLogScraperCold) {
- // Print an empty reference-test result line so the log-scraper is happy.
- // TODO(pamg): really run the test with a reference build?
- TimeDelta timings[kNumCycles];
- for (int i = 0; i < kNumCycles; ++i)
- timings[i] = TimeDelta::FromMilliseconds(0);
- PrintTimings("__ts_reference_timings", timings);
-}
-
-TEST_F(NewTabUIStartupTestReference, FakePerfForLogScraperWarm) {
- // Print an empty reference-test result line so the log-scraper is happy.
- // TODO(pamg): really run the test with a reference build?
- TimeDelta timings[kNumCycles];
- for (int i = 0; i < kNumCycles; ++i)
- timings[i] = TimeDelta::FromMilliseconds(0);
- PrintTimings("__ts_reference_timings", timings);
+ RunStartupTest(L"tab_warm", true /* cold */, false /* not important */);
}