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

Side by Side Diff: chrome/test/v8_unit_test.cc

Issue 193072: Move StringPiece into the base namespace. It is colliding (Closed)
Patch Set: take 2 Created 11 years, 3 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 | « chrome/test/v8_unit_test.h ('k') | chrome/tools/mac_helpers/infoplist_strings_util.mm » ('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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <iostream> 5 #include <iostream>
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "chrome/test/v8_unit_test.h" 8 #include "chrome/test/v8_unit_test.h"
9 9
10 void V8UnitTest::SetUp() { 10 void V8UnitTest::SetUp() {
11 v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New(); 11 v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New();
12 global->Set(v8::String::New("log"), 12 global->Set(v8::String::New("log"),
13 v8::FunctionTemplate::New(&V8UnitTest::Log)); 13 v8::FunctionTemplate::New(&V8UnitTest::Log));
14 context_ = v8::Context::New(NULL, global); 14 context_ = v8::Context::New(NULL, global);
15 } 15 }
16 16
17 void V8UnitTest::ExecuteScriptInContext(const StringPiece& script_source, 17 void V8UnitTest::ExecuteScriptInContext(const base::StringPiece& script_source,
18 const StringPiece& script_name) { 18 const base::StringPiece& script_name) {
19 v8::Context::Scope context_scope(context_); 19 v8::Context::Scope context_scope(context_);
20 v8::HandleScope handle_scope; 20 v8::HandleScope handle_scope;
21 v8::Handle<v8::String> source = v8::String::New(script_source.data(), 21 v8::Handle<v8::String> source = v8::String::New(script_source.data(),
22 script_source.size()); 22 script_source.size());
23 v8::Handle<v8::String> name = v8::String::New(script_name.data(), 23 v8::Handle<v8::String> name = v8::String::New(script_name.data(),
24 script_source.size()); 24 script_source.size());
25 25
26 v8::TryCatch try_catch; 26 v8::TryCatch try_catch;
27 v8::Handle<v8::Script> script = v8::Script::Compile(source, name); 27 v8::Handle<v8::Script> script = v8::Script::Compile(source, name);
28 // Ensure the script compiled without errors. 28 // Ensure the script compiled without errors.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 first = false; 84 first = false;
85 } else { 85 } else {
86 message += " "; 86 message += " ";
87 } 87 }
88 v8::String::Utf8Value str(args[i]); 88 v8::String::Utf8Value str(args[i]);
89 message += *str; 89 message += *str;
90 } 90 }
91 std::cout << message << "\n"; 91 std::cout << message << "\n";
92 return v8::Undefined(); 92 return v8::Undefined();
93 } 93 }
OLDNEW
« no previous file with comments | « chrome/test/v8_unit_test.h ('k') | chrome/tools/mac_helpers/infoplist_strings_util.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698