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

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

Issue 108603005: Update uses of Value in chromeos/, cloud_print/, components/, content/ to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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/v8_value_converter_impl.cc ('k') | content/renderer/web_ui_extension.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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 } 571 }
572 572
573 V8ValueConverterImpl converter; 573 V8ValueConverterImpl converter;
574 574
575 scoped_ptr<base::Value> actual_object( 575 scoped_ptr<base::Value> actual_object(
576 converter.FromV8Value(object, context)); 576 converter.FromV8Value(object, context));
577 EXPECT_TRUE(base::Value::Equals( 577 EXPECT_TRUE(base::Value::Equals(
578 base::test::ParseJson("{ \"bar\": null }").get(), actual_object.get())); 578 base::test::ParseJson("{ \"bar\": null }").get(), actual_object.get()));
579 579
580 // Everything is null because JSON stringification preserves array length. 580 // Everything is null because JSON stringification preserves array length.
581 scoped_ptr<Value> actual_array(converter.FromV8Value(array, context)); 581 scoped_ptr<base::Value> actual_array(converter.FromV8Value(array, context));
582 EXPECT_TRUE(base::Value::Equals( 582 EXPECT_TRUE(base::Value::Equals(
583 base::test::ParseJson("[ null, null, null ]").get(), actual_array.get())); 583 base::test::ParseJson("[ null, null, null ]").get(), actual_array.get()));
584 } 584 }
585 585
586 TEST_F(V8ValueConverterImplTest, ObjectsWithClashingIdentityHash) { 586 TEST_F(V8ValueConverterImplTest, ObjectsWithClashingIdentityHash) {
587 v8::HandleScope handle_scope(isolate_); 587 v8::HandleScope handle_scope(isolate_);
588 v8::Local<v8::Context> context = 588 v8::Local<v8::Context> context =
589 v8::Local<v8::Context>::New(isolate_, context_); 589 v8::Local<v8::Context>::New(isolate_, context_);
590 v8::Context::Scope context_scope(context); 590 v8::Context::Scope context_scope(context);
591 V8ValueConverterImpl converter; 591 V8ValueConverterImpl converter;
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 684
685 base::Value* current = value.get(); 685 base::Value* current = value.get();
686 for (int i = 1; i < kExpectedDepth; ++i) { 686 for (int i = 1; i < kExpectedDepth; ++i) {
687 base::DictionaryValue* current_as_object = NULL; 687 base::DictionaryValue* current_as_object = NULL;
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(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/v8_value_converter_impl.cc ('k') | content/renderer/web_ui_extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698