Index: ios/chrome/browser/test/perf_test_with_bvc_ios.h |
diff --git a/ios/chrome/browser/test/perf_test_with_bvc_ios.h b/ios/chrome/browser/test/perf_test_with_bvc_ios.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6ddb4a1309243bff168eed2390e9dc643a591c78 |
--- /dev/null |
+++ b/ios/chrome/browser/test/perf_test_with_bvc_ios.h |
@@ -0,0 +1,63 @@ |
+// Copyright 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef IOS_CHROME_BROWSER_TEST_PERF_TEST_WITH_BVC_IOS_H_ |
+#define IOS_CHROME_BROWSER_TEST_PERF_TEST_WITH_BVC_IOS_H_ |
+ |
+#import <UIKit/UIKit.h> |
+ |
+#include <memory> |
+ |
+#include "base/mac/scoped_nsobject.h" |
+#include "ios/chrome/browser/browser_state/test_chrome_browser_state.h" |
+#include "ios/chrome/test/base/perf_test_ios.h" |
+#include "ios/chrome/test/ios_chrome_scoped_testing_chrome_browser_provider.h" |
+#include "ios/chrome/test/ios_chrome_scoped_testing_local_state.h" |
+#include "ios/web/public/test/scoped_testing_web_client.h" |
+ |
+@class BrowserViewController; |
+@class BrowserViewControllerDependencyFactory; |
+@class TabModel; |
+ |
+// Base class for performance tests that require a browser view controller. |
+// The BVC requires a non-trivial amount of setup and teardown, so it's best |
+// to derive from this class for tests that require a real BVC. |
+// The class disables prerendering, for better performance numbers. |
+// It uses mock profiles, and testing factories for AutocompleteClassifier. |
+class PerfTestWithBVC : public PerfTest { |
+ public: |
+ explicit PerfTestWithBVC(std::string testGroup); |
+ |
+ PerfTestWithBVC(std::string testGroup, |
+ std::string firstLabel, |
+ std::string averageLabel, |
+ bool isWaterfall, |
+ bool verbose, |
+ bool slowTeardown, |
+ int repeat); |
+ ~PerfTestWithBVC() override; |
+ |
+ void SetUp() override; |
+ void TearDown() override; |
+ |
+ protected: |
+ // True if the test needs extra time for Teardown. |
+ bool slow_teardown_; |
+ |
+ web::ScopedTestingWebClient web_client_; |
+ IOSChromeScopedTestingChromeBrowserProvider provider_; |
+ IOSChromeScopedTestingLocalState local_state_; |
+ |
+ std::unique_ptr<TestChromeBrowserState> chrome_browser_state_; |
+ std::unique_ptr<TestChromeBrowserState> incognito_chrome_browser_state_; |
+ |
+ base::scoped_nsobject<TabModel> tab_model_; |
+ base::scoped_nsobject<TabModel> otr_tab_model_; |
+ |
+ base::scoped_nsobject<BrowserViewControllerDependencyFactory> bvc_factory_; |
+ base::scoped_nsobject<BrowserViewController> bvc_; |
+ base::scoped_nsobject<UIWindow> window_; |
+}; |
+ |
+#endif // IOS_CHROME_BROWSER_TEST_PERF_TEST_WITH_BVC_IOS_H_ |