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

Side by Side Diff: content/renderer/v8_value_converter_impl_unittest.cc

Issue 12210035: Use non-deprecated versions of v8::Persistent::New/Dispose. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « content/renderer/gpu/gpu_benchmarking_extension.cc ('k') | no next file » | 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 Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <cmath> 5 #include <cmath>
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/test/values_test_util.h" 8 #include "base/test/values_test_util.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "content/renderer/v8_value_converter_impl.h" 10 #include "content/renderer/v8_value_converter_impl.h"
(...skipping 14 matching lines...) Expand all
25 25
26 class V8ValueConverterImplTest : public testing::Test { 26 class V8ValueConverterImplTest : public testing::Test {
27 protected: 27 protected:
28 virtual void SetUp() { 28 virtual void SetUp() {
29 v8::HandleScope handle_scope; 29 v8::HandleScope handle_scope;
30 v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New(); 30 v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New();
31 context_ = v8::Context::New(NULL, global); 31 context_ = v8::Context::New(NULL, global);
32 } 32 }
33 33
34 virtual void TearDown() { 34 virtual void TearDown() {
35 context_.Dispose(); 35 context_.Dispose(context_->GetIsolate());
36 } 36 }
37 37
38 std::string GetString(DictionaryValue* value, const std::string& key) { 38 std::string GetString(DictionaryValue* value, const std::string& key) {
39 std::string temp; 39 std::string temp;
40 if (!value->GetString(key, &temp)) { 40 if (!value->GetString(key, &temp)) {
41 ADD_FAILURE(); 41 ADD_FAILURE();
42 return ""; 42 return "";
43 } 43 }
44 return temp; 44 return temp;
45 } 45 }
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 EXPECT_TRUE(Value::Equals(base::test::ParseJson("{ \"bar\": null }").get(), 537 EXPECT_TRUE(Value::Equals(base::test::ParseJson("{ \"bar\": null }").get(),
538 actual_object.get())); 538 actual_object.get()));
539 539
540 // Everything is null because JSON stringification preserves array length. 540 // Everything is null because JSON stringification preserves array length.
541 scoped_ptr<Value> actual_array(converter.FromV8Value(array, context_)); 541 scoped_ptr<Value> actual_array(converter.FromV8Value(array, context_));
542 EXPECT_TRUE(Value::Equals(base::test::ParseJson("[ null, null, null ]").get(), 542 EXPECT_TRUE(Value::Equals(base::test::ParseJson("[ null, null, null ]").get(),
543 actual_array.get())); 543 actual_array.get()));
544 } 544 }
545 545
546 } // namespace content 546 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/gpu/gpu_benchmarking_extension.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698