| 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 "vm/unit_test.h" | 5 #include "vm/unit_test.h" |
| 6 | 6 |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include "bin/builtin.h" | 9 #include "bin/builtin.h" |
| 10 #include "bin/dartutils.h" | 10 #include "bin/dartutils.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 const char* kScript = | 85 const char* kScript = |
| 86 "importedFunc() => 'a';\n" | 86 "importedFunc() => 'a';\n" |
| 87 "importedIntFunc() => 4;\n" | 87 "importedIntFunc() => 4;\n" |
| 88 "class ImportedMixin {\n" | 88 "class ImportedMixin {\n" |
| 89 " mixinFunc() => 'mixin';\n" | 89 " mixinFunc() => 'mixin';\n" |
| 90 "}\n"; | 90 "}\n"; |
| 91 return DartUtils::NewString(kScript); | 91 return DartUtils::NewString(kScript); |
| 92 } | 92 } |
| 93 | 93 |
| 94 | 94 |
| 95 #ifndef PRODUCT |
| 95 static bool IsIsolateReloadTestLib(const char* url_name) { | 96 static bool IsIsolateReloadTestLib(const char* url_name) { |
| 96 const char* kIsolateReloadTestLibUri = "test:isolate_reload_helper"; | 97 const char* kIsolateReloadTestLibUri = "test:isolate_reload_helper"; |
| 97 static const intptr_t kIsolateReloadTestLibUriLen = | 98 static const intptr_t kIsolateReloadTestLibUriLen = |
| 98 strlen(kIsolateReloadTestLibUri); | 99 strlen(kIsolateReloadTestLibUri); |
| 99 return (strncmp(url_name, | 100 return (strncmp(url_name, |
| 100 kIsolateReloadTestLibUri, | 101 kIsolateReloadTestLibUri, |
| 101 kIsolateReloadTestLibUriLen) == 0); | 102 kIsolateReloadTestLibUriLen) == 0); |
| 102 } | 103 } |
| 103 | 104 |
| 104 | 105 |
| 105 #ifndef PRODUCT | |
| 106 static Dart_Handle IsolateReloadTestLibSource() { | 106 static Dart_Handle IsolateReloadTestLibSource() { |
| 107 // Special library with one function. | 107 // Special library with one function. |
| 108 return DartUtils::NewString("void reloadTest() native 'Reload_Test';\n"); | 108 return DartUtils::NewString("void reloadTest() native 'Reload_Test';\n"); |
| 109 } | 109 } |
| 110 | 110 |
| 111 | 111 |
| 112 static void ReloadTest(Dart_NativeArguments native_args) { | 112 static void ReloadTest(Dart_NativeArguments native_args) { |
| 113 DART_CHECK_VALID(TestCase::TriggerReload()); | 113 DART_CHECK_VALID(TestCase::TriggerReload()); |
| 114 } | 114 } |
| 115 | 115 |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 } | 447 } |
| 448 // Copy the remainder of in to out. | 448 // Copy the remainder of in to out. |
| 449 while (*in != '\0') { | 449 while (*in != '\0') { |
| 450 *out++ = *in++; | 450 *out++ = *in++; |
| 451 } | 451 } |
| 452 *out = '\0'; | 452 *out = '\0'; |
| 453 } | 453 } |
| 454 | 454 |
| 455 | 455 |
| 456 } // namespace dart | 456 } // namespace dart |
| OLD | NEW |