| 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 "bin/builtin.h" | 5 #include "bin/builtin.h" |
| 6 #include "include/dart_api.h" | 6 #include "include/dart_api.h" |
| 7 #include "include/dart_mirrors_api.h" | 7 #include "include/dart_mirrors_api.h" |
| 8 #include "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
| 9 #include "include/dart_tools_api.h" | 9 #include "include/dart_tools_api.h" |
| 10 #include "platform/assert.h" | 10 #include "platform/assert.h" |
| (...skipping 6744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6755 bool* auto_setup_scope) { | 6755 bool* auto_setup_scope) { |
| 6756 ASSERT(auto_setup_scope != NULL); | 6756 ASSERT(auto_setup_scope != NULL); |
| 6757 *auto_setup_scope = false; | 6757 *auto_setup_scope = false; |
| 6758 return &MyNativeFunction2; | 6758 return &MyNativeFunction2; |
| 6759 } | 6759 } |
| 6760 | 6760 |
| 6761 | 6761 |
| 6762 TEST_CASE(SetNativeResolver) { | 6762 TEST_CASE(SetNativeResolver) { |
| 6763 const char* kScriptChars = | 6763 const char* kScriptChars = |
| 6764 "class Test {" | 6764 "class Test {" |
| 6765 " static foo() native \"SomeNativeFunction\";" | 6765 " static foo() native \"SomeNativeFunction\";\n" |
| 6766 " static bar() native \"SomeNativeFunction2\";" | 6766 " static bar() native \"SomeNativeFunction2\";\n" |
| 6767 " static baz() native \"SomeNativeFunction3\";" | 6767 " static baz() native \"SomeNativeFunction3\";\n" |
| 6768 "}"; | 6768 "}"; |
| 6769 Dart_Handle error = Dart_NewApiError("incoming error"); | 6769 Dart_Handle error = Dart_NewApiError("incoming error"); |
| 6770 Dart_Handle result; | 6770 Dart_Handle result; |
| 6771 | 6771 |
| 6772 // Load a test script. | 6772 // Load a test script. |
| 6773 Dart_Handle url = NewString(TestCase::url()); | 6773 Dart_Handle url = NewString(TestCase::url()); |
| 6774 Dart_Handle source = NewString(kScriptChars); | 6774 Dart_Handle source = NewString(kScriptChars); |
| 6775 result = Dart_SetLibraryTagHandler(library_handler); | 6775 result = Dart_SetLibraryTagHandler(library_handler); |
| 6776 EXPECT_VALID(result); | 6776 EXPECT_VALID(result); |
| 6777 Dart_Handle lib = Dart_LoadScript(url, source, 0, 0); | 6777 Dart_Handle lib = Dart_LoadScript(url, source, 0, 0); |
| (...skipping 2808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9586 EXPECT_SUBSTRING("\"cat\":\"Compiler\"", buffer); | 9586 EXPECT_SUBSTRING("\"cat\":\"Compiler\"", buffer); |
| 9587 EXPECT_SUBSTRING("\"name\":\"CompileFunction\"", buffer); | 9587 EXPECT_SUBSTRING("\"name\":\"CompileFunction\"", buffer); |
| 9588 EXPECT_SUBSTRING("\"function\":\"::_main\"", buffer); | 9588 EXPECT_SUBSTRING("\"function\":\"::_main\"", buffer); |
| 9589 | 9589 |
| 9590 // Heartbeat test for new events. | 9590 // Heartbeat test for new events. |
| 9591 EXPECT_SUBSTRING("\"name\":\"TestVMDuration2\"", buffer); | 9591 EXPECT_SUBSTRING("\"name\":\"TestVMDuration2\"", buffer); |
| 9592 EXPECT_SUBSTRING("\"function\":\"::_bar\"", buffer); | 9592 EXPECT_SUBSTRING("\"function\":\"::_bar\"", buffer); |
| 9593 } | 9593 } |
| 9594 | 9594 |
| 9595 } // namespace dart | 9595 } // namespace dart |
| OLD | NEW |