OLD | NEW |
(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 |
OLD | NEW |