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_split.h" | 10 #include "base/string_split.h" |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 // Re-use the profile data after first run so that the noise from | 195 // Re-use the profile data after first run so that the noise from |
196 // creating databases doesn't impact all the runs. | 196 // creating databases doesn't impact all the runs. |
197 clear_profile_ = false; | 197 clear_profile_ = false; |
198 // Clear template_user_data_ so we don't try to copy it over each time | 198 // Clear template_user_data_ so we don't try to copy it over each time |
199 // through. | 199 // through. |
200 set_template_user_data(FilePath()); | 200 set_template_user_data(FilePath()); |
201 } | 201 } |
202 } | 202 } |
203 | 203 |
204 std::string times; | 204 std::string times; |
205 for (int i = 0; i < numCycles; ++i) | 205 for (int i = 0; i < numCycles; ++i) { |
206 StringAppendF(×, "%.2f,", timings[i].end_to_end.InMillisecondsF()); | 206 base::StringAppendF(×, |
| 207 "%.2f,", |
| 208 timings[i].end_to_end.InMillisecondsF()); |
| 209 } |
207 PrintResultList(graph, "", trace, times, "ms", important); | 210 PrintResultList(graph, "", trace, times, "ms", important); |
208 | 211 |
209 if (num_tabs > 0) { | 212 if (num_tabs > 0) { |
210 std::string name_base = trace; | 213 std::string name_base = trace; |
211 std::string name; | 214 std::string name; |
212 | 215 |
213 times.clear(); | 216 times.clear(); |
214 name = name_base + "-start"; | 217 name = name_base + "-start"; |
215 for (int i = 0; i < numCycles; ++i) | 218 for (int i = 0; i < numCycles; ++i) |
216 StringAppendF(×, "%.2f,", timings[i].first_start_ms); | 219 base::StringAppendF(×, "%.2f,", timings[i].first_start_ms); |
217 PrintResultList(graph, "", name.c_str(), times, "ms", important); | 220 PrintResultList(graph, "", name.c_str(), times, "ms", important); |
218 | 221 |
219 times.clear(); | 222 times.clear(); |
220 name = name_base + "-first"; | 223 name = name_base + "-first"; |
221 for (int i = 0; i < numCycles; ++i) | 224 for (int i = 0; i < numCycles; ++i) |
222 StringAppendF(×, "%.2f,", timings[i].first_stop_ms); | 225 base::StringAppendF(×, "%.2f,", timings[i].first_stop_ms); |
223 PrintResultList(graph, "", name.c_str(), times, "ms", important); | 226 PrintResultList(graph, "", name.c_str(), times, "ms", important); |
224 | 227 |
225 if (nth_timed_tab > 0) { | 228 if (nth_timed_tab > 0) { |
226 // Display only the time necessary to load the first n tabs. | 229 // Display only the time necessary to load the first n tabs. |
227 times.clear(); | 230 times.clear(); |
228 name = name_base + "-" + base::IntToString(nth_timed_tab); | 231 name = name_base + "-" + base::IntToString(nth_timed_tab); |
229 for (int i = 0; i < numCycles; ++i) | 232 for (int i = 0; i < numCycles; ++i) |
230 StringAppendF(×, "%.2f,", timings[i].nth_tab_stop_ms); | 233 base::StringAppendF(×, "%.2f,", timings[i].nth_tab_stop_ms); |
231 PrintResultList(graph, "", name.c_str(), times, "ms", important); | 234 PrintResultList(graph, "", name.c_str(), times, "ms", important); |
232 } | 235 } |
233 | 236 |
234 if (num_tabs > 1) { | 237 if (num_tabs > 1) { |
235 // Display the time necessary to load all of the tabs. | 238 // Display the time necessary to load all of the tabs. |
236 times.clear(); | 239 times.clear(); |
237 name = name_base + "-all"; | 240 name = name_base + "-all"; |
238 for (int i = 0; i < numCycles; ++i) | 241 for (int i = 0; i < numCycles; ++i) |
239 StringAppendF(×, "%.2f,", timings[i].last_stop_ms); | 242 base::StringAppendF(×, "%.2f,", timings[i].last_stop_ms); |
240 PrintResultList(graph, "", name.c_str(), times, "ms", important); | 243 PrintResultList(graph, "", name.c_str(), times, "ms", important); |
241 } | 244 } |
242 } | 245 } |
243 } | 246 } |
244 }; | 247 }; |
245 | 248 |
246 TEST_F(StartupTest, PerfWarm) { | 249 TEST_F(StartupTest, PerfWarm) { |
247 RunStartupTest("warm", "t", WARM, IMPORTANT, UITest::DEFAULT_THEME, 0, 0); | 250 RunStartupTest("warm", "t", WARM, IMPORTANT, UITest::DEFAULT_THEME, 0, 0); |
248 } | 251 } |
249 | 252 |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 UITest::CUSTOM_FRAME, 0, 0); | 393 UITest::CUSTOM_FRAME, 0, 0); |
391 } | 394 } |
392 | 395 |
393 TEST_F(StartupTest, PerfNativeFrameGtkTheme) { | 396 TEST_F(StartupTest, PerfNativeFrameGtkTheme) { |
394 RunStartupTest("warm", "custom-frame-gtk-theme", WARM, NOT_IMPORTANT, | 397 RunStartupTest("warm", "custom-frame-gtk-theme", WARM, NOT_IMPORTANT, |
395 UITest::CUSTOM_FRAME_NATIVE_THEME, 0, 0); | 398 UITest::CUSTOM_FRAME_NATIVE_THEME, 0, 0); |
396 } | 399 } |
397 #endif | 400 #endif |
398 | 401 |
399 } // namespace | 402 } // namespace |
OLD | NEW |