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

Unified Diff: ios/web/public/test/fakes/crw_test_web_state_observer.h

Issue 2674503002: Unit tests for WebStateObserverBridge class. (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/BUILD.gn ('k') | ios/web/public/test/fakes/crw_test_web_state_observer.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/public/test/fakes/crw_test_web_state_observer.h
diff --git a/ios/web/public/test/fakes/crw_test_web_state_observer.h b/ios/web/public/test/fakes/crw_test_web_state_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..fb5fe73117eab52fc3ae33f270aac4bf2a8a0211
--- /dev/null
+++ b/ios/web/public/test/fakes/crw_test_web_state_observer.h
@@ -0,0 +1,147 @@
+// Copyright 2017 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_WEB_PUBLIC_TEST_FAKES_CRW_TEST_WEB_STATE_OBSERVER_H_
+#define IOS_WEB_PUBLIC_TEST_FAKES_CRW_TEST_WEB_STATE_OBSERVER_H_
+
+#include "ios/web/public/favicon_url.h"
+#include "ios/web/public/load_committed_details.h"
+#import "ios/web/public/web_state/web_state_observer_bridge.h"
+#import "ios/web/public/web_state/web_state.h"
+
+namespace web {
+
+// Arguments passed to |webState:didStartProvisionalNavigationForURL:|.
+struct TestStartProvisionalNavigationInfo {
marq (ping after 24h) 2017/02/02 17:59:25 Naming: should all of the indentifiers s/Test/Fake
Eugene But (OOO till 7-30) 2017/02/02 18:24:26 We have bunch of existing fakes prefixed as Test,
+ WebState* web_state;
+ GURL url;
+};
+
+// Arguments passed to |webState:didCommitNavigationWithDetails:|.
+struct TestCommitNavigationInfo {
+ WebState* web_state;
+ LoadCommittedDetails load_details;
+};
+
+// Arguments passed to |webState:didLoadPageWithSuccess:|.
+struct TestLoadPageInfo {
+ WebState* web_state;
+ BOOL success;
+};
+
+// Arguments passed to |webStateDidDismissInterstitial:|.
+struct TestDismissInterstitialInfo {
+ WebState* web_state;
+};
+
+// Arguments passed to |webStateDidChangeURLHash:|.
+struct TestChangeUrlHashInfo {
+ WebState* web_state;
+};
+
+// Arguments passed to |webStateDidChangeHistoryState:|.
+struct TestChangeHistoryStateInfo {
+ WebState* web_state;
+};
+
+// Arguments passed to |webState:didChangeLoadingProgress:|.
+struct TestChangeLoadingProgressInfo {
+ WebState* web_state;
+ double progress;
+};
+
+// Arguments passed to |webState:didSubmitDocumentWithFormNamed:userInitiated:|.
+struct TestSubmitDocumentInfo {
+ WebState* web_state;
+ std::string form_name;
+ BOOL user_initiated;
+};
+
+// Arguments passed to
+// |webState:didRegisterFormActivityWithFormNamed:fieldName:type:value:|.
+struct TestFormActivityInfo {
+ TestFormActivityInfo();
+ ~TestFormActivityInfo();
+ WebState* web_state;
+ std::string form_name;
+ std::string field_name;
+ std::string type;
+ std::string value;
+ bool input_missing;
+};
+
+// Arguments passed to |webState:didUpdateFaviconURLCandidates|.
+struct TestUpdateFaviconUrlCandidatesInfo {
+ TestUpdateFaviconUrlCandidatesInfo();
+ ~TestUpdateFaviconUrlCandidatesInfo();
+ WebState* web_state;
+ std::vector<web::FaviconURL> candidates;
+};
+
+// Arguments passed to |webState:renderProcessGoneForWebState:|.
+struct TestRenderProcessGoneInfo {
+ WebState* web_state;
+};
+
+// Arguments passed to |webStateDestroyed:|.
+struct TestWebStateDestroyedInfo {
+ WebState* web_state;
+};
+
+// Arguments passed to |webStateDidStopLoading:|.
+struct TestStopLoadingInfo {
+ WebState* web_state;
+};
+
+// Arguments passed to |webStateDidStartLoading:|.
+struct TestStartLoadingInfo {
+ WebState* web_state;
+};
+
+} // namespace web
+
+// Test implementation of CRWWebStateObserver protocol.
+@interface CRWTestWebStateObserver : NSObject<CRWWebStateObserver>
+
+// Arguments passed to |webState:didStartProvisionalNavigationForURL:|.
+@property(nonatomic, readonly)
+ web::TestStartProvisionalNavigationInfo* startProvisionalNavigationInfo;
+// Arguments passed to |webState:didCommitNavigationWithDetails:|.
+@property(nonatomic, readonly)
+ web::TestCommitNavigationInfo* commitNavigationInfo;
+// Arguments passed to |webState:didLoadPageWithSuccess:|.
+@property(nonatomic, readonly) web::TestLoadPageInfo* loadPageInfo;
+// Arguments passed to |webStateDidDismissInterstitial:|.
+@property(nonatomic, readonly)
+ web::TestDismissInterstitialInfo* dismissInterstitialInfo;
+// Arguments passed to |webStateDidChangeURLHash:|.
+@property(nonatomic, readonly) web::TestChangeUrlHashInfo* changeUrlHashInfo;
+// Arguments passed to |webStateDidChangeHistoryState:|.
+@property(nonatomic, readonly)
+ web::TestChangeHistoryStateInfo* changeHistoryStateInfo;
+// Arguments passed to |webState:didChangeLoadingProgress:|.
+@property(nonatomic, readonly)
+ web::TestChangeLoadingProgressInfo* changeLoadingProgressInfo;
+// Arguments passed to |webState:didSubmitDocumentWithFormNamed:userInitiated:|.
+@property(nonatomic, readonly) web::TestSubmitDocumentInfo* submitDocumentInfo;
+// Arguments passed to
+// |webState:didRegisterFormActivityWithFormNamed:fieldName:type:value:|.
+@property(nonatomic, readonly) web::TestFormActivityInfo* formActivityInfo;
+// Arguments passed to |webState:didUpdateFaviconURLCandidates|.
+@property(nonatomic, readonly)
+ web::TestUpdateFaviconUrlCandidatesInfo* updateFaviconUrlCandidatesInfo;
+// Arguments passed to |webState:renderProcessGoneForWebState:|.
+@property(nonatomic, readonly)
+ web::TestRenderProcessGoneInfo* renderProcessGoneInfo;
+// Arguments passed to |webStateDestroyed:|.
+@property(nonatomic, readonly)
+ web::TestWebStateDestroyedInfo* webStateDestroyedInfo;
+// Arguments passed to |webStateDidStopLoading:|.
+@property(nonatomic, readonly) web::TestStopLoadingInfo* stopLoadingInfo;
+// Arguments passed to |webStateDidStartLoading:|.
+@property(nonatomic, readonly) web::TestStartLoadingInfo* startLoadingInfo;
+
+@end
+
+#endif // IOS_WEB_PUBLIC_TEST_FAKES_CRW_TEST_WEB_STATE_OBSERVER_H_
« no previous file with comments | « ios/web/BUILD.gn ('k') | ios/web/public/test/fakes/crw_test_web_state_observer.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698