OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/environment.h" | 5 #include "base/environment.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/platform_thread.h" | 8 #include "base/platform_thread.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 } | 72 } |
73 | 73 |
74 // Use the given profile in the test data extensions/profiles dir. This tests | 74 // Use the given profile in the test data extensions/profiles dir. This tests |
75 // startup with extensions installed. | 75 // startup with extensions installed. |
76 void SetUpWithExtensionsProfile(const char* profile) { | 76 void SetUpWithExtensionsProfile(const char* profile) { |
77 FilePath data_dir; | 77 FilePath data_dir; |
78 PathService::Get(chrome::DIR_TEST_DATA, &data_dir); | 78 PathService::Get(chrome::DIR_TEST_DATA, &data_dir); |
79 data_dir = data_dir.AppendASCII("extensions").AppendASCII("profiles"). | 79 data_dir = data_dir.AppendASCII("extensions").AppendASCII("profiles"). |
80 AppendASCII(profile); | 80 AppendASCII(profile); |
81 set_template_user_data(data_dir); | 81 set_template_user_data(data_dir); |
82 | |
83 // For now, these tests still depend on toolstrips. | |
84 launch_arguments_.AppendSwitch(switches::kEnableExtensionToolstrips); | |
85 } | 82 } |
86 | 83 |
87 // Runs a test which loads |tab_count| tabs on startup, either as command line | 84 // Runs a test which loads |tab_count| tabs on startup, either as command line |
88 // arguments or, if |restore_session| is true, by using session restore. | 85 // arguments or, if |restore_session| is true, by using session restore. |
89 // |nth_timed_tab|, if non-zero, will measure time to load the first n+1 tabs. | 86 // |nth_timed_tab|, if non-zero, will measure time to load the first n+1 tabs. |
90 void RunPerfTestWithManyTabs(const char* graph, const char* trace, | 87 void RunPerfTestWithManyTabs(const char* graph, const char* trace, |
91 int tab_count, int nth_timed_tab, | 88 int tab_count, int nth_timed_tab, |
92 bool restore_session); | 89 bool restore_session); |
93 | 90 |
94 void RunStartupTest(const char* graph, const char* trace, | 91 void RunStartupTest(const char* graph, const char* trace, |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 RunPerfTestWithManyTabs("several_tabs", "restore-ref", 10, 4, true); | 333 RunPerfTestWithManyTabs("several_tabs", "restore-ref", 10, 4, true); |
337 } | 334 } |
338 | 335 |
339 TEST_F(StartupTest, PerfExtensionEmpty) { | 336 TEST_F(StartupTest, PerfExtensionEmpty) { |
340 SetUpWithFileURL(); | 337 SetUpWithFileURL(); |
341 SetUpWithExtensionsProfile("empty"); | 338 SetUpWithExtensionsProfile("empty"); |
342 RunStartupTest("warm", "extension_empty", WARM, NOT_IMPORTANT, | 339 RunStartupTest("warm", "extension_empty", WARM, NOT_IMPORTANT, |
343 UITest::DEFAULT_THEME, 1, 0); | 340 UITest::DEFAULT_THEME, 1, 0); |
344 } | 341 } |
345 | 342 |
346 TEST_F(StartupTest, PerfExtensionToolstrips1) { | |
347 SetUpWithFileURL(); | |
348 SetUpWithExtensionsProfile("toolstrips1"); | |
349 RunStartupTest("warm", "extension_toolstrip1", WARM, NOT_IMPORTANT, | |
350 UITest::DEFAULT_THEME, 1, 0); | |
351 } | |
352 | |
353 TEST_F(StartupTest, PerfExtensionToolstrips50) { | |
354 SetUpWithFileURL(); | |
355 SetUpWithExtensionsProfile("toolstrips50"); | |
356 RunStartupTest("warm", "extension_toolstrip50", WARM, NOT_IMPORTANT, | |
357 UITest::DEFAULT_THEME, 1, 0); | |
358 } | |
359 | |
360 TEST_F(StartupTest, PerfExtensionContentScript1) { | 343 TEST_F(StartupTest, PerfExtensionContentScript1) { |
361 SetUpWithFileURL(); | 344 SetUpWithFileURL(); |
362 SetUpWithExtensionsProfile("content_scripts1"); | 345 SetUpWithExtensionsProfile("content_scripts1"); |
363 RunStartupTest("warm", "extension_content_scripts1", WARM, NOT_IMPORTANT, | 346 RunStartupTest("warm", "extension_content_scripts1", WARM, NOT_IMPORTANT, |
364 UITest::DEFAULT_THEME, 1, 0); | 347 UITest::DEFAULT_THEME, 1, 0); |
365 } | 348 } |
366 | 349 |
367 TEST_F(StartupTest, PerfExtensionContentScript50) { | 350 TEST_F(StartupTest, PerfExtensionContentScript50) { |
368 SetUpWithFileURL(); | 351 SetUpWithFileURL(); |
369 SetUpWithExtensionsProfile("content_scripts50"); | 352 SetUpWithExtensionsProfile("content_scripts50"); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 UITest::CUSTOM_FRAME, 0, 0); | 385 UITest::CUSTOM_FRAME, 0, 0); |
403 } | 386 } |
404 | 387 |
405 TEST_F(StartupTest, PerfNativeFrameGtkTheme) { | 388 TEST_F(StartupTest, PerfNativeFrameGtkTheme) { |
406 RunStartupTest("warm", "custom-frame-gtk-theme", WARM, NOT_IMPORTANT, | 389 RunStartupTest("warm", "custom-frame-gtk-theme", WARM, NOT_IMPORTANT, |
407 UITest::CUSTOM_FRAME_NATIVE_THEME, 0, 0); | 390 UITest::CUSTOM_FRAME_NATIVE_THEME, 0, 0); |
408 } | 391 } |
409 #endif | 392 #endif |
410 | 393 |
411 } // namespace | 394 } // namespace |
OLD | NEW |