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/files/file_enumerator.h" | 7 #include "base/files/file_enumerator.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
(...skipping 119 matching lines...) Loading... |
130 // these to a separator that won't trigger escapes. | 130 // these to a separator that won't trigger escapes. |
131 std::replace(user_data_dir_w.begin(), | 131 std::replace(user_data_dir_w.begin(), |
132 user_data_dir_w.end(), '\\', '/'); | 132 user_data_dir_w.end(), '\\', '/'); |
133 #endif | 133 #endif |
134 | 134 |
135 // Rewrite prefs file. | 135 // Rewrite prefs file. |
136 std::vector<base::string16> subst; | 136 std::vector<base::string16> subst; |
137 subst.push_back(base::WideToUTF16(user_data_dir_w)); | 137 subst.push_back(base::WideToUTF16(user_data_dir_w)); |
138 const std::string prefs_string = | 138 const std::string prefs_string = |
139 UTF16ToASCII(ReplaceStringPlaceholders(format_string, subst, NULL)); | 139 UTF16ToASCII(ReplaceStringPlaceholders(format_string, subst, NULL)); |
140 EXPECT_TRUE(file_util::WriteFile(pref_path, prefs_string.c_str(), | 140 EXPECT_TRUE(base::WriteFile(pref_path, prefs_string.c_str(), |
141 prefs_string.size())); | 141 prefs_string.size())); |
142 file_util::EvictFileFromSystemCache(pref_path); | 142 file_util::EvictFileFromSystemCache(pref_path); |
143 } | 143 } |
144 | 144 |
145 // Runs a test which loads |tab_count| tabs on startup, either as command line | 145 // Runs a test which loads |tab_count| tabs on startup, either as command line |
146 // arguments or, if |restore_session| is true, by using session restore. | 146 // arguments or, if |restore_session| is true, by using session restore. |
147 // |nth_timed_tab|, if non-zero, will measure time to load the first n+1 tabs. | 147 // |nth_timed_tab|, if non-zero, will measure time to load the first n+1 tabs. |
148 void RunPerfTestWithManyTabs(const char* graph, const char* trace, | 148 void RunPerfTestWithManyTabs(const char* graph, const char* trace, |
149 int tab_count, int nth_timed_tab, | 149 int tab_count, int nth_timed_tab, |
150 bool restore_session); | 150 bool restore_session); |
(...skipping 322 matching lines...) Loading... |
473 } | 473 } |
474 | 474 |
475 TEST_F(StartupTest, ProfilingScript1) { | 475 TEST_F(StartupTest, ProfilingScript1) { |
476 SetUpWithFileURL(); | 476 SetUpWithFileURL(); |
477 SetUpWithProfiling(); | 477 SetUpWithProfiling(); |
478 RunStartupTest("warm", "profiling_scripts1", WARM, NOT_IMPORTANT, | 478 RunStartupTest("warm", "profiling_scripts1", WARM, NOT_IMPORTANT, |
479 PerfUITestSuite::DEFAULT_THEME, 1, 0); | 479 PerfUITestSuite::DEFAULT_THEME, 1, 0); |
480 } | 480 } |
481 | 481 |
482 } // namespace | 482 } // namespace |
OLD | NEW |