| 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/cachestorage/Cache.h" | 6 #include "modules/cachestorage/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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 OwnPtr<CacheWithRequestsCallbacks> ownedCallbacks(adoptPtr(callbacks)); | 136 OwnPtr<CacheWithRequestsCallbacks> ownedCallbacks(adoptPtr(callbacks)); |
| 137 return callbacks->onError(new WebServiceWorkerCacheError(m_error)); | 137 return callbacks->onError(new WebServiceWorkerCacheError(m_error)); |
| 138 } | 138 } |
| 139 | 139 |
| 140 void dispatchBatch(CacheBatchCallbacks* callbacks, const WebVector<BatchOper
ation>& batchOperations) override | 140 void dispatchBatch(CacheBatchCallbacks* callbacks, const WebVector<BatchOper
ation>& batchOperations) override |
| 141 { | 141 { |
| 142 m_lastErrorWebCacheMethodCalled = "dispatchBatch"; | 142 m_lastErrorWebCacheMethodCalled = "dispatchBatch"; |
| 143 checkBatchOperationsIfProvided(batchOperations); | 143 checkBatchOperationsIfProvided(batchOperations); |
| 144 | 144 |
| 145 OwnPtr<CacheBatchCallbacks> ownedCallbacks(adoptPtr(callbacks)); | 145 OwnPtr<CacheBatchCallbacks> ownedCallbacks(adoptPtr(callbacks)); |
| 146 return callbacks->onError(new WebServiceWorkerCacheError(m_error)); | 146 return callbacks->onError(m_error); |
| 147 } | 147 } |
| 148 | 148 |
| 149 protected: | 149 protected: |
| 150 void checkUrlIfProvided(const KURL& url) | 150 void checkUrlIfProvided(const KURL& url) |
| 151 { | 151 { |
| 152 if (!m_expectedUrl) | 152 if (!m_expectedUrl) |
| 153 return; | 153 return; |
| 154 EXPECT_EQ(*m_expectedUrl, url); | 154 EXPECT_EQ(*m_expectedUrl, url); |
| 155 } | 155 } |
| 156 | 156 |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 | 643 |
| 644 ScriptPromise addResult = cache->add(scriptState(), requestToRequestInfo(req
uest), exceptionState()); | 644 ScriptPromise addResult = cache->add(scriptState(), requestToRequestInfo(req
uest), exceptionState()); |
| 645 | 645 |
| 646 EXPECT_EQ(kNotImplementedString, getRejectString(addResult)); | 646 EXPECT_EQ(kNotImplementedString, getRejectString(addResult)); |
| 647 EXPECT_EQ(1, fetcher()->fetchCount()); | 647 EXPECT_EQ(1, fetcher()->fetchCount()); |
| 648 EXPECT_EQ("dispatchBatch", testCache->getAndClearLastErrorWebCacheMethodCall
ed()); | 648 EXPECT_EQ("dispatchBatch", testCache->getAndClearLastErrorWebCacheMethodCall
ed()); |
| 649 } | 649 } |
| 650 | 650 |
| 651 } // namespace | 651 } // namespace |
| 652 } // namespace blink | 652 } // namespace blink |
| OLD | NEW |