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..2d3f18a78759f5917fe51ed0c3e54bcad8925dd2 |
--- /dev/null |
+++ b/third_party/WebKit/Source/core/testing/DummyModulator.h |
@@ -0,0 +1,55 @@ |
+// 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 "core/CoreExport.h" |
+#include "core/dom/Modulator.h" |
+#include "platform/heap/Handle.h" |
+ |
+namespace blink { |
+ |
+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; |
+ }; |
+ |
+ void fetchNewSingleModule(const ModuleScriptFetchRequest&, |
+ ModuleGraphLevel, |
+ ModuleScriptLoaderClient*) override { |
+ NOTREACHED(); |
+ } |
+}; |
+ |
+} // namespace blink |
+ |
+#endif |
yhirano
2017/02/22 09:10:42
// DummyModulator_h
|