chromium/third_party/blink/renderer/core/script/dynamic_module_resolver_test.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/core/script/dynamic_module_resolver.h"

#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom-blink.h"
#include "third_party/blink/renderer/bindings/core/v8/referrer_script_info.h"
#include "third_party/blink/renderer/bindings/core/v8/script_function.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/bindings/core/v8/script_value.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_testing.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/loader/modulescript/module_script_creation_params.h"
#include "third_party/blink/renderer/core/loader/modulescript/module_script_fetch_request.h"
#include "third_party/blink/renderer/core/script/js_module_script.h"
#include "third_party/blink/renderer/core/testing/dummy_modulator.h"
#include "third_party/blink/renderer/core/testing/module_test_base.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"
#include "v8/include/v8.h"

namespace blink {

namespace {

constexpr const char* kTestReferrerURL =;
constexpr const char* kTestDependencyURL =;
constexpr const char* kTestDependencyURLJSON =;

const KURL TestReferrerURL() {}
const KURL TestDependencyURL() {}
const KURL TestDependencyURLJSON() {}
ReferrerScriptInfo TestReferrerScriptInfo() {}

class DynamicModuleResolverTestModulator final : public DummyModulator {};

void DynamicModuleResolverTestModulator::Trace(Visitor* visitor) const {}

// CaptureExportedStringFunction implements a javascript function
// with a single argument of type module namespace.
// CaptureExportedStringFunction captures the exported string value
// from the module namespace as a WTF::String, exposed via CapturedValue().
class CaptureExportedStringFunction final : public ScriptFunction::Callable {};

// CaptureErrorFunction implements a javascript function which captures
// name and error of the exception passed as its argument.
class CaptureErrorFunction final : public ScriptFunction::Callable {};

class DynamicModuleResolverTestNotReached final
    : public ScriptFunction::Callable {};

class DynamicModuleResolverTest : public testing::Test, public ModuleTestBase {};

}  // namespace

TEST_F(DynamicModuleResolverTest, ResolveSuccess) {}

TEST_F(DynamicModuleResolverTest, ResolveJSONModuleSuccess) {}

TEST_F(DynamicModuleResolverTest, ResolveSpecifierFailure) {}

TEST_F(DynamicModuleResolverTest, ResolveModuleTypeFailure) {}

TEST_F(DynamicModuleResolverTest, FetchFailure) {}

TEST_F(DynamicModuleResolverTest, ExceptionThrown) {}

TEST_F(DynamicModuleResolverTest, ResolveWithNullReferrerScriptSuccess) {}

TEST_F(DynamicModuleResolverTest, ResolveWithReferrerScriptInfoBaseURL) {}

}  // namespace blink