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

Side by Side 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, 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/bindings/bindings.gni ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "bindings/core/v8/ScriptModule.h"
6
7 #include "bindings/core/v8/V8BindingForTesting.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "v8/include/v8.h"
10
11 namespace blink {
12
13 namespace {
14
15 TEST(ScriptModuleTest, compileSuccess) {
16 V8TestingScope scope;
17 ScriptModule module =
18 ScriptModule::compile(scope.isolate(), "export const a = 42;", "foo.js");
19 ASSERT_FALSE(module.isNull());
20 }
21
22 TEST(ScriptModuleTest, compileFail) {
23 V8TestingScope scope;
24 ScriptModule module =
25 ScriptModule::compile(scope.isolate(), "123 = 456", "foo.js");
26 ASSERT_TRUE(module.isNull());
27 }
28
29 } // namespace
30
31 } // namespace blink
OLDNEW
« 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