| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "modules/fetch/FetchBlobDataConsumerHandle.h" | 5 #include "modules/fetch/FetchBlobDataConsumerHandle.h" |
| 6 | 6 |
| 7 #include "core/dom/ExecutionContext.h" | 7 #include "core/dom/ExecutionContext.h" |
| 8 #include "core/fetch/ResourceLoaderOptions.h" | 8 #include "core/fetch/ResourceLoaderOptions.h" |
| 9 #include "core/loader/MockThreadableLoader.h" | 9 #include "core/loader/MockThreadableLoader.h" |
| 10 #include "core/loader/ThreadableLoaderClient.h" | 10 #include "core/loader/ThreadableLoaderClient.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 Return(loader.get()))); | 105 Return(loader.get()))); |
| 106 EXPECT_CALL(*loader, start(_)).WillOnce(SaveArg<0>(&request)); | 106 EXPECT_CALL(*loader, start(_)).WillOnce(SaveArg<0>(&request)); |
| 107 EXPECT_CALL(checkpoint, Call(2)); | 107 EXPECT_CALL(checkpoint, Call(2)); |
| 108 EXPECT_CALL(*loader, cancel()); | 108 EXPECT_CALL(*loader, cancel()); |
| 109 | 109 |
| 110 RefPtr<BlobDataHandle> blobDataHandle = createBlobDataHandle("Once upon a ti
me"); | 110 RefPtr<BlobDataHandle> blobDataHandle = createBlobDataHandle("Once upon a ti
me"); |
| 111 std::unique_ptr<WebDataConsumerHandle> handle | 111 std::unique_ptr<WebDataConsumerHandle> handle |
| 112 = FetchBlobDataConsumerHandle::create(&document(), blobDataHandle, facto
ry); | 112 = FetchBlobDataConsumerHandle::create(&document(), blobDataHandle, facto
ry); |
| 113 testing::runPendingTasks(); | 113 testing::runPendingTasks(); |
| 114 | 114 |
| 115 char buffer[1]; |
| 115 size_t size = 0; | 116 size_t size = 0; |
| 116 handle->obtainReader(nullptr)->read(nullptr, 0, kNone, &size); | 117 ASSERT_EQ(kShouldWait, handle->obtainReader(nullptr)->read(buffer, sizeof(bu
ffer), kNone, &size)); |
| 117 checkpoint.Call(1); | 118 checkpoint.Call(1); |
| 118 testing::runPendingTasks(); | 119 testing::runPendingTasks(); |
| 119 checkpoint.Call(2); | 120 checkpoint.Call(2); |
| 120 | 121 |
| 121 EXPECT_TRUE(request.url().getString().startsWith("blob:")); | 122 EXPECT_TRUE(request.url().getString().startsWith("blob:")); |
| 122 EXPECT_TRUE(request.useStreamOnResponse()); | 123 EXPECT_TRUE(request.useStreamOnResponse()); |
| 123 | 124 |
| 124 EXPECT_EQ(ConsiderPreflight, options.preflightPolicy); | 125 EXPECT_EQ(ConsiderPreflight, options.preflightPolicy); |
| 125 EXPECT_EQ(DenyCrossOriginRequests, options.crossOriginRequestPolicy); | 126 EXPECT_EQ(DenyCrossOriginRequests, options.crossOriginRequestPolicy); |
| 126 EXPECT_EQ(DoNotEnforceContentSecurityPolicy, options.contentSecurityPolicyEn
forcement); | 127 EXPECT_EQ(DoNotEnforceContentSecurityPolicy, options.contentSecurityPolicyEn
forcement); |
| 127 | 128 |
| 128 EXPECT_EQ(DoNotBufferData, resourceLoaderOptions.dataBufferingPolicy); | 129 EXPECT_EQ(DoNotBufferData, resourceLoaderOptions.dataBufferingPolicy); |
| 129 EXPECT_EQ(DoNotAllowStoredCredentials, resourceLoaderOptions.allowCredential
s); | 130 EXPECT_EQ(DoNotAllowStoredCredentials, resourceLoaderOptions.allowCredential
s); |
| 130 EXPECT_EQ(ClientDidNotRequestCredentials, resourceLoaderOptions.credentialsR
equested); | 131 EXPECT_EQ(ClientDidNotRequestCredentials, resourceLoaderOptions.credentialsR
equested); |
| 131 EXPECT_EQ(CheckContentSecurityPolicy, resourceLoaderOptions.contentSecurityP
olicyOption); | 132 EXPECT_EQ(CheckContentSecurityPolicy, resourceLoaderOptions.contentSecurityP
olicyOption); |
| 132 EXPECT_EQ(DocumentContext, resourceLoaderOptions.requestInitiatorContext); | 133 EXPECT_EQ(DocumentContext, resourceLoaderOptions.requestInitiatorContext); |
| 133 EXPECT_EQ(RequestAsynchronously, resourceLoaderOptions.synchronousPolicy); | 134 EXPECT_EQ(RequestAsynchronously, resourceLoaderOptions.synchronousPolicy); |
| 134 EXPECT_EQ(NotCORSEnabled, resourceLoaderOptions.corsEnabled); | 135 EXPECT_EQ(NotCORSEnabled, resourceLoaderOptions.corsEnabled); |
| 135 } | 136 } |
| 136 | 137 |
| 138 TEST_F(FetchBlobDataConsumerHandleTest, ZeroByteReadDoesNotCreateLoader) |
| 139 { |
| 140 auto factory = new StrictMock<MockLoaderFactory>; |
| 141 Checkpoint checkpoint; |
| 142 |
| 143 InSequence s; |
| 144 EXPECT_CALL(checkpoint, Call(1)); |
| 145 EXPECT_CALL(checkpoint, Call(2)); |
| 146 |
| 147 RefPtr<BlobDataHandle> blobDataHandle = createBlobDataHandle("Once upon a ti
me"); |
| 148 std::unique_ptr<WebDataConsumerHandle> handle |
| 149 = FetchBlobDataConsumerHandle::create(&document(), blobDataHandle, facto
ry); |
| 150 testing::runPendingTasks(); |
| 151 |
| 152 size_t size = 0; |
| 153 ASSERT_EQ(kShouldWait, handle->obtainReader(nullptr)->read(nullptr, 0, kNone
, &size)); |
| 154 checkpoint.Call(1); |
| 155 testing::runPendingTasks(); |
| 156 checkpoint.Call(2); |
| 157 } |
| 158 |
| 137 TEST_F(FetchBlobDataConsumerHandleTest, CancelLoaderWhenStopped) | 159 TEST_F(FetchBlobDataConsumerHandleTest, CancelLoaderWhenStopped) |
| 138 { | 160 { |
| 139 auto factory = new StrictMock<MockLoaderFactory>; | 161 auto factory = new StrictMock<MockLoaderFactory>; |
| 140 Checkpoint checkpoint; | 162 Checkpoint checkpoint; |
| 141 | 163 |
| 142 Persistent<MockThreadableLoader> loader = MockThreadableLoader::create(); | 164 Persistent<MockThreadableLoader> loader = MockThreadableLoader::create(); |
| 143 | 165 |
| 144 InSequence s; | 166 InSequence s; |
| 145 EXPECT_CALL(checkpoint, Call(1)); | 167 EXPECT_CALL(checkpoint, Call(1)); |
| 146 EXPECT_CALL(*factory, create(Ref(document()), _, _, _)).WillOnce(Return(load
er.get())); | 168 EXPECT_CALL(*factory, create(Ref(document()), _, _, _)).WillOnce(Return(load
er.get())); |
| 147 EXPECT_CALL(*loader, start(_)); | 169 EXPECT_CALL(*loader, start(_)); |
| 148 EXPECT_CALL(checkpoint, Call(2)); | 170 EXPECT_CALL(checkpoint, Call(2)); |
| 149 EXPECT_CALL(*loader, cancel()); | 171 EXPECT_CALL(*loader, cancel()); |
| 150 EXPECT_CALL(checkpoint, Call(3)); | 172 EXPECT_CALL(checkpoint, Call(3)); |
| 151 | 173 |
| 152 RefPtr<BlobDataHandle> blobDataHandle = createBlobDataHandle("Once upon a ti
me"); | 174 RefPtr<BlobDataHandle> blobDataHandle = createBlobDataHandle("Once upon a ti
me"); |
| 153 std::unique_ptr<WebDataConsumerHandle> handle | 175 std::unique_ptr<WebDataConsumerHandle> handle |
| 154 = FetchBlobDataConsumerHandle::create(&document(), blobDataHandle, facto
ry); | 176 = FetchBlobDataConsumerHandle::create(&document(), blobDataHandle, facto
ry); |
| 155 testing::runPendingTasks(); | 177 testing::runPendingTasks(); |
| 156 | 178 |
| 179 char buffer[1]; |
| 157 size_t size = 0; | 180 size_t size = 0; |
| 158 handle->obtainReader(nullptr)->read(nullptr, 0, kNone, &size); | 181 ASSERT_EQ(kShouldWait, handle->obtainReader(nullptr)->read(buffer, sizeof(bu
ffer), kNone, &size)); |
| 159 checkpoint.Call(1); | 182 checkpoint.Call(1); |
| 160 testing::runPendingTasks(); | 183 testing::runPendingTasks(); |
| 161 checkpoint.Call(2); | 184 checkpoint.Call(2); |
| 162 document().stopActiveDOMObjects(); | 185 document().stopActiveDOMObjects(); |
| 163 checkpoint.Call(3); | 186 checkpoint.Call(3); |
| 164 } | 187 } |
| 165 | 188 |
| 166 TEST_F(FetchBlobDataConsumerHandleTest, CancelLoaderWhenDestinationDetached) | 189 TEST_F(FetchBlobDataConsumerHandleTest, CancelLoaderWhenDestinationDetached) |
| 167 { | 190 { |
| 168 auto factory = new StrictMock<MockLoaderFactory>; | 191 auto factory = new StrictMock<MockLoaderFactory>; |
| 169 Checkpoint checkpoint; | 192 Checkpoint checkpoint; |
| 170 | 193 |
| 171 Persistent<MockThreadableLoader> loader = MockThreadableLoader::create(); | 194 Persistent<MockThreadableLoader> loader = MockThreadableLoader::create(); |
| 172 | 195 |
| 173 InSequence s; | 196 InSequence s; |
| 174 EXPECT_CALL(checkpoint, Call(1)); | 197 EXPECT_CALL(checkpoint, Call(1)); |
| 175 EXPECT_CALL(*factory, create(Ref(document()), _, _, _)).WillOnce(Return(load
er.get())); | 198 EXPECT_CALL(*factory, create(Ref(document()), _, _, _)).WillOnce(Return(load
er.get())); |
| 176 EXPECT_CALL(*loader, start(_)); | 199 EXPECT_CALL(*loader, start(_)); |
| 177 EXPECT_CALL(checkpoint, Call(2)); | 200 EXPECT_CALL(checkpoint, Call(2)); |
| 178 EXPECT_CALL(checkpoint, Call(3)); | 201 EXPECT_CALL(checkpoint, Call(3)); |
| 179 EXPECT_CALL(*loader, cancel()); | 202 EXPECT_CALL(*loader, cancel()); |
| 180 EXPECT_CALL(checkpoint, Call(4)); | 203 EXPECT_CALL(checkpoint, Call(4)); |
| 181 | 204 |
| 182 RefPtr<BlobDataHandle> blobDataHandle = createBlobDataHandle("Once upon a ti
me"); | 205 RefPtr<BlobDataHandle> blobDataHandle = createBlobDataHandle("Once upon a ti
me"); |
| 183 std::unique_ptr<WebDataConsumerHandle> handle | 206 std::unique_ptr<WebDataConsumerHandle> handle |
| 184 = FetchBlobDataConsumerHandle::create(&document(), blobDataHandle, facto
ry); | 207 = FetchBlobDataConsumerHandle::create(&document(), blobDataHandle, facto
ry); |
| 185 std::unique_ptr<WebDataConsumerHandle::Reader> reader = handle->obtainReader
(nullptr); | 208 std::unique_ptr<WebDataConsumerHandle::Reader> reader = handle->obtainReader
(nullptr); |
| 186 testing::runPendingTasks(); | 209 testing::runPendingTasks(); |
| 187 | 210 |
| 211 char buffer[1]; |
| 188 size_t size = 0; | 212 size_t size = 0; |
| 189 reader->read(nullptr, 0, kNone, &size); | 213 ASSERT_EQ(kShouldWait, reader->read(buffer, sizeof(buffer), kNone, &size)); |
| 190 checkpoint.Call(1); | 214 checkpoint.Call(1); |
| 191 testing::runPendingTasks(); | 215 testing::runPendingTasks(); |
| 192 checkpoint.Call(2); | 216 checkpoint.Call(2); |
| 193 handle = nullptr; | 217 handle = nullptr; |
| 194 reader = nullptr; | 218 reader = nullptr; |
| 195 checkpoint.Call(3); | 219 checkpoint.Call(3); |
| 196 ThreadHeap::collectAllGarbage(); | 220 ThreadHeap::collectAllGarbage(); |
| 197 checkpoint.Call(4); | 221 checkpoint.Call(4); |
| 198 } | 222 } |
| 199 | 223 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 216 std::unique_ptr<WebDataConsumerHandle> handle | 240 std::unique_ptr<WebDataConsumerHandle> handle |
| 217 = FetchBlobDataConsumerHandle::create(&document(), blobDataHandle, facto
ry); | 241 = FetchBlobDataConsumerHandle::create(&document(), blobDataHandle, facto
ry); |
| 218 | 242 |
| 219 std::unique_ptr<ReplayingHandle> src = ReplayingHandle::create(); | 243 std::unique_ptr<ReplayingHandle> src = ReplayingHandle::create(); |
| 220 src->add(Command(Command::Wait)); | 244 src->add(Command(Command::Wait)); |
| 221 src->add(Command(Command::Data, "hello, ")); | 245 src->add(Command(Command::Data, "hello, ")); |
| 222 src->add(Command(Command::Data, "world")); | 246 src->add(Command(Command::Data, "world")); |
| 223 src->add(Command(Command::Wait)); | 247 src->add(Command(Command::Wait)); |
| 224 src->add(Command(Command::Done)); | 248 src->add(Command(Command::Done)); |
| 225 | 249 |
| 250 char buffer[1]; |
| 226 size_t size = 0; | 251 size_t size = 0; |
| 227 handle->obtainReader(nullptr)->read(nullptr, 0, kNone, &size); | 252 ASSERT_EQ(kShouldWait, handle->obtainReader(nullptr)->read(buffer, sizeof(bu
ffer), kNone, &size)); |
| 228 checkpoint.Call(1); | 253 checkpoint.Call(1); |
| 229 testing::runPendingTasks(); | 254 testing::runPendingTasks(); |
| 230 checkpoint.Call(2); | 255 checkpoint.Call(2); |
| 231 client->didReceiveResponse(0, ResourceResponse(), std::move(src)); | 256 client->didReceiveResponse(0, ResourceResponse(), std::move(src)); |
| 232 HandleReaderRunner<HandleReader> runner(std::move(handle)); | 257 HandleReaderRunner<HandleReader> runner(std::move(handle)); |
| 233 std::unique_ptr<HandleReadResult> r = runner.wait(); | 258 std::unique_ptr<HandleReadResult> r = runner.wait(); |
| 234 EXPECT_EQ(kDone, r->result()); | 259 EXPECT_EQ(kDone, r->result()); |
| 235 EXPECT_EQ("hello, world", toString(r->data())); | 260 EXPECT_EQ("hello, world", toString(r->data())); |
| 236 } | 261 } |
| 237 | 262 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 254 std::unique_ptr<WebDataConsumerHandle> handle | 279 std::unique_ptr<WebDataConsumerHandle> handle |
| 255 = FetchBlobDataConsumerHandle::create(&document(), blobDataHandle, facto
ry); | 280 = FetchBlobDataConsumerHandle::create(&document(), blobDataHandle, facto
ry); |
| 256 | 281 |
| 257 std::unique_ptr<ReplayingHandle> src = ReplayingHandle::create(); | 282 std::unique_ptr<ReplayingHandle> src = ReplayingHandle::create(); |
| 258 src->add(Command(Command::Wait)); | 283 src->add(Command(Command::Wait)); |
| 259 src->add(Command(Command::Data, "hello, ")); | 284 src->add(Command(Command::Data, "hello, ")); |
| 260 src->add(Command(Command::Data, "world")); | 285 src->add(Command(Command::Data, "world")); |
| 261 src->add(Command(Command::Wait)); | 286 src->add(Command(Command::Wait)); |
| 262 src->add(Command(Command::Done)); | 287 src->add(Command(Command::Done)); |
| 263 | 288 |
| 289 char buffer[1]; |
| 264 size_t size = 0; | 290 size_t size = 0; |
| 265 handle->obtainReader(nullptr)->read(nullptr, 0, kNone, &size); | 291 ASSERT_EQ(kShouldWait, handle->obtainReader(nullptr)->read(buffer, sizeof(bu
ffer), kNone, &size)); |
| 266 checkpoint.Call(1); | 292 checkpoint.Call(1); |
| 267 testing::runPendingTasks(); | 293 testing::runPendingTasks(); |
| 268 checkpoint.Call(2); | 294 checkpoint.Call(2); |
| 269 client->didReceiveResponse(0, ResourceResponse(), std::move(src)); | 295 client->didReceiveResponse(0, ResourceResponse(), std::move(src)); |
| 270 HandleReaderRunner<HandleTwoPhaseReader> runner(std::move(handle)); | 296 HandleReaderRunner<HandleTwoPhaseReader> runner(std::move(handle)); |
| 271 std::unique_ptr<HandleReadResult> r = runner.wait(); | 297 std::unique_ptr<HandleReadResult> r = runner.wait(); |
| 272 EXPECT_EQ(kDone, r->result()); | 298 EXPECT_EQ(kDone, r->result()); |
| 273 EXPECT_EQ("hello, world", toString(r->data())); | 299 EXPECT_EQ("hello, world", toString(r->data())); |
| 274 } | 300 } |
| 275 | 301 |
| 276 TEST_F(FetchBlobDataConsumerHandleTest, LoadErrorTest) | 302 TEST_F(FetchBlobDataConsumerHandleTest, LoadErrorTest) |
| 277 { | 303 { |
| 278 auto factory = new StrictMock<MockLoaderFactory>; | 304 auto factory = new StrictMock<MockLoaderFactory>; |
| 279 Checkpoint checkpoint; | 305 Checkpoint checkpoint; |
| 280 | 306 |
| 281 Persistent<MockThreadableLoader> loader = MockThreadableLoader::create(); | 307 Persistent<MockThreadableLoader> loader = MockThreadableLoader::create(); |
| 282 ThreadableLoaderClient* client = nullptr; | 308 ThreadableLoaderClient* client = nullptr; |
| 283 | 309 |
| 284 InSequence s; | 310 InSequence s; |
| 285 EXPECT_CALL(checkpoint, Call(1)); | 311 EXPECT_CALL(checkpoint, Call(1)); |
| 286 EXPECT_CALL(*factory, create(Ref(document()), _, _, _)).WillOnce(DoAll(SaveA
rg<1>(&client), Return(loader.get()))); | 312 EXPECT_CALL(*factory, create(Ref(document()), _, _, _)).WillOnce(DoAll(SaveA
rg<1>(&client), Return(loader.get()))); |
| 287 EXPECT_CALL(*loader, start(_)); | 313 EXPECT_CALL(*loader, start(_)); |
| 288 EXPECT_CALL(checkpoint, Call(2)); | 314 EXPECT_CALL(checkpoint, Call(2)); |
| 289 | 315 |
| 290 RefPtr<BlobDataHandle> blobDataHandle = createBlobDataHandle("Once upon a ti
me"); | 316 RefPtr<BlobDataHandle> blobDataHandle = createBlobDataHandle("Once upon a ti
me"); |
| 291 std::unique_ptr<WebDataConsumerHandle> handle | 317 std::unique_ptr<WebDataConsumerHandle> handle |
| 292 = FetchBlobDataConsumerHandle::create(&document(), blobDataHandle, facto
ry); | 318 = FetchBlobDataConsumerHandle::create(&document(), blobDataHandle, facto
ry); |
| 293 | 319 |
| 320 char buffer[1]; |
| 294 size_t size = 0; | 321 size_t size = 0; |
| 295 handle->obtainReader(nullptr)->read(nullptr, 0, kNone, &size); | 322 ASSERT_EQ(kShouldWait, handle->obtainReader(nullptr)->read(buffer, sizeof(bu
ffer), kNone, &size)); |
| 296 checkpoint.Call(1); | 323 checkpoint.Call(1); |
| 297 testing::runPendingTasks(); | 324 testing::runPendingTasks(); |
| 298 checkpoint.Call(2); | 325 checkpoint.Call(2); |
| 299 client->didFail(ResourceError()); | 326 client->didFail(ResourceError()); |
| 300 HandleReaderRunner<HandleReader> runner(std::move(handle)); | 327 HandleReaderRunner<HandleReader> runner(std::move(handle)); |
| 301 std::unique_ptr<HandleReadResult> r = runner.wait(); | 328 std::unique_ptr<HandleReadResult> r = runner.wait(); |
| 302 EXPECT_EQ(kUnexpectedError, r->result()); | 329 EXPECT_EQ(kUnexpectedError, r->result()); |
| 303 } | 330 } |
| 304 | 331 |
| 305 TEST_F(FetchBlobDataConsumerHandleTest, BodyLoadErrorTest) | 332 TEST_F(FetchBlobDataConsumerHandleTest, BodyLoadErrorTest) |
| (...skipping 13 matching lines...) Expand all Loading... |
| 319 | 346 |
| 320 RefPtr<BlobDataHandle> blobDataHandle = createBlobDataHandle("Once upon a ti
me"); | 347 RefPtr<BlobDataHandle> blobDataHandle = createBlobDataHandle("Once upon a ti
me"); |
| 321 std::unique_ptr<WebDataConsumerHandle> handle | 348 std::unique_ptr<WebDataConsumerHandle> handle |
| 322 = FetchBlobDataConsumerHandle::create(&document(), blobDataHandle, facto
ry); | 349 = FetchBlobDataConsumerHandle::create(&document(), blobDataHandle, facto
ry); |
| 323 | 350 |
| 324 std::unique_ptr<ReplayingHandle> src = ReplayingHandle::create(); | 351 std::unique_ptr<ReplayingHandle> src = ReplayingHandle::create(); |
| 325 src->add(Command(Command::Wait)); | 352 src->add(Command(Command::Wait)); |
| 326 src->add(Command(Command::Data, "hello, ")); | 353 src->add(Command(Command::Data, "hello, ")); |
| 327 src->add(Command(Command::Error)); | 354 src->add(Command(Command::Error)); |
| 328 | 355 |
| 356 char buffer[1]; |
| 329 size_t size = 0; | 357 size_t size = 0; |
| 330 handle->obtainReader(nullptr)->read(nullptr, 0, kNone, &size); | 358 ASSERT_EQ(kShouldWait, handle->obtainReader(nullptr)->read(buffer, sizeof(bu
ffer), kNone, &size)); |
| 331 checkpoint.Call(1); | 359 checkpoint.Call(1); |
| 332 testing::runPendingTasks(); | 360 testing::runPendingTasks(); |
| 333 checkpoint.Call(2); | 361 checkpoint.Call(2); |
| 334 client->didReceiveResponse(0, ResourceResponse(), std::move(src)); | 362 client->didReceiveResponse(0, ResourceResponse(), std::move(src)); |
| 335 HandleReaderRunner<HandleReader> runner(std::move(handle)); | 363 HandleReaderRunner<HandleReader> runner(std::move(handle)); |
| 336 std::unique_ptr<HandleReadResult> r = runner.wait(); | 364 std::unique_ptr<HandleReadResult> r = runner.wait(); |
| 337 EXPECT_EQ(kUnexpectedError, r->result()); | 365 EXPECT_EQ(kUnexpectedError, r->result()); |
| 338 } | 366 } |
| 339 | 367 |
| 340 TEST_F(FetchBlobDataConsumerHandleTest, DrainAsBlobDataHandle) | 368 TEST_F(FetchBlobDataConsumerHandleTest, DrainAsBlobDataHandle) |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 std::unique_ptr<FetchDataConsumerHandle::Reader> reader = handle->obtainFetc
hDataReader(nullptr); | 440 std::unique_ptr<FetchDataConsumerHandle::Reader> reader = handle->obtainFetc
hDataReader(nullptr); |
| 413 | 441 |
| 414 const void* buffer; | 442 const void* buffer; |
| 415 size_t available; | 443 size_t available; |
| 416 EXPECT_EQ(kShouldWait, reader->beginRead(&buffer, kNone, &available)); | 444 EXPECT_EQ(kShouldWait, reader->beginRead(&buffer, kNone, &available)); |
| 417 EXPECT_FALSE(reader->drainAsBlobDataHandle()); | 445 EXPECT_FALSE(reader->drainAsBlobDataHandle()); |
| 418 } | 446 } |
| 419 | 447 |
| 420 } // namespace | 448 } // namespace |
| 421 } // namespace blink | 449 } // namespace blink |
| OLD | NEW |