| 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 lib = Dart_LoadScript(url, source, LibraryTagHandler, import_map); | 108 Dart_Handle result = Dart_SetLibraryTagHandler(LibraryTagHandler); |
| 109 EXPECT_VALID(result); |
| 110 Dart_Handle lib = Dart_LoadScript(url, source, import_map); |
| 109 DART_CHECK_VALID(lib); | 111 DART_CHECK_VALID(lib); |
| 110 Dart_Handle result = Dart_SetNativeResolver(lib, resolver); | 112 result = Dart_SetNativeResolver(lib, resolver); |
| 111 DART_CHECK_VALID(result); | 113 DART_CHECK_VALID(result); |
| 112 return lib; | 114 return lib; |
| 113 } | 115 } |
| 114 | 116 |
| 115 | 117 |
| 116 Dart_Handle TestCase::lib() { | 118 Dart_Handle TestCase::lib() { |
| 117 Dart_Handle url = Dart_NewString(TestCase::url()); | 119 Dart_Handle url = Dart_NewString(TestCase::url()); |
| 118 Dart_Handle lib = Dart_LookupLibrary(url); | 120 Dart_Handle lib = Dart_LookupLibrary(url); |
| 119 DART_CHECK_VALID(lib); | 121 DART_CHECK_VALID(lib); |
| 120 ASSERT(Dart_IsLibrary(lib)); | 122 ASSERT(Dart_IsLibrary(lib)); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 | 202 |
| 201 bool CompilerTest::TestCompileFunction(const Function& function) { | 203 bool CompilerTest::TestCompileFunction(const Function& function) { |
| 202 Isolate* isolate = Isolate::Current(); | 204 Isolate* isolate = Isolate::Current(); |
| 203 ASSERT(isolate != NULL); | 205 ASSERT(isolate != NULL); |
| 204 ASSERT(ClassFinalizer::AllClassesFinalized()); | 206 ASSERT(ClassFinalizer::AllClassesFinalized()); |
| 205 const Error& error = Error::Handle(Compiler::CompileFunction(function)); | 207 const Error& error = Error::Handle(Compiler::CompileFunction(function)); |
| 206 return error.IsNull(); | 208 return error.IsNull(); |
| 207 } | 209 } |
| 208 | 210 |
| 209 } // namespace dart | 211 } // namespace dart |
| OLD | NEW |