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

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

Issue 127923002: Provide an Isolate for v8::ObjectTemplate::New. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | « content/renderer/pepper/v8_var_converter_unittest.cc ('k') | net/proxy/proxy_resolver_v8.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 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/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/test/values_test_util.h" 9 #include "base/test/values_test_util.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 class V8ValueConverterImplTest : public testing::Test { 47 class V8ValueConverterImplTest : public testing::Test {
48 public: 48 public:
49 V8ValueConverterImplTest() 49 V8ValueConverterImplTest()
50 : isolate_(v8::Isolate::GetCurrent()) { 50 : isolate_(v8::Isolate::GetCurrent()) {
51 } 51 }
52 52
53 protected: 53 protected:
54 virtual void SetUp() { 54 virtual void SetUp() {
55 v8::HandleScope handle_scope(isolate_); 55 v8::HandleScope handle_scope(isolate_);
56 v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New(); 56 v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New(isolate_);
57 context_.Reset(isolate_, v8::Context::New(isolate_, NULL, global)); 57 context_.Reset(isolate_, v8::Context::New(isolate_, NULL, global));
58 } 58 }
59 59
60 virtual void TearDown() { 60 virtual void TearDown() {
61 context_.Reset(); 61 context_.Reset();
62 } 62 }
63 63
64 std::string GetString(base::DictionaryValue* value, const std::string& key) { 64 std::string GetString(base::DictionaryValue* value, const std::string& key) {
65 std::string temp; 65 std::string temp;
66 if (!value->GetString(key, &temp)) { 66 if (!value->GetString(key, &temp)) {
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 ASSERT_TRUE(current->GetAsDictionary(&current_as_object)) << i; 688 ASSERT_TRUE(current->GetAsDictionary(&current_as_object)) << i;
689 ASSERT_TRUE(current_as_object->Get(kKey, &current)) << i; 689 ASSERT_TRUE(current_as_object->Get(kKey, &current)) << i;
690 } 690 }
691 691
692 // The leaf node shouldn't have any properties. 692 // The leaf node shouldn't have any properties.
693 base::DictionaryValue empty; 693 base::DictionaryValue empty;
694 EXPECT_TRUE(base::Value::Equals(&empty, current)) << *current; 694 EXPECT_TRUE(base::Value::Equals(&empty, current)) << *current;
695 } 695 }
696 696
697 } // namespace content 697 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/v8_var_converter_unittest.cc ('k') | net/proxy/proxy_resolver_v8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698