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

Unified Diff: test/cctest/test-strings.cc

Issue 110573004: Merge bleeding_edge 17696:18016. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 7 years 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 side-by-side diff with in-line comments
Download patch
Index: test/cctest/test-strings.cc
diff --git a/test/cctest/test-strings.cc b/test/cctest/test-strings.cc
index 4aa74a8191c79572ed69bac95d0c168495f22278..d0eabe30188729cdc574edd76c7a8212ec91c3d2 100644
--- a/test/cctest/test-strings.cc
+++ b/test/cctest/test-strings.cc
@@ -889,9 +889,9 @@ TEST(Utf8Conversion) {
v8::HandleScope handle_scope(CcTest::isolate());
// A simple ascii string
const char* ascii_string = "abcdef12345";
- int len =
- v8::String::New(ascii_string,
- StrLength(ascii_string))->Utf8Length();
+ int len = v8::String::NewFromUtf8(CcTest::isolate(), ascii_string,
+ v8::String::kNormalString,
+ StrLength(ascii_string))->Utf8Length();
CHECK_EQ(StrLength(ascii_string), len);
// A mixed ascii and non-ascii string
// U+02E4 -> CB A4
@@ -906,7 +906,8 @@ TEST(Utf8Conversion) {
// The number of bytes expected to be written for each length
const int lengths[12] = {0, 0, 2, 3, 3, 3, 6, 7, 7, 7, 10, 11};
const int char_lengths[12] = {0, 0, 1, 2, 2, 2, 3, 4, 4, 4, 5, 5};
- v8::Handle<v8::String> mixed = v8::String::New(mixed_string, 5);
+ v8::Handle<v8::String> mixed = v8::String::NewFromTwoByte(
+ CcTest::isolate(), mixed_string, v8::String::kNormalString, 5);
CHECK_EQ(10, mixed->Utf8Length());
// Try encoding the string with all capacities
char buffer[11];
@@ -1083,8 +1084,8 @@ TEST(CachedHashOverflow) {
const char* line;
for (int i = 0; (line = lines[i]); i++) {
printf("%s\n", line);
- v8::Local<v8::Value> result =
- v8::Script::Compile(v8::String::New(line))->Run();
+ v8::Local<v8::Value> result = v8::Script::Compile(
+ v8::String::NewFromUtf8(CcTest::isolate(), line))->Run();
CHECK_EQ(results[i]->IsUndefined(), result->IsUndefined());
CHECK_EQ(results[i]->IsNumber(), result->IsNumber());
if (result->IsNumber()) {
@@ -1213,7 +1214,7 @@ TEST(AsciiArrayJoin) {
v8::ResourceConstraints constraints;
constraints.set_max_young_space_size(256 * K);
constraints.set_max_old_space_size(4 * K * K);
- v8::SetResourceConstraints(&constraints);
+ v8::SetResourceConstraints(CcTest::isolate(), &constraints);
// String s is made of 2^17 = 131072 'c' characters and a is an array
// starting with 'bad', followed by 2^14 times the string s. That means the
@@ -1230,8 +1231,8 @@ TEST(AsciiArrayJoin) {
v8::HandleScope scope(CcTest::isolate());
LocalContext context;
v8::V8::IgnoreOutOfMemoryException();
- v8::Local<v8::Script> script =
- v8::Script::Compile(v8::String::New(join_causing_out_of_memory));
+ v8::Local<v8::Script> script = v8::Script::Compile(
+ v8::String::NewFromUtf8(CcTest::isolate(), join_causing_out_of_memory));
v8::Local<v8::Value> result = script->Run();
// Check for out of memory state.

Powered by Google App Engine
This is Rietveld 408576698