| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/stringprintf.h" | 8 #include "base/stringprintf.h" |
| 9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/string_split.h" | 10 #include "base/string_split.h" |
| 11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
| 12 #include "base/sys_info.h" | 12 #include "base/sys_info.h" |
| 13 #include "base/test/test_file_util.h" | 13 #include "base/test/test_file_util.h" |
| 14 #include "base/test/test_timeouts.h" | 14 #include "base/test/test_timeouts.h" |
| 15 #include "base/time.h" | 15 #include "base/time.h" |
| 16 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
| 17 #include "chrome/common/chrome_constants.h" | 17 #include "chrome/common/chrome_constants.h" |
| 18 #include "chrome/common/chrome_paths.h" | 18 #include "chrome/common/chrome_paths.h" |
| 19 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
| 20 #include "chrome/common/env_vars.h" | 20 #include "chrome/common/env_vars.h" |
| 21 #include "chrome/test/automation/automation_proxy.h" | 21 #include "chrome/test/automation/automation_proxy.h" |
| 22 #include "chrome/test/base/testing_profile.h" |
| 22 #include "chrome/test/base/test_switches.h" | 23 #include "chrome/test/base/test_switches.h" |
| 23 #include "chrome/test/base/ui_test_utils.h" | 24 #include "chrome/test/base/ui_test_utils.h" |
| 24 #include "chrome/test/perf/perf_test.h" | 25 #include "chrome/test/perf/perf_test.h" |
| 25 #include "chrome/test/ui/ui_perf_test.h" | 26 #include "chrome/test/ui/ui_perf_test.h" |
| 26 #include "net/base/net_util.h" | 27 #include "net/base/net_util.h" |
| 27 | 28 |
| 28 using base::TimeDelta; | 29 using base::TimeDelta; |
| 29 using base::TimeTicks; | 30 using base::TimeTicks; |
| 30 | 31 |
| 31 namespace { | 32 namespace { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 AppendASCII(profile); | 98 AppendASCII(profile); |
| 98 set_template_user_data(data_dir); | 99 set_template_user_data(data_dir); |
| 99 } | 100 } |
| 100 | 101 |
| 101 // Rewrite the preferences file to point to the proper image directory. | 102 // Rewrite the preferences file to point to the proper image directory. |
| 102 virtual void SetUpProfile() { | 103 virtual void SetUpProfile() { |
| 103 UIPerfTest::SetUpProfile(); | 104 UIPerfTest::SetUpProfile(); |
| 104 if (profile_type_ != UITestBase::COMPLEX_THEME) | 105 if (profile_type_ != UITestBase::COMPLEX_THEME) |
| 105 return; | 106 return; |
| 106 | 107 |
| 107 const FilePath pref_template_path(user_data_dir().AppendASCII("Default"). | 108 const FilePath pref_template_path(user_data_dir(). |
| 109 AppendASCII("Default"). |
| 108 AppendASCII("PreferencesTemplate")); | 110 AppendASCII("PreferencesTemplate")); |
| 109 const FilePath pref_path(user_data_dir().AppendASCII("Default"). | 111 const FilePath pref_path(user_data_dir(). |
| 112 AppendASCII(TestingProfile::kTestUserProfileDir). |
| 110 AppendASCII("Preferences")); | 113 AppendASCII("Preferences")); |
| 111 | 114 |
| 112 // Read in preferences template. | 115 // Read in preferences template. |
| 113 std::string pref_string; | 116 std::string pref_string; |
| 114 EXPECT_TRUE(file_util::ReadFileToString(pref_template_path, &pref_string)); | 117 EXPECT_TRUE(file_util::ReadFileToString(pref_template_path, &pref_string)); |
| 115 string16 format_string = ASCIIToUTF16(pref_string); | 118 string16 format_string = ASCIIToUTF16(pref_string); |
| 116 | 119 |
| 117 // Make sure temp directory has the proper format for writing to prefs file. | 120 // Make sure temp directory has the proper format for writing to prefs file. |
| 118 #if defined(OS_POSIX) | 121 #if defined(OS_POSIX) |
| 119 std::wstring user_data_dir_w(ASCIIToWide(user_data_dir().value())); | 122 std::wstring user_data_dir_w(ASCIIToWide(user_data_dir().value())); |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 UITestBase::CUSTOM_FRAME, 0, 0); | 479 UITestBase::CUSTOM_FRAME, 0, 0); |
| 477 } | 480 } |
| 478 | 481 |
| 479 TEST_F(StartupTest, PerfNativeFrameGtkTheme) { | 482 TEST_F(StartupTest, PerfNativeFrameGtkTheme) { |
| 480 RunStartupTest("warm", "custom-frame-gtk-theme", WARM, NOT_IMPORTANT, | 483 RunStartupTest("warm", "custom-frame-gtk-theme", WARM, NOT_IMPORTANT, |
| 481 UITestBase::CUSTOM_FRAME_NATIVE_THEME, 0, 0); | 484 UITestBase::CUSTOM_FRAME_NATIVE_THEME, 0, 0); |
| 482 } | 485 } |
| 483 #endif | 486 #endif |
| 484 | 487 |
| 485 } // namespace | 488 } // namespace |
| OLD | NEW |