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

Unified Diff: ios/chrome/browser/test/perf_test_with_bvc_ios.h

Issue 2585233003: Upstream Chrome on iOS source code [2/11]. (Closed)
Patch Set: Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/chrome/browser/tabs/tab_unittest.mm ('k') | ios/chrome/browser/test/perf_test_with_bvc_ios.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « ios/chrome/browser/tabs/tab_unittest.mm ('k') | ios/chrome/browser/test/perf_test_with_bvc_ios.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698