OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "config.h" | 5 #include "config.h" |
6 #include "modules/serviceworkers/Cache.h" | 6 #include "modules/serviceworkers/Cache.h" |
7 | 7 |
8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
9 #include "bindings/core/v8/ScriptFunction.h" | 9 #include "bindings/core/v8/ScriptFunction.h" |
10 #include "bindings/core/v8/ScriptPromise.h" | 10 #include "bindings/core/v8/ScriptPromise.h" |
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 WebServiceWorkerCache::BatchOperation putOperation; | 391 WebServiceWorkerCache::BatchOperation putOperation; |
392 putOperation.operationType = WebServiceWorkerCache::OperationTypePut; | 392 putOperation.operationType = WebServiceWorkerCache::OperationTypePut; |
393 request->populateWebServiceWorkerRequest(putOperation.request); | 393 request->populateWebServiceWorkerRequest(putOperation.request); |
394 response->populateWebServiceWorkerResponse(putOperation.response); | 394 response->populateWebServiceWorkerResponse(putOperation.response); |
395 expectedPutOperations[0] = putOperation; | 395 expectedPutOperations[0] = putOperation; |
396 } | 396 } |
397 testCache->setExpectedBatchOperations(&expectedPutOperations); | 397 testCache->setExpectedBatchOperations(&expectedPutOperations); |
398 | 398 |
399 request = newRequestFromUrl(url); | 399 request = newRequestFromUrl(url); |
400 ASSERT(request); | 400 ASSERT(request); |
401 ScriptPromise putResult = cache->put(scriptState(), request, response); | 401 ScriptPromise putResult = cache->put(scriptState(), request, response->clone
(), exceptionState()); |
402 EXPECT_EQ("dispatchBatch", testCache->getAndClearLastErrorWebCacheMethodCall
ed()); | 402 EXPECT_EQ("dispatchBatch", testCache->getAndClearLastErrorWebCacheMethodCall
ed()); |
403 EXPECT_EQ(kNotImplementedString, getRejectString(putResult)); | 403 EXPECT_EQ(kNotImplementedString, getRejectString(putResult)); |
404 | 404 |
405 ScriptPromise stringPutResult = cache->put(scriptState(), url, response, exc
eptionState()); | 405 ScriptPromise stringPutResult = cache->put(scriptState(), url, response, exc
eptionState()); |
406 EXPECT_EQ("dispatchBatch", testCache->getAndClearLastErrorWebCacheMethodCall
ed()); | 406 EXPECT_EQ("dispatchBatch", testCache->getAndClearLastErrorWebCacheMethodCall
ed()); |
407 EXPECT_EQ(kNotImplementedString, getRejectString(stringPutResult)); | 407 EXPECT_EQ(kNotImplementedString, getRejectString(stringPutResult)); |
408 | 408 |
409 // FIXME: test add & addAll. | 409 // FIXME: test add & addAll. |
410 } | 410 } |
411 | 411 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 } | 539 } |
540 | 540 |
541 result = cache->deleteFunction(scriptState(), "http://some.url/", options, e
xceptionState()); | 541 result = cache->deleteFunction(scriptState(), "http://some.url/", options, e
xceptionState()); |
542 scriptValue = getResolveValue(result); | 542 scriptValue = getResolveValue(result); |
543 EXPECT_TRUE(scriptValue.v8Value()->IsBoolean()); | 543 EXPECT_TRUE(scriptValue.v8Value()->IsBoolean()); |
544 EXPECT_EQ(true, scriptValue.v8Value()->BooleanValue()); | 544 EXPECT_EQ(true, scriptValue.v8Value()->BooleanValue()); |
545 } | 545 } |
546 | 546 |
547 } // namespace | 547 } // namespace |
548 } // namespace blink | 548 } // namespace blink |
OLD | NEW |