OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "content/renderer/v8_value_converter.h" | 9 #include "content/renderer/v8_value_converter.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
11 #include "v8/include/v8.h" | 11 #include "v8/include/v8.h" |
12 | 12 |
13 class V8ValueConverterTest : public testing::Test { | 13 class V8ValueConverterTest : public testing::Test { |
14 protected: | 14 protected: |
15 virtual void SetUp() { | 15 virtual void SetUp() { |
16 v8::HandleScope handle_scope; | 16 v8::HandleScope handle_scope; |
17 v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New(); | 17 v8::Handle<v8::ObjectTemplate> global = v8::ObjectTemplate::New(); |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 v8::Handle<v8::Script> script(v8::Script::New(v8::String::New(source))); | 317 v8::Handle<v8::Script> script(v8::Script::New(v8::String::New(source))); |
318 v8::Handle<v8::Object> object = script->Run().As<v8::Object>(); | 318 v8::Handle<v8::Object> object = script->Run().As<v8::Object>(); |
319 ASSERT_FALSE(object.IsEmpty()); | 319 ASSERT_FALSE(object.IsEmpty()); |
320 | 320 |
321 V8ValueConverter converter; | 321 V8ValueConverter converter; |
322 scoped_ptr<DictionaryValue> result( | 322 scoped_ptr<DictionaryValue> result( |
323 static_cast<DictionaryValue*>(converter.FromV8Value(object, context_))); | 323 static_cast<DictionaryValue*>(converter.FromV8Value(object, context_))); |
324 ASSERT_TRUE(result.get()); | 324 ASSERT_TRUE(result.get()); |
325 EXPECT_EQ(0u, result->size()); | 325 EXPECT_EQ(0u, result->size()); |
326 } | 326 } |
OLD | NEW |