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

Side by Side Diff: vm/dart_api_impl_test.cc

Issue 11969029: Allow externalization of canonical strings also. Only restrict canonical strings (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 7 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « vm/dart_api_impl.cc ('k') | vm/object.h » ('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 "include/dart_api.h" 5 #include "include/dart_api.h"
6 #include "platform/assert.h" 6 #include "platform/assert.h"
7 #include "platform/json.h" 7 #include "platform/json.h"
8 #include "platform/utils.h" 8 #include "platform/utils.h"
9 #include "vm/class_finalizer.h" 9 #include "vm/class_finalizer.h"
10 #include "vm/dart_api_impl.h" 10 #include "vm/dart_api_impl.h"
(...skipping 7388 matching lines...) Expand 10 before | Expand all | Expand 10 after
7399 const char* expected_str = "constant string"; 7399 const char* expected_str = "constant string";
7400 const intptr_t kExpectedLen = 15; 7400 const intptr_t kExpectedLen = 15;
7401 int peer = 40; 7401 int peer = 40;
7402 uint8_t ext_str[kExpectedLen]; 7402 uint8_t ext_str[kExpectedLen];
7403 Dart_Handle str = Dart_MakeExternalString(result, 7403 Dart_Handle str = Dart_MakeExternalString(result,
7404 ext_str, 7404 ext_str,
7405 kExpectedLen, 7405 kExpectedLen,
7406 &peer, 7406 &peer,
7407 MakeExternalCback); 7407 MakeExternalCback);
7408 7408
7409 EXPECT(Dart_IsNull(str)); 7409 EXPECT(Dart_IsExternalString(str));
7410 for (intptr_t i = 0; i < kExpectedLen; i++) { 7410 for (intptr_t i = 0; i < kExpectedLen; i++) {
7411 EXPECT_EQ(expected_str[i], ext_str[i]); 7411 EXPECT_EQ(expected_str[i], ext_str[i]);
7412 } 7412 }
7413 } 7413 }
7414 7414
7415 7415
7416 TEST_CASE(LazyLoadDeoptimizes) { 7416 TEST_CASE(LazyLoadDeoptimizes) {
7417 const char* kLoadFirst = 7417 const char* kLoadFirst =
7418 "start(a) {\n" 7418 "start(a) {\n"
7419 " var obj = (a == 1) ? createB() : new A();\n" 7419 " var obj = (a == 1) ? createB() : new A();\n"
(...skipping 27 matching lines...) Expand all
7447 Dart_LoadSource(TestCase::lib(), url, source); 7447 Dart_LoadSource(TestCase::lib(), url, source);
7448 7448
7449 dart_args[0] = Dart_NewInteger(1); 7449 dart_args[0] = Dart_NewInteger(1);
7450 result = Dart_Invoke(lib1, NewString("start"), 1, dart_args); 7450 result = Dart_Invoke(lib1, NewString("start"), 1, dart_args);
7451 EXPECT_VALID(result); 7451 EXPECT_VALID(result);
7452 } 7452 }
7453 7453
7454 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). 7454 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64).
7455 7455
7456 } // namespace dart 7456 } // namespace dart
OLDNEW
« no previous file with comments | « vm/dart_api_impl.cc ('k') | vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698