OLD | NEW |
1 | 1 |
2 // Copyright 2014 The Chromium Authors. All rights reserved. | 2 // Copyright 2014 The Chromium Authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 | 5 |
6 #include "modules/serviceworkers/ServiceWorkerContainer.h" | 6 #include "modules/serviceworkers/ServiceWorkerContainer.h" |
7 | 7 |
| 8 #include <v8.h> |
| 9 #include <memory> |
| 10 #include <utility> |
8 #include "bindings/core/v8/Dictionary.h" | 11 #include "bindings/core/v8/Dictionary.h" |
9 #include "bindings/core/v8/ScriptFunction.h" | 12 #include "bindings/core/v8/ScriptFunction.h" |
10 #include "bindings/core/v8/ScriptPromise.h" | 13 #include "bindings/core/v8/ScriptPromise.h" |
11 #include "bindings/core/v8/ScriptState.h" | 14 #include "bindings/core/v8/ScriptState.h" |
12 #include "bindings/core/v8/V8DOMException.h" | 15 #include "bindings/core/v8/V8DOMException.h" |
13 #include "bindings/core/v8/V8GCController.h" | 16 #include "bindings/core/v8/V8GCController.h" |
14 #include "core/dom/DOMException.h" | 17 #include "core/dom/DOMException.h" |
15 #include "core/dom/Document.h" | 18 #include "core/dom/Document.h" |
16 #include "core/dom/ExecutionContext.h" | 19 #include "core/dom/ExecutionContext.h" |
17 #include "core/page/FocusController.h" | 20 #include "core/page/FocusController.h" |
18 #include "core/testing/DummyPageHolder.h" | 21 #include "core/testing/DummyPageHolder.h" |
19 #include "modules/serviceworkers/NavigatorServiceWorker.h" | 22 #include "modules/serviceworkers/NavigatorServiceWorker.h" |
20 #include "modules/serviceworkers/ServiceWorkerContainerClient.h" | 23 #include "modules/serviceworkers/ServiceWorkerContainerClient.h" |
21 #include "platform/weborigin/KURL.h" | 24 #include "platform/weborigin/KURL.h" |
22 #include "platform/weborigin/SecurityOrigin.h" | 25 #include "platform/weborigin/SecurityOrigin.h" |
23 #include "public/platform/WebURL.h" | 26 #include "public/platform/WebURL.h" |
24 #include "public/platform/modules/serviceworker/WebServiceWorkerClientsInfo.h" | 27 #include "public/platform/modules/serviceworker/WebServiceWorkerClientsInfo.h" |
25 #include "public/platform/modules/serviceworker/WebServiceWorkerProvider.h" | 28 #include "public/platform/modules/serviceworker/WebServiceWorkerProvider.h" |
26 #include "testing/gtest/include/gtest/gtest.h" | 29 #include "testing/gtest/include/gtest/gtest.h" |
27 #include "wtf/PtrUtil.h" | 30 #include "wtf/PtrUtil.h" |
28 #include "wtf/text/WTFString.h" | 31 #include "wtf/text/WTFString.h" |
29 #include <memory> | |
30 #include <utility> | |
31 #include <v8.h> | |
32 | 32 |
33 namespace blink { | 33 namespace blink { |
34 namespace { | 34 namespace { |
35 | 35 |
36 // Promise-related test support. | 36 // Promise-related test support. |
37 | 37 |
38 struct StubScriptFunction { | 38 struct StubScriptFunction { |
39 public: | 39 public: |
40 StubScriptFunction() : m_callCount(0) {} | 40 StubScriptFunction() : m_callCount(0) {} |
41 | 41 |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 ScriptState::Scope scriptScope(getScriptState()); | 369 ScriptState::Scope scriptScope(getScriptState()); |
370 container->getRegistration(getScriptState(), ""); | 370 container->getRegistration(getScriptState(), ""); |
371 EXPECT_EQ(1ul, stubProvider.getRegistrationCallCount()); | 371 EXPECT_EQ(1ul, stubProvider.getRegistrationCallCount()); |
372 EXPECT_EQ(WebURL(KURL(KURL(), "http://localhost/x/index.html")), | 372 EXPECT_EQ(WebURL(KURL(KURL(), "http://localhost/x/index.html")), |
373 stubProvider.getRegistrationURL()); | 373 stubProvider.getRegistrationURL()); |
374 } | 374 } |
375 } | 375 } |
376 | 376 |
377 } // namespace | 377 } // namespace |
378 } // namespace blink | 378 } // namespace blink |
OLD | NEW |