Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: chrome_frame/test/perf/chrome_frame_perftest.cc

Issue 10019015: Update uses of TimeDelta in chrome_frame/*. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "chrome_frame/test/perf/chrome_frame_perftest.h" 4 #include "chrome_frame/test/perf/chrome_frame_perftest.h"
5 5
6 #include <atlwin.h> 6 #include <atlwin.h>
7 #include <atlhost.h> 7 #include <atlhost.h>
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 #include <string> 10 #include <string>
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 TimeTicks start_time, end_time; 333 TimeTicks start_time, end_time;
334 334
335 RunStartupTestImpl(&start_time, &end_time); 335 RunStartupTestImpl(&start_time, &end_time);
336 336
337 timings[i] = end_time - start_time; 337 timings[i] = end_time - start_time;
338 338
339 CoFreeUnusedLibraries(); 339 CoFreeUnusedLibraries();
340 340
341 // TODO(beng): Can't shut down so quickly. Figure out why, and fix. If we 341 // TODO(beng): Can't shut down so quickly. Figure out why, and fix. If we
342 // do, we crash. 342 // do, we crash.
343 base::PlatformThread::Sleep(50); 343 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(50));
ananta 2012/04/13 17:50:21 Are there plans to deprecate the other versions of
344 } 344 }
345 345
346 std::string times; 346 std::string times;
347 for (int i = 0; i < kNumCycles; ++i) 347 for (int i = 0; i < kNumCycles; ++i)
348 base::StringAppendF(&times, "%.2f,", timings[i].InMillisecondsF()); 348 base::StringAppendF(&times, "%.2f,", timings[i].InMillisecondsF());
349 349
350 perf_test::PrintResultList(graph, "", trace, times, "ms", important); 350 perf_test::PrintResultList(graph, "", trace, times, "ms", important);
351 } 351 }
352 352
353 FilePath dir_app_; 353 FilePath dir_app_;
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 chrome_frame_container_->CreateChromeFrameWindow(url.c_str()); 826 chrome_frame_container_->CreateChromeFrameWindow(url.c_str());
827 chrome_frame_container_->CreateControl(true); 827 chrome_frame_container_->CreateControl(true);
828 828
829 module.RunMessageLoop(); 829 module.RunMessageLoop();
830 830
831 chrome_frame_container_->Release(); 831 chrome_frame_container_->Release();
832 832
833 PrintResults(test_name_.c_str()); 833 PrintResults(test_name_.c_str());
834 834
835 CoFreeUnusedLibraries(); 835 CoFreeUnusedLibraries();
836 base::PlatformThread::Sleep(100); 836 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(100));
837 } 837 }
838 838
839 void NavigateImpl(const std::string& url) { 839 void NavigateImpl(const std::string& url) {
840 ASSERT_TRUE(chrome_frame_container_ != NULL); 840 ASSERT_TRUE(chrome_frame_container_ != NULL);
841 ASSERT_TRUE(!url.empty()); 841 ASSERT_TRUE(!url.empty());
842 chrome_frame_container_->Navigate(url.c_str()); 842 chrome_frame_container_->Navigate(url.c_str());
843 } 843 }
844 844
845 void TestCompleted() { 845 void TestCompleted() {
846 // This can get called multiple times if the last url results in a 846 // This can get called multiple times if the last url results in a
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
1599 PrintPerfTestResults(automation_provider_connect_monitor, kNumCycles, 1599 PrintPerfTestResults(automation_provider_connect_monitor, kNumCycles,
1600 "automationproviderconnect"); 1600 "automationproviderconnect");
1601 PrintPerfTestResults(external_tab_navigate_monitor, kNumCycles, 1601 PrintPerfTestResults(external_tab_navigate_monitor, kNumCycles,
1602 "externaltabnavigate"); 1602 "externaltabnavigate");
1603 PrintPerfTestResults(renderer_main_monitor, kNumCycles, 1603 PrintPerfTestResults(renderer_main_monitor, kNumCycles,
1604 "beginrenderermain"); 1604 "beginrenderermain");
1605 #ifdef NDEBUG 1605 #ifdef NDEBUG
1606 PrintPerfTestResults(pre_read_chrome_monitor, kNumCycles, "PreReadImage"); 1606 PrintPerfTestResults(pre_read_chrome_monitor, kNumCycles, "PreReadImage");
1607 #endif // NDEBUG 1607 #endif // NDEBUG
1608 } 1608 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698