@@ -100,18 +100,14 @@ TEST_F(LibcurlHttpFetcherTest, CouldNotResolveHostTest) {
100
100
101
101
libcurl_fetcher_.BeginTransfer (" https://An-uNres0lvable-uRl.invalid" );
102
102
103
- #ifdef __ANDROID__
104
103
// It's slower on Android that libcurl handle may not finish within 1 cycle.
105
104
// Will need to wait for more cycles until it finishes. Original test didn't
106
105
// correctly handle when we need to re-watch libcurl fds.
107
106
while (loop_.PendingTasks () &&
108
107
libcurl_fetcher_.GetAuxiliaryErrorCode () == ErrorCode::kSuccess ) {
109
108
loop_.RunOnce (true );
110
109
}
111
- #else
112
- // The first time it can't resolve.
113
- loop_.RunOnce (true );
114
- #endif
110
+
115
111
EXPECT_EQ (libcurl_fetcher_.GetAuxiliaryErrorCode (),
116
112
ErrorCode::kUnresolvedHostError );
117
113
@@ -141,18 +137,14 @@ TEST_F(LibcurlHttpFetcherTest, HostResolvedTest) {
141
137
// easier to mock the part that depends on internet connectivity.
142
138
libcurl_fetcher_.BeginTransfer (" https://An-uNres0lvable-uRl.invalid" );
143
139
144
- #ifdef __ANDROID__
145
140
// It's slower on Android that libcurl handle may not finish within 1 cycle.
146
141
// Will need to wait for more cycles until it finishes. Original test didn't
147
142
// correctly handle when we need to re-watch libcurl fds.
148
143
while (loop_.PendingTasks () &&
149
144
libcurl_fetcher_.GetAuxiliaryErrorCode () == ErrorCode::kSuccess ) {
150
145
loop_.RunOnce (true );
151
146
}
152
- #else
153
- // The first time it can't resolve.
154
- loop_.RunOnce (true );
155
- #endif
147
+
156
148
EXPECT_EQ (libcurl_fetcher_.GetAuxiliaryErrorCode (),
157
149
ErrorCode::kUnresolvedHostError );
158
150
@@ -165,19 +157,14 @@ TEST_F(LibcurlHttpFetcherTest, HostResolvedTest) {
165
157
[this ]() { libcurl_fetcher_.http_response_code_ = 0 ; }));
166
158
libcurl_fetcher_.transfer_size_ = 10 ;
167
159
168
- #ifdef __ANDROID__
169
160
// It's slower on Android that libcurl handle may not finish within 1 cycle.
170
161
// Will need to wait for more cycles until it finishes. Original test didn't
171
162
// correctly handle when we need to re-watch libcurl fds.
172
163
while (loop_.PendingTasks () && libcurl_fetcher_.GetAuxiliaryErrorCode () ==
173
164
ErrorCode::kUnresolvedHostError ) {
174
165
loop_.RunOnce (true );
175
166
}
176
- #else
177
- // This time the host is resolved. But after that again we can't resolve
178
- // anymore (See above).
179
- loop_.RunOnce (true );
180
- #endif
167
+
181
168
EXPECT_EQ (libcurl_fetcher_.GetAuxiliaryErrorCode (),
182
169
ErrorCode::kUnresolvedHostRecovered );
183
170
0 commit comments