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 "modules/cachestorage/Cache.h" | 5 #include "modules/cachestorage/Cache.h" |
6 | 6 |
7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" |
8 #include "bindings/core/v8/ScriptFunction.h" | 8 #include "bindings/core/v8/ScriptFunction.h" |
9 #include "bindings/core/v8/ScriptPromise.h" | 9 #include "bindings/core/v8/ScriptPromise.h" |
10 #include "bindings/core/v8/ScriptPromiseResolver.h" | 10 #include "bindings/core/v8/ScriptPromiseResolver.h" |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 NotImplementedErrorCache() | 229 NotImplementedErrorCache() |
230 : ErrorWebCacheForTests(WebServiceWorkerCacheErrorNotImplemented) {} | 230 : ErrorWebCacheForTests(WebServiceWorkerCacheErrorNotImplemented) {} |
231 }; | 231 }; |
232 | 232 |
233 class CacheStorageTest : public ::testing::Test { | 233 class CacheStorageTest : public ::testing::Test { |
234 public: | 234 public: |
235 CacheStorageTest() : m_page(DummyPageHolder::create(IntSize(1, 1))) {} | 235 CacheStorageTest() : m_page(DummyPageHolder::create(IntSize(1, 1))) {} |
236 | 236 |
237 Cache* createCache(ScopedFetcherForTests* fetcher, | 237 Cache* createCache(ScopedFetcherForTests* fetcher, |
238 WebServiceWorkerCache* webCache) { | 238 WebServiceWorkerCache* webCache) { |
239 return Cache::create(fetcher, wrapUnique(webCache)); | 239 return Cache::create(fetcher, WTF::wrapUnique(webCache)); |
240 } | 240 } |
241 | 241 |
242 ScriptState* getScriptState() { | 242 ScriptState* getScriptState() { |
243 return ScriptState::forMainWorld(m_page->document().frame()); | 243 return ScriptState::forMainWorld(m_page->document().frame()); |
244 } | 244 } |
245 ExecutionContext* getExecutionContext() { | 245 ExecutionContext* getExecutionContext() { |
246 return getScriptState()->getExecutionContext(); | 246 return getScriptState()->getExecutionContext(); |
247 } | 247 } |
248 v8::Isolate* isolate() { return getScriptState()->isolate(); } | 248 v8::Isolate* isolate() { return getScriptState()->isolate(); } |
249 v8::Local<v8::Context> context() { return getScriptState()->context(); } | 249 v8::Local<v8::Context> context() { return getScriptState()->context(); } |
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 | 723 |
724 EXPECT_EQ(kNotImplementedString, getRejectString(addResult)); | 724 EXPECT_EQ(kNotImplementedString, getRejectString(addResult)); |
725 EXPECT_EQ(1, fetcher->fetchCount()); | 725 EXPECT_EQ(1, fetcher->fetchCount()); |
726 EXPECT_EQ("dispatchBatch", | 726 EXPECT_EQ("dispatchBatch", |
727 testCache->getAndClearLastErrorWebCacheMethodCalled()); | 727 testCache->getAndClearLastErrorWebCacheMethodCalled()); |
728 } | 728 } |
729 | 729 |
730 } // namespace | 730 } // namespace |
731 | 731 |
732 } // namespace blink | 732 } // namespace blink |
OLD | NEW |