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

Unified Diff: third_party/WebKit/Source/core/testing/DummyModulator.h

Issue 2555653002: [WIP Prototype] ES6 https://html.spec.whatwg.org/#fetch-a-single-module-script implementation (Closed)
Patch Set: snapshot Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/testing/DummyModulator.h
diff --git a/third_party/WebKit/Source/core/testing/DummyModulator.h b/third_party/WebKit/Source/core/testing/DummyModulator.h
new file mode 100644
index 0000000000000000000000000000000000000000..7f2fc41422045c51b9d86ffb7d801f992518d756
--- /dev/null
+++ b/third_party/WebKit/Source/core/testing/DummyModulator.h
@@ -0,0 +1,109 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef DummyModulator_h
+#define DummyModulator_h
+
+#include "bindings/core/v8/ScriptModule.h"
+#include "bindings/core/v8/ScriptValue.h"
+#include "core/CoreExport.h"
+#include "core/dom/Modulator.h"
+#include "platform/heap/Handle.h"
+#include "wtf/Vector.h"
+
+namespace blink {
+
+class ModuleScript;
+class ModuleScriptLoaderClient;
+class ScriptModuleResolver;
+class WebTaskRunner;
+class ModuleScriptFetchRequest;
+
+// DummyModulator provides empty Modulator interface implementation w/
+// NOTREACHED().
+//
+// DummyModulator is useful for unit-testing.
+// Not all module implementation components require full-blown Modulator
+// implementation. Unit tests can implement a subset of Modulator interface
+// which is exercised from unit-under-test.
+class CORE_EXPORT DummyModulator
+ : public GarbageCollectedFinalized<DummyModulator>,
+ public Modulator {
+ USING_GARBAGE_COLLECTED_MIXIN(DummyModulator);
+
+ public:
+ DummyModulator() = default;
+ virtual ~DummyModulator() {}
+ DEFINE_INLINE_TRACE() {}
+
+ ScriptModuleResolver* scriptModuleResolver() override {
+ NOTREACHED();
+ return nullptr;
+ }
+
+ WebTaskRunner* taskRunner() override {
+ NOTREACHED();
+ return nullptr;
+ };
+
+ ExecutionContext* executionContext() override {
+ NOTREACHED();
+ return nullptr;
+ }
+
+ ReferrerPolicy referrerPolicy() override {
+ NOTREACHED();
+ return ReferrerPolicyDefault;
+ }
+
+ void fetchTree(const ModuleScriptFetchRequest&, ModuleTreeClient*) override {
+ NOTREACHED();
+ }
+
+ void fetchTreeInternal(const ModuleScriptFetchRequest&,
+ const AncestorList&,
+ ModuleGraphLevel,
+ ModuleTreeClient*) override {
+ NOTREACHED();
+ }
+
+ void fetchSingle(const ModuleScriptFetchRequest&,
+ ModuleGraphLevel,
+ SingleModuleClient*) override {
+ NOTREACHED();
+ }
+
+ void fetchNewSingleModule(const ModuleScriptFetchRequest&,
+ ModuleGraphLevel,
+ ModuleScriptLoaderClient*) override {
+ NOTREACHED();
+ }
+
+ ModuleScript* retrieveFetchedModuleScript(const KURL&) override {
+ NOTREACHED();
+ return nullptr;
+ }
+
+ ScriptModule compileModule(const String& script,
+ const String& urlStr) override {
+ NOTREACHED();
+ return ScriptModule();
+ }
+
+ ScriptValue instantiateModule(ScriptModule) override {
+ NOTREACHED();
+ return ScriptValue();
+ }
+
+ Vector<String> moduleRequestsFromScriptModule(ScriptModule) override {
+ NOTREACHED();
+ return Vector<String>();
+ }
+
+ void executeModule(ScriptModule) override { NOTREACHED(); }
+};
+
+} // namespace blink
+
+#endif
« no previous file with comments | « third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinkerRegistry.cpp ('k') | threejs-bootstrap.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698