summaryrefslogtreecommitdiffstats
path: root/chrome/test/startup
diff options
context:
space:
mode:
authormattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-07 01:46:35 +0000
committermattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-07 01:46:35 +0000
commit776da44598dbaac15a5030e9dff99d534ce15281 (patch)
treee3e282b31d056a05267c0e0a86492d2a02104df8 /chrome/test/startup
parent1c0228c6e74cb53f478f18e9fc30938be38d25fb (diff)
downloadchromium_src-776da44598dbaac15a5030e9dff99d534ce15281.zip
chromium_src-776da44598dbaac15a5030e9dff99d534ce15281.tar.gz
chromium_src-776da44598dbaac15a5030e9dff99d534ce15281.tar.bz2
Revert "Add startup tests that log start script, domcontentloaded, and onload."
which failed on XP Perf (single). This reverts commit r28199. TBR=tony Review URL: http://codereview.chromium.org/265002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28209 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/startup')
-rw-r--r--chrome/test/startup/feature_startup_test.cc86
-rw-r--r--chrome/test/startup/startup_test.cc2
2 files changed, 11 insertions, 77 deletions
diff --git a/chrome/test/startup/feature_startup_test.cc b/chrome/test/startup/feature_startup_test.cc
index 5743e35..574b283 100644
--- a/chrome/test/startup/feature_startup_test.cc
+++ b/chrome/test/startup/feature_startup_test.cc
@@ -39,7 +39,11 @@ class NewTabUIStartupTest : public UITest {
PrintResultList("new_tab", "", label, times, "ms", important);
}
- void InitProfile(UITest::ProfileType profile_type) {
+ // 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(const char* label, bool want_warm, bool important,
+ int profile_type) {
profile_type_ = profile_type;
// Install the location of the test profile file.
@@ -49,14 +53,6 @@ class NewTabUIStartupTest : public UITest {
// Disable the first run notification because it has an animation which
// masks any real performance regressions.
launch_arguments_.AppendSwitch(switches::kDisableNewTabFirstRun);
- }
-
- // 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(const char* label, bool want_warm, bool important,
- UITest::ProfileType profile_type) {
- InitProfile(profile_type);
TimeDelta timings[kNumCycles];
for (int i = 0; i < kNumCycles; ++i) {
@@ -70,9 +66,9 @@ class NewTabUIStartupTest : public UITest {
// We resize the window so that we hit the normal layout of the NTP and
// not the small layout mode.
#if defined(OS_WIN)
- // TODO(port): SetBounds returns false when not implemented.
- // It is OK to comment out the resize since it will still be useful to
- // test the default size of the window.
+// TODO(port): SetBounds returns false when not implemented.
+// It is OK to comment out the resize since it will still be useful to test the
+// default size of the window.
ASSERT_TRUE(window->GetWindow().get()->SetBounds(gfx::Rect(1000, 1000)));
#endif
int tab_count = -1;
@@ -84,14 +80,15 @@ class NewTabUIStartupTest : public UITest {
ASSERT_TRUE(window->WaitForTabCountToBecome(2, 5000));
int load_time;
ASSERT_TRUE(automation()->WaitForInitialNewTabUILoad(&load_time));
+ timings[i] = TimeDelta::FromMilliseconds(load_time);
if (want_warm) {
// Bring up a second tab, now that we've already shown one tab.
window->ApplyAccelerator(IDC_NEW_TAB);
ASSERT_TRUE(window->WaitForTabCountToBecome(3, 5000));
ASSERT_TRUE(automation()->WaitForInitialNewTabUILoad(&load_time));
+ timings[i] = TimeDelta::FromMilliseconds(load_time);
}
- timings[i] = TimeDelta::FromMilliseconds(load_time);
window = NULL;
UITest::TearDown();
@@ -99,65 +96,6 @@ class NewTabUIStartupTest : public UITest {
PrintTimings(label, timings, important);
}
-
- void RunNewTabTimingTest() {
- InitProfile(UITest::DEFAULT_THEME);
-
- TimeDelta scriptstart_times[kNumCycles];
- TimeDelta domcontentloaded_times[kNumCycles];
- TimeDelta onload_times[kNumCycles];
-
- for (int i = 0; i < kNumCycles; ++i) {
- UITest::SetUp();
-
- // Switch to the "new tab" tab, which should be any new tab after the
- // first (the first is about:blank).
- scoped_refptr<BrowserProxy> window(automation()->GetBrowserWindow(0));
- ASSERT_TRUE(window.get());
-
- // We resize the window so that we hit the normal layout of the NTP and
- // not the small layout mode.
-#if defined(OS_WIN)
- // TODO(port): SetBounds returns false when not implemented.
- // It is OK to comment out the resize since it will still be useful to
- // test the default size of the window.
- ASSERT_TRUE(window->GetWindow().get()->SetBounds(gfx::Rect(1000, 1000)));
-#endif
- int tab_count = -1;
- ASSERT_TRUE(window->GetTabCount(&tab_count));
- ASSERT_EQ(1, tab_count);
-
- // Hit ctl-t and wait for the tab to load.
- window->ApplyAccelerator(IDC_NEW_TAB);
- ASSERT_TRUE(window->WaitForTabCountToBecome(2, 5000));
- int duration;
- ASSERT_TRUE(automation()->WaitForInitialNewTabUILoad(&duration));
-
- // Collect the timing information.
- ASSERT_TRUE(automation()->GetMetricEventDuration("NewTab.ScriptStart",
- &duration));
- ASSERT_NE(duration, -1);
- scriptstart_times[i] = TimeDelta::FromMilliseconds(duration);
-
- ASSERT_TRUE(automation()->GetMetricEventDuration(
- "NewTab.DOMContentLoaded", &duration));
- ASSERT_NE(duration, -1);
- domcontentloaded_times[i] = TimeDelta::FromMilliseconds(duration);
-
- ASSERT_TRUE(automation()->GetMetricEventDuration("NewTab.Onload",
- &duration));
- ASSERT_NE(duration, -1);
- onload_times[i] = TimeDelta::FromMilliseconds(duration);
-
- window = NULL;
- UITest::TearDown();
- }
-
- PrintTimings("script_start", scriptstart_times, false /* important */);
- PrintTimings("domcontent_loaded", domcontentloaded_times,
- false /* important */);
- PrintTimings("onload", onload_times, false /* important */);
- }
};
// TODO(pamg): run these tests with a reference build?
@@ -177,10 +115,6 @@ TEST_F(NewTabUIStartupTest, ComplexThemeCold) {
UITest::COMPLEX_THEME);
}
-TEST_F(NewTabUIStartupTest, NewTabTimingTestsCold) {
- RunNewTabTimingTest();
-}
-
#if defined(OS_LINUX)
TEST_F(NewTabUIStartupTest, GtkThemeCold) {
RunStartupTest("tab_gtk_theme_cold", false /* cold */,
diff --git a/chrome/test/startup/startup_test.cc b/chrome/test/startup/startup_test.cc
index 7e52741..69035d8 100644
--- a/chrome/test/startup/startup_test.cc
+++ b/chrome/test/startup/startup_test.cc
@@ -50,7 +50,7 @@ class StartupTest : public UITest {
}
void RunStartupTest(const char* graph, const char* trace,
- bool test_cold, bool important, UITest::ProfileType profile_type) {
+ bool test_cold, bool important, int profile_type) {
profile_type_ = profile_type;
// Sets the profile data for the run. For now, this is only used for