| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #import "base/test/ios/wait_util.h" | 5 #import "base/test/ios/wait_util.h" |
| 6 #include "ios/chrome/browser/sessions/ios_chrome_tab_restore_service_factory.h" | 6 #include "ios/chrome/browser/sessions/ios_chrome_tab_restore_service_factory.h" |
| 7 #import "ios/chrome/browser/tabs/tab_model.h" | 7 #import "ios/chrome/browser/tabs/tab_model.h" |
| 8 #include "ios/chrome/browser/test/perf_test_with_bvc_ios.h" | 8 #include "ios/chrome/browser/test/perf_test_with_bvc_ios.h" |
| 9 #import "ios/chrome/browser/ui/browser_view_controller.h" | 9 #import "ios/chrome/browser/ui/browser_view_controller.h" |
| 10 #import "ios/chrome/browser/ui/browser_view_controller_dependency_factory.h" | 10 #import "ios/chrome/browser/ui/browser_view_controller_dependency_factory.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 chrome_browser_state_.get(), | 31 chrome_browser_state_.get(), |
| 32 IOSChromeTabRestoreServiceFactory::GetDefaultFactory()); | 32 IOSChromeTabRestoreServiceFactory::GetDefaultFactory()); |
| 33 } | 33 } |
| 34 base::TimeDelta TimedNewTab() { | 34 base::TimeDelta TimedNewTab() { |
| 35 base::Time startTime = base::Time::NowFromSystemTime(); | 35 base::Time startTime = base::Time::NowFromSystemTime(); |
| 36 [bvc_ newTab:nil]; | 36 [bvc_ newTab:nil]; |
| 37 return base::Time::NowFromSystemTime() - startTime; | 37 return base::Time::NowFromSystemTime() - startTime; |
| 38 } | 38 } |
| 39 void SettleUI() { | 39 void SettleUI() { |
| 40 base::test::ios::WaitUntilCondition( | 40 base::test::ios::WaitUntilCondition( |
| 41 nil, nullptr, base::TimeDelta::FromSecondsD(kMaxUICatchupDelay)); | 41 nil, false, base::TimeDelta::FromSecondsD(kMaxUICatchupDelay)); |
| 42 } | 42 } |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 // Output format first test: | 45 // Output format first test: |
| 46 // [*]RESULT NTP - Create: NTP Gentle Create First Tab= number ms | 46 // [*]RESULT NTP - Create: NTP Gentle Create First Tab= number ms |
| 47 // Output format subsequent average: | 47 // Output format subsequent average: |
| 48 // [*]RESULT NTP - Create: NTP Gentle Create= number ms | 48 // [*]RESULT NTP - Create: NTP Gentle Create= number ms |
| 49 TEST_F(NewTabPagePerfTest, OpenNTP_Gentle) { | 49 TEST_F(NewTabPagePerfTest, OpenNTP_Gentle) { |
| 50 RepeatTimedRuns("NTP Gentle Create", | 50 RepeatTimedRuns("NTP Gentle Create", |
| 51 ^(int index) { | 51 ^(int index) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 64 RepeatTimedRuns("NTP Hammer Create", | 64 RepeatTimedRuns("NTP Hammer Create", |
| 65 ^(int index) { | 65 ^(int index) { |
| 66 return TimedNewTab(); | 66 return TimedNewTab(); |
| 67 }, | 67 }, |
| 68 nil); | 68 nil); |
| 69 // Allows the run loops to run before teardown. | 69 // Allows the run loops to run before teardown. |
| 70 SettleUI(); | 70 SettleUI(); |
| 71 } | 71 } |
| 72 | 72 |
| 73 } // anonymous namespace | 73 } // anonymous namespace |
| OLD | NEW |