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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptModuleTest.cpp

Issue 2788573002: [ES6 modules] Introduce ScriptModule::moduleRequests to access record.[[RequestedModules]] (Closed)
Patch Set: rebased Created 3 years, 8 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
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/ScriptModuleTest.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptModuleTest.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptModuleTest.cpp
index 609d3260121f8fc7513ff56638d3ffebb038312b..f9ed1ab3fd8f429e8604faae290e724348c12b67 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptModuleTest.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptModuleTest.cpp
@@ -8,6 +8,7 @@
#include "bindings/core/v8/V8PerContextData.h"
#include "core/dom/ScriptModuleResolver.h"
#include "core/testing/DummyModulator.h"
+#include "testing/gmock/include/gmock/gmock-matchers.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "v8/include/v8.h"
@@ -85,6 +86,17 @@ TEST(ScriptModuleTest, compileFail) {
ASSERT_TRUE(module.isNull());
}
+TEST(ScriptModuleTest, moduleRequests) {
+ V8TestingScope scope;
+ ScriptModule module = ScriptModule::compile(
+ scope.isolate(), "import 'a'; import 'b'; export const c = 'c';",
+ "foo.js");
+ ASSERT_FALSE(module.isNull());
+
+ auto requests = module.moduleRequests(scope.getScriptState());
+ EXPECT_THAT(requests, ::testing::ContainerEq<Vector<String>>({"a", "b"}));
+}
+
TEST(ScriptModuleTest, instantiateNoDeps) {
V8TestingScope scope;
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698