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

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

Issue 16703020: Rewrite scoped_ptr<T>(NULL) to use the default ctor in content/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clean up insanity Created 7 years, 6 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
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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 v8::HandleScope handle_scope(isolate_); 358 v8::HandleScope handle_scope(isolate_);
359 v8::Context::Scope context_scope(isolate_, context_); 359 v8::Context::Scope context_scope(isolate_, context_);
360 360
361 v8::Handle<v8::RegExp> regex( 361 v8::Handle<v8::RegExp> regex(
362 v8::RegExp::New(v8::String::New("."), v8::RegExp::kNone)); 362 v8::RegExp::New(v8::String::New("."), v8::RegExp::kNone));
363 363
364 V8ValueConverterImpl converter; 364 V8ValueConverterImpl converter;
365 TestWeirdType(converter, 365 TestWeirdType(converter,
366 v8::Undefined(), 366 v8::Undefined(),
367 base::Value::TYPE_NULL, // Arbitrary type, result is NULL. 367 base::Value::TYPE_NULL, // Arbitrary type, result is NULL.
368 scoped_ptr<base::Value>(NULL)); 368 scoped_ptr<base::Value>());
369 TestWeirdType(converter, 369 TestWeirdType(converter,
370 v8::Date::New(1000), 370 v8::Date::New(1000),
371 base::Value::TYPE_DICTIONARY, 371 base::Value::TYPE_DICTIONARY,
372 scoped_ptr<base::Value>(new base::DictionaryValue())); 372 scoped_ptr<base::Value>(new base::DictionaryValue()));
373 TestWeirdType(converter, 373 TestWeirdType(converter,
374 regex, 374 regex,
375 base::Value::TYPE_DICTIONARY, 375 base::Value::TYPE_DICTIONARY,
376 scoped_ptr<base::Value>(new base::DictionaryValue())); 376 scoped_ptr<base::Value>(new base::DictionaryValue()));
377 377
378 converter.SetDateAllowed(true); 378 converter.SetDateAllowed(true);
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 ASSERT_TRUE(current->GetAsDictionary(&current_as_object)) << i; 669 ASSERT_TRUE(current->GetAsDictionary(&current_as_object)) << i;
670 ASSERT_TRUE(current_as_object->Get(kKey, &current)) << i; 670 ASSERT_TRUE(current_as_object->Get(kKey, &current)) << i;
671 } 671 }
672 672
673 // The leaf node shouldn't have any properties. 673 // The leaf node shouldn't have any properties.
674 base::DictionaryValue empty; 674 base::DictionaryValue empty;
675 EXPECT_TRUE(Value::Equals(&empty, current)) << *current; 675 EXPECT_TRUE(Value::Equals(&empty, current)) << *current;
676 } 676 }
677 677
678 } // namespace content 678 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/device_orientation_dispatcher.cc ('k') | content/shell/shell_browser_main_parts.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698