| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include <stdio.h> | 5 #include <stdio.h> |
| 6 | 6 |
| 7 #include "vm/unit_test.h" | 7 #include "vm/unit_test.h" |
| 8 | 8 |
| 9 #include "bin/builtin.h" | 9 #include "bin/builtin.h" |
| 10 #include "bin/dartutils.h" | 10 #include "bin/dartutils.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 } | 98 } |
| 99 return result; | 99 return result; |
| 100 } | 100 } |
| 101 | 101 |
| 102 | 102 |
| 103 Dart_Handle TestCase::LoadTestScript(const char* script, | 103 Dart_Handle TestCase::LoadTestScript(const char* script, |
| 104 Dart_NativeEntryResolver resolver, | 104 Dart_NativeEntryResolver resolver, |
| 105 Dart_Handle import_map) { | 105 Dart_Handle import_map) { |
| 106 Dart_Handle url = Dart_NewString(TestCase::url()); | 106 Dart_Handle url = Dart_NewString(TestCase::url()); |
| 107 Dart_Handle source = Dart_NewString(script); | 107 Dart_Handle source = Dart_NewString(script); |
| 108 Dart_Handle result = Dart_SetLibraryTagHandler(LibraryTagHandler); | 108 Dart_Handle lib = Dart_LoadScript(url, source, LibraryTagHandler, import_map); |
| 109 EXPECT_VALID(result); | |
| 110 Dart_Handle lib = Dart_LoadScript(url, source, import_map); | |
| 111 DART_CHECK_VALID(lib); | 109 DART_CHECK_VALID(lib); |
| 112 result = Dart_SetNativeResolver(lib, resolver); | 110 Dart_Handle result = Dart_SetNativeResolver(lib, resolver); |
| 113 DART_CHECK_VALID(result); | 111 DART_CHECK_VALID(result); |
| 114 return lib; | 112 return lib; |
| 115 } | 113 } |
| 116 | 114 |
| 117 | 115 |
| 118 Dart_Handle TestCase::lib() { | 116 Dart_Handle TestCase::lib() { |
| 119 Dart_Handle url = Dart_NewString(TestCase::url()); | 117 Dart_Handle url = Dart_NewString(TestCase::url()); |
| 120 Dart_Handle lib = Dart_LookupLibrary(url); | 118 Dart_Handle lib = Dart_LookupLibrary(url); |
| 121 DART_CHECK_VALID(lib); | 119 DART_CHECK_VALID(lib); |
| 122 ASSERT(Dart_IsLibrary(lib)); | 120 ASSERT(Dart_IsLibrary(lib)); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 | 200 |
| 203 bool CompilerTest::TestCompileFunction(const Function& function) { | 201 bool CompilerTest::TestCompileFunction(const Function& function) { |
| 204 Isolate* isolate = Isolate::Current(); | 202 Isolate* isolate = Isolate::Current(); |
| 205 ASSERT(isolate != NULL); | 203 ASSERT(isolate != NULL); |
| 206 ASSERT(ClassFinalizer::AllClassesFinalized()); | 204 ASSERT(ClassFinalizer::AllClassesFinalized()); |
| 207 const Error& error = Error::Handle(Compiler::CompileFunction(function)); | 205 const Error& error = Error::Handle(Compiler::CompileFunction(function)); |
| 208 return error.IsNull(); | 206 return error.IsNull(); |
| 209 } | 207 } |
| 210 | 208 |
| 211 } // namespace dart | 209 } // namespace dart |
| OLD | NEW |