Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: runtime/vm/dart_api_impl_test.cc

Issue 1731743003: Move precompilation-related flags to flags list. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: make print_stop_message default false to fix build Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/debugger.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "platform/text_buffer.h" 11 #include "platform/text_buffer.h"
12 #include "platform/utils.h" 12 #include "platform/utils.h"
13 #include "vm/class_finalizer.h" 13 #include "vm/class_finalizer.h"
14 #include "vm/dart_api_impl.h" 14 #include "vm/dart_api_impl.h"
15 #include "vm/dart_api_state.h" 15 #include "vm/dart_api_state.h"
16 #include "vm/lockers.h" 16 #include "vm/lockers.h"
17 #include "vm/unit_test.h" 17 #include "vm/unit_test.h"
18 #include "vm/verifier.h" 18 #include "vm/verifier.h"
19 19
20 namespace dart { 20 namespace dart {
21 21
22 DECLARE_FLAG(int, optimization_counter_threshold);
23 DECLARE_FLAG(bool, verify_acquired_data); 22 DECLARE_FLAG(bool, verify_acquired_data);
24 DECLARE_FLAG(bool, ignore_patch_signature_mismatch); 23 DECLARE_FLAG(bool, ignore_patch_signature_mismatch);
25 24
26 #ifndef PRODUCT 25 #ifndef PRODUCT
27 26
28 TEST_CASE(ErrorHandleBasics) { 27 TEST_CASE(ErrorHandleBasics) {
29 const char* kScriptChars = 28 const char* kScriptChars =
30 "void testMain() {\n" 29 "void testMain() {\n"
31 " throw new Exception(\"bad news\");\n" 30 " throw new Exception(\"bad news\");\n"
32 "}\n"; 31 "}\n";
(...skipping 1866 matching lines...) Expand 10 before | Expand all | Expand 10 after
1899 result = Dart_Invoke(lib, NewString("main"), 0, NULL); 1898 result = Dart_Invoke(lib, NewString("main"), 0, NULL);
1900 EXPECT_VALID(result); 1899 EXPECT_VALID(result);
1901 1900
1902 for (intptr_t i = 0; i < kExtLength; i+=2) { 1901 for (intptr_t i = 0; i < kExtLength; i+=2) {
1903 EXPECT_EQ(0x24, data[i]); 1902 EXPECT_EQ(0x24, data[i]);
1904 EXPECT_EQ(0x28, data[i+1]); 1903 EXPECT_EQ(0x28, data[i+1]);
1905 } 1904 }
1906 } 1905 }
1907 1906
1908 1907
1908 #ifndef PRODUCT
1909
1910
1909 static const intptr_t kOptExtLength = 16; 1911 static const intptr_t kOptExtLength = 16;
1910 static int8_t opt_data[kOptExtLength] = { 0x01, 0x02, 0x03, 0x04, 1912 static int8_t opt_data[kOptExtLength] = { 0x01, 0x02, 0x03, 0x04,
1911 0x05, 0x06, 0x07, 0x08, 1913 0x05, 0x06, 0x07, 0x08,
1912 0x09, 0x0a, 0x0b, 0x0c, 1914 0x09, 0x0a, 0x0b, 0x0c,
1913 0x0d, 0x0e, 0x0f, 0x10, }; 1915 0x0d, 0x0e, 0x0f, 0x10, };
1914 1916
1915 static void OptExternalByteDataNativeFunction(Dart_NativeArguments args) { 1917 static void OptExternalByteDataNativeFunction(Dart_NativeArguments args) {
1916 Dart_EnterScope(); 1918 Dart_EnterScope();
1917 Dart_Handle external_byte_data = Dart_NewExternalTypedData( 1919 Dart_Handle external_byte_data = Dart_NewExternalTypedData(
1918 Dart_TypedData_kByteData, opt_data, 16); 1920 Dart_TypedData_kByteData, opt_data, 16);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
1967 1969
1968 // Invoke 'main' function. 1970 // Invoke 'main' function.
1969 int old_oct = FLAG_optimization_counter_threshold; 1971 int old_oct = FLAG_optimization_counter_threshold;
1970 FLAG_optimization_counter_threshold = 5; 1972 FLAG_optimization_counter_threshold = 5;
1971 result = Dart_Invoke(lib, NewString("main"), 0, NULL); 1973 result = Dart_Invoke(lib, NewString("main"), 0, NULL);
1972 EXPECT_VALID(result); 1974 EXPECT_VALID(result);
1973 FLAG_optimization_counter_threshold = old_oct; 1975 FLAG_optimization_counter_threshold = old_oct;
1974 } 1976 }
1975 1977
1976 1978
1979 #endif // !PRODUCT
1980
1981
1977 static void TestTypedDataDirectAccess() { 1982 static void TestTypedDataDirectAccess() {
1978 Dart_Handle str = Dart_NewStringFromCString("junk"); 1983 Dart_Handle str = Dart_NewStringFromCString("junk");
1979 Dart_Handle byte_array = Dart_NewTypedData(Dart_TypedData_kUint8, 10); 1984 Dart_Handle byte_array = Dart_NewTypedData(Dart_TypedData_kUint8, 10);
1980 EXPECT_VALID(byte_array); 1985 EXPECT_VALID(byte_array);
1981 Dart_Handle result; 1986 Dart_Handle result;
1982 result = Dart_TypedDataAcquireData(byte_array, NULL, NULL, NULL); 1987 result = Dart_TypedDataAcquireData(byte_array, NULL, NULL, NULL);
1983 EXPECT_ERROR(result, "Dart_TypedDataAcquireData expects argument 'type'" 1988 EXPECT_ERROR(result, "Dart_TypedDataAcquireData expects argument 'type'"
1984 " to be non-null."); 1989 " to be non-null.");
1985 Dart_TypedData_Type type; 1990 Dart_TypedData_Type type;
1986 result = Dart_TypedDataAcquireData(byte_array, &type, NULL, NULL); 1991 result = Dart_TypedDataAcquireData(byte_array, &type, NULL, NULL);
(...skipping 7776 matching lines...) Expand 10 before | Expand all | Expand 10 after
9763 EXPECT_SUBSTRING("\"function\":\"::_main\"", buffer); 9768 EXPECT_SUBSTRING("\"function\":\"::_main\"", buffer);
9764 9769
9765 // Heartbeat test for new events. 9770 // Heartbeat test for new events.
9766 EXPECT_SUBSTRING("\"name\":\"TestVMDuration2\"", buffer); 9771 EXPECT_SUBSTRING("\"name\":\"TestVMDuration2\"", buffer);
9767 EXPECT_SUBSTRING("\"function\":\"::_bar\"", buffer); 9772 EXPECT_SUBSTRING("\"function\":\"::_bar\"", buffer);
9768 } 9773 }
9769 9774
9770 #endif // !PRODUCT 9775 #endif // !PRODUCT
9771 9776
9772 } // namespace dart 9777 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/debugger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698