| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 688 ASSERT_TRUE(current->GetAsDictionary(¤t_as_object)) << i; | 688 ASSERT_TRUE(current->GetAsDictionary(¤t_as_object)) << i; |
| 689 ASSERT_TRUE(current_as_object->Get(kKey, ¤t)) << i; | 689 ASSERT_TRUE(current_as_object->Get(kKey, ¤t)) << 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 |
| OLD | NEW |