OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_CHROME_BROWSER_TEST_PERF_TEST_WITH_BVC_IOS_H_ |
| 6 #define IOS_CHROME_BROWSER_TEST_PERF_TEST_WITH_BVC_IOS_H_ |
| 7 |
| 8 #import <UIKit/UIKit.h> |
| 9 |
| 10 #include <memory> |
| 11 |
| 12 #include "base/mac/scoped_nsobject.h" |
| 13 #include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" |
| 14 #include "ios/chrome/test/base/perf_test_ios.h" |
| 15 #include "ios/chrome/test/ios_chrome_scoped_testing_chrome_browser_provider.h" |
| 16 #include "ios/chrome/test/ios_chrome_scoped_testing_local_state.h" |
| 17 #include "ios/web/public/test/scoped_testing_web_client.h" |
| 18 |
| 19 @class BrowserViewController; |
| 20 @class BrowserViewControllerDependencyFactory; |
| 21 @class TabModel; |
| 22 |
| 23 // Base class for performance tests that require a browser view controller. |
| 24 // The BVC requires a non-trivial amount of setup and teardown, so it's best |
| 25 // to derive from this class for tests that require a real BVC. |
| 26 // The class disables prerendering, for better performance numbers. |
| 27 // It uses mock profiles, and testing factories for AutocompleteClassifier. |
| 28 class PerfTestWithBVC : public PerfTest { |
| 29 public: |
| 30 explicit PerfTestWithBVC(std::string testGroup); |
| 31 |
| 32 PerfTestWithBVC(std::string testGroup, |
| 33 std::string firstLabel, |
| 34 std::string averageLabel, |
| 35 bool isWaterfall, |
| 36 bool verbose, |
| 37 bool slowTeardown, |
| 38 int repeat); |
| 39 ~PerfTestWithBVC() override; |
| 40 |
| 41 void SetUp() override; |
| 42 void TearDown() override; |
| 43 |
| 44 protected: |
| 45 // True if the test needs extra time for Teardown. |
| 46 bool slow_teardown_; |
| 47 |
| 48 web::ScopedTestingWebClient web_client_; |
| 49 IOSChromeScopedTestingChromeBrowserProvider provider_; |
| 50 IOSChromeScopedTestingLocalState local_state_; |
| 51 |
| 52 std::unique_ptr<TestChromeBrowserState> chrome_browser_state_; |
| 53 std::unique_ptr<TestChromeBrowserState> incognito_chrome_browser_state_; |
| 54 |
| 55 base::scoped_nsobject<TabModel> tab_model_; |
| 56 base::scoped_nsobject<TabModel> otr_tab_model_; |
| 57 |
| 58 base::scoped_nsobject<BrowserViewControllerDependencyFactory> bvc_factory_; |
| 59 base::scoped_nsobject<BrowserViewController> bvc_; |
| 60 base::scoped_nsobject<UIWindow> window_; |
| 61 }; |
| 62 |
| 63 #endif // IOS_CHROME_BROWSER_TEST_PERF_TEST_WITH_BVC_IOS_H_ |
OLD | NEW |