| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/gfx/rect.h" | 6 #include "base/gfx/rect.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/perftimer.h" | 8 #include "base/perftimer.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // TODO(port): SetBounds returns false when not implemented. | 73 // TODO(port): SetBounds returns false when not implemented. |
| 74 // It is OK to comment out the resize since it will still be useful to | 74 // It is OK to comment out the resize since it will still be useful to |
| 75 // test the default size of the window. | 75 // test the default size of the window. |
| 76 ASSERT_TRUE(window->GetWindow().get()->SetBounds(gfx::Rect(1000, 1000))); | 76 ASSERT_TRUE(window->GetWindow().get()->SetBounds(gfx::Rect(1000, 1000))); |
| 77 #endif | 77 #endif |
| 78 int tab_count = -1; | 78 int tab_count = -1; |
| 79 ASSERT_TRUE(window->GetTabCount(&tab_count)); | 79 ASSERT_TRUE(window->GetTabCount(&tab_count)); |
| 80 ASSERT_EQ(1, tab_count); | 80 ASSERT_EQ(1, tab_count); |
| 81 | 81 |
| 82 // Hit ctl-t and wait for the tab to load. | 82 // Hit ctl-t and wait for the tab to load. |
| 83 window->ApplyAccelerator(IDC_NEW_TAB); | 83 window->RunCommand(IDC_NEW_TAB); |
| 84 ASSERT_TRUE(window->WaitForTabCountToBecome(2, 5000)); | 84 ASSERT_TRUE(window->GetTabCount(&tab_count)); |
| 85 ASSERT_EQ(2, tab_count); |
| 85 int load_time; | 86 int load_time; |
| 86 ASSERT_TRUE(automation()->WaitForInitialNewTabUILoad(&load_time)); | 87 ASSERT_TRUE(automation()->WaitForInitialNewTabUILoad(&load_time)); |
| 87 | 88 |
| 88 if (want_warm) { | 89 if (want_warm) { |
| 89 // Bring up a second tab, now that we've already shown one tab. | 90 // Bring up a second tab, now that we've already shown one tab. |
| 90 window->ApplyAccelerator(IDC_NEW_TAB); | 91 window->RunCommand(IDC_NEW_TAB); |
| 91 ASSERT_TRUE(window->WaitForTabCountToBecome(3, 5000)); | 92 ASSERT_TRUE(window->GetTabCount(&tab_count)); |
| 93 ASSERT_EQ(3, tab_count); |
| 92 ASSERT_TRUE(automation()->WaitForInitialNewTabUILoad(&load_time)); | 94 ASSERT_TRUE(automation()->WaitForInitialNewTabUILoad(&load_time)); |
| 93 } | 95 } |
| 94 timings[i] = TimeDelta::FromMilliseconds(load_time); | 96 timings[i] = TimeDelta::FromMilliseconds(load_time); |
| 95 | 97 |
| 96 window = NULL; | 98 window = NULL; |
| 97 UITest::TearDown(); | 99 UITest::TearDown(); |
| 98 } | 100 } |
| 99 | 101 |
| 100 PrintTimings(label, timings, important); | 102 PrintTimings(label, timings, important); |
| 101 } | 103 } |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 } | 194 } |
| 193 | 195 |
| 194 TEST_F(NewTabUIStartupTest, NativeFrameGtkThemeCold) { | 196 TEST_F(NewTabUIStartupTest, NativeFrameGtkThemeCold) { |
| 195 RunStartupTest("tab_custom_frame_gtk_theme_cold", false /* cold */, | 197 RunStartupTest("tab_custom_frame_gtk_theme_cold", false /* cold */, |
| 196 false /* not important */, | 198 false /* not important */, |
| 197 UITest::CUSTOM_FRAME_NATIVE_THEME); | 199 UITest::CUSTOM_FRAME_NATIVE_THEME); |
| 198 } | 200 } |
| 199 #endif | 201 #endif |
| 200 | 202 |
| 201 } // namespace | 203 } // namespace |
| OLD | NEW |