Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(553)

Side by Side Diff: Source/modules/cachestorage/CacheTest.cpp

Issue 1240763002: CallbackPromiseAdapter types should be more compatible with WebCallbacks (3/3). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/modules/cachestorage/CacheStorageError.cpp ('k') | Source/modules/cachestorage/InspectorCacheStorageAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698