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

Side by Side 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, 10 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 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_WEB_PUBLIC_TEST_FAKES_CRW_TEST_WEB_STATE_OBSERVER_H_
6 #define IOS_WEB_PUBLIC_TEST_FAKES_CRW_TEST_WEB_STATE_OBSERVER_H_
7
8 #include "ios/web/public/favicon_url.h"
9 #include "ios/web/public/load_committed_details.h"
10 #import "ios/web/public/web_state/web_state_observer_bridge.h"
11 #import "ios/web/public/web_state/web_state.h"
12
13 namespace web {
14
15 // Arguments passed to |webState:didStartProvisionalNavigationForURL:|.
16 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,
17 WebState* web_state;
18 GURL url;
19 };
20
21 // Arguments passed to |webState:didCommitNavigationWithDetails:|.
22 struct TestCommitNavigationInfo {
23 WebState* web_state;
24 LoadCommittedDetails load_details;
25 };
26
27 // Arguments passed to |webState:didLoadPageWithSuccess:|.
28 struct TestLoadPageInfo {
29 WebState* web_state;
30 BOOL success;
31 };
32
33 // Arguments passed to |webStateDidDismissInterstitial:|.
34 struct TestDismissInterstitialInfo {
35 WebState* web_state;
36 };
37
38 // Arguments passed to |webStateDidChangeURLHash:|.
39 struct TestChangeUrlHashInfo {
40 WebState* web_state;
41 };
42
43 // Arguments passed to |webStateDidChangeHistoryState:|.
44 struct TestChangeHistoryStateInfo {
45 WebState* web_state;
46 };
47
48 // Arguments passed to |webState:didChangeLoadingProgress:|.
49 struct TestChangeLoadingProgressInfo {
50 WebState* web_state;
51 double progress;
52 };
53
54 // Arguments passed to |webState:didSubmitDocumentWithFormNamed:userInitiated:|.
55 struct TestSubmitDocumentInfo {
56 WebState* web_state;
57 std::string form_name;
58 BOOL user_initiated;
59 };
60
61 // Arguments passed to
62 // |webState:didRegisterFormActivityWithFormNamed:fieldName:type:value:|.
63 struct TestFormActivityInfo {
64 TestFormActivityInfo();
65 ~TestFormActivityInfo();
66 WebState* web_state;
67 std::string form_name;
68 std::string field_name;
69 std::string type;
70 std::string value;
71 bool input_missing;
72 };
73
74 // Arguments passed to |webState:didUpdateFaviconURLCandidates|.
75 struct TestUpdateFaviconUrlCandidatesInfo {
76 TestUpdateFaviconUrlCandidatesInfo();
77 ~TestUpdateFaviconUrlCandidatesInfo();
78 WebState* web_state;
79 std::vector<web::FaviconURL> candidates;
80 };
81
82 // Arguments passed to |webState:renderProcessGoneForWebState:|.
83 struct TestRenderProcessGoneInfo {
84 WebState* web_state;
85 };
86
87 // Arguments passed to |webStateDestroyed:|.
88 struct TestWebStateDestroyedInfo {
89 WebState* web_state;
90 };
91
92 // Arguments passed to |webStateDidStopLoading:|.
93 struct TestStopLoadingInfo {
94 WebState* web_state;
95 };
96
97 // Arguments passed to |webStateDidStartLoading:|.
98 struct TestStartLoadingInfo {
99 WebState* web_state;
100 };
101
102 } // namespace web
103
104 // Test implementation of CRWWebStateObserver protocol.
105 @interface CRWTestWebStateObserver : NSObject<CRWWebStateObserver>
106
107 // Arguments passed to |webState:didStartProvisionalNavigationForURL:|.
108 @property(nonatomic, readonly)
109 web::TestStartProvisionalNavigationInfo* startProvisionalNavigationInfo;
110 // Arguments passed to |webState:didCommitNavigationWithDetails:|.
111 @property(nonatomic, readonly)
112 web::TestCommitNavigationInfo* commitNavigationInfo;
113 // Arguments passed to |webState:didLoadPageWithSuccess:|.
114 @property(nonatomic, readonly) web::TestLoadPageInfo* loadPageInfo;
115 // Arguments passed to |webStateDidDismissInterstitial:|.
116 @property(nonatomic, readonly)
117 web::TestDismissInterstitialInfo* dismissInterstitialInfo;
118 // Arguments passed to |webStateDidChangeURLHash:|.
119 @property(nonatomic, readonly) web::TestChangeUrlHashInfo* changeUrlHashInfo;
120 // Arguments passed to |webStateDidChangeHistoryState:|.
121 @property(nonatomic, readonly)
122 web::TestChangeHistoryStateInfo* changeHistoryStateInfo;
123 // Arguments passed to |webState:didChangeLoadingProgress:|.
124 @property(nonatomic, readonly)
125 web::TestChangeLoadingProgressInfo* changeLoadingProgressInfo;
126 // Arguments passed to |webState:didSubmitDocumentWithFormNamed:userInitiated:|.
127 @property(nonatomic, readonly) web::TestSubmitDocumentInfo* submitDocumentInfo;
128 // Arguments passed to
129 // |webState:didRegisterFormActivityWithFormNamed:fieldName:type:value:|.
130 @property(nonatomic, readonly) web::TestFormActivityInfo* formActivityInfo;
131 // Arguments passed to |webState:didUpdateFaviconURLCandidates|.
132 @property(nonatomic, readonly)
133 web::TestUpdateFaviconUrlCandidatesInfo* updateFaviconUrlCandidatesInfo;
134 // Arguments passed to |webState:renderProcessGoneForWebState:|.
135 @property(nonatomic, readonly)
136 web::TestRenderProcessGoneInfo* renderProcessGoneInfo;
137 // Arguments passed to |webStateDestroyed:|.
138 @property(nonatomic, readonly)
139 web::TestWebStateDestroyedInfo* webStateDestroyedInfo;
140 // Arguments passed to |webStateDidStopLoading:|.
141 @property(nonatomic, readonly) web::TestStopLoadingInfo* stopLoadingInfo;
142 // Arguments passed to |webStateDidStartLoading:|.
143 @property(nonatomic, readonly) web::TestStartLoadingInfo* startLoadingInfo;
144
145 @end
146
147 #endif // IOS_WEB_PUBLIC_TEST_FAKES_CRW_TEST_WEB_STATE_OBSERVER_H_
OLDNEW
« 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