@@ -152,6 +152,42 @@ - (void)testListWithPageSizeAndPageToken {
152
152
[FIRStorageTestHelpers waitForExpectation: self ];
153
153
}
154
154
155
+ - (void )testPercentEncodesPlusToken {
156
+ XCTestExpectation *expectation = [self expectationWithDescription: @" testPercentEncodesPlusToken" ];
157
+ NSURL *expectedURL = [NSURL URLWithString: @" https://firebasestorage.googleapis.com/v0/b/bucket/"
158
+ @" o?prefix=%2Bfoo/&delimiter=/" ];
159
+
160
+ self.fetcherService .testBlock =
161
+ ^(GTMSessionFetcher *fetcher, GTMSessionFetcherTestResponse response) {
162
+ #pragma clang diagnostic push
163
+ #pragma clang diagnostic ignored "-Warc-retain-cycles"
164
+ XCTAssertEqualObjects (fetcher.request .URL , expectedURL); // Implicitly retains self
165
+ XCTAssertEqualObjects (fetcher.request .HTTPMethod , @" GET" );
166
+ #pragma clang diagnostic pop
167
+ NSHTTPURLResponse *httpResponse = [[NSHTTPURLResponse alloc ] initWithURL: fetcher.request.URL
168
+ statusCode: 200
169
+ HTTPVersion: kHTTPVersion
170
+ headerFields: nil ];
171
+ response (httpResponse, nil , nil );
172
+ };
173
+
174
+ FIRStoragePath *path =
175
+ [FIRStoragePath pathFromString: @" https://firebasestorage.googleapis.com/v0/b/bucket/0/+foo" ];
176
+ FIRStorageReference *ref = [[FIRStorageReference alloc ] initWithStorage: self .storage path: path];
177
+ FIRStorageListTask *task = [[FIRStorageListTask alloc ]
178
+ initWithReference: ref
179
+ fetcherService: self .fetcherService
180
+ dispatchQueue: self .dispatchQueue
181
+ pageSize: nil
182
+ previousPageToken: nil
183
+ completion: ^(FIRStorageListResult *result, NSError *error) {
184
+ [expectation fulfill ];
185
+ }];
186
+ [task enqueue ];
187
+
188
+ [FIRStorageTestHelpers waitForExpectation: self ];
189
+ }
190
+
155
191
- (void )testListWithResponse {
156
192
XCTestExpectation *expectation = [self expectationWithDescription: @" testListWithErrorResponse" ];
157
193
0 commit comments