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

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

Issue 2797453004: [ES6 modules] Introduce ScriptModuleTest and test ::compile() (Closed)
Patch Set: Created 3 years, 9 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/bindings.gni ('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
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
« no previous file with comments | « third_party/WebKit/Source/bindings/bindings.gni ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698