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 |
new file mode 100644 |
index 0000000000000000000000000000000000000000..61fb66a8a5fdab96c5fe0a5e4e11bc4b3e747717 |
--- /dev/null |
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptModuleTest.cpp |
@@ -0,0 +1,31 @@ |
+// 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. |
+ |
+#include "bindings/core/v8/ScriptModule.h" |
+ |
+#include "bindings/core/v8/V8BindingForTesting.h" |
+#include "testing/gtest/include/gtest/gtest.h" |
+#include "v8/include/v8.h" |
+ |
+namespace blink { |
+ |
+namespace { |
+ |
+TEST(ScriptModuleTest, compileSuccess) { |
+ V8TestingScope scope; |
+ ScriptModule module = |
+ ScriptModule::compile(scope.isolate(), "export const a = 42;", "foo.js"); |
+ ASSERT_FALSE(module.isNull()); |
+} |
+ |
+TEST(ScriptModuleTest, compileFail) { |
+ V8TestingScope scope; |
+ ScriptModule module = |
+ ScriptModule::compile(scope.isolate(), "123 = 456", "foo.js"); |
+ ASSERT_TRUE(module.isNull()); |
+} |
+ |
+} // namespace |
+ |
+} // namespace blink |