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 "content/child/v8_value_converter_impl.h" | 5 #include "content/child/v8_value_converter_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <cmath> | 10 #include <cmath> |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 std::unique_ptr<base::Value>()); | 407 std::unique_ptr<base::Value>()); |
408 TestWeirdType(converter, v8::Date::New(isolate_, 1000), | 408 TestWeirdType(converter, v8::Date::New(isolate_, 1000), |
409 base::Value::TYPE_DICTIONARY, | 409 base::Value::TYPE_DICTIONARY, |
410 std::unique_ptr<base::Value>(new base::DictionaryValue())); | 410 std::unique_ptr<base::Value>(new base::DictionaryValue())); |
411 TestWeirdType(converter, regex, base::Value::TYPE_DICTIONARY, | 411 TestWeirdType(converter, regex, base::Value::TYPE_DICTIONARY, |
412 std::unique_ptr<base::Value>(new base::DictionaryValue())); | 412 std::unique_ptr<base::Value>(new base::DictionaryValue())); |
413 | 413 |
414 converter.SetDateAllowed(true); | 414 converter.SetDateAllowed(true); |
415 TestWeirdType(converter, v8::Date::New(isolate_, 1000), | 415 TestWeirdType(converter, v8::Date::New(isolate_, 1000), |
416 base::Value::TYPE_DOUBLE, | 416 base::Value::TYPE_DOUBLE, |
417 std::unique_ptr<base::Value>(new base::FundamentalValue(1.0))); | 417 std::unique_ptr<base::Value>(new base::Value(1.0))); |
418 | 418 |
419 converter.SetRegExpAllowed(true); | 419 converter.SetRegExpAllowed(true); |
420 TestWeirdType(converter, regex, base::Value::TYPE_STRING, | 420 TestWeirdType(converter, regex, base::Value::TYPE_STRING, |
421 std::unique_ptr<base::Value>(new base::StringValue("/./"))); | 421 std::unique_ptr<base::Value>(new base::StringValue("/./"))); |
422 } | 422 } |
423 | 423 |
424 TEST_F(V8ValueConverterImplTest, Prototype) { | 424 TEST_F(V8ValueConverterImplTest, Prototype) { |
425 v8::HandleScope handle_scope(isolate_); | 425 v8::HandleScope handle_scope(isolate_); |
426 v8::Local<v8::Context> context = | 426 v8::Local<v8::Context> context = |
427 v8::Local<v8::Context>::New(isolate_, context_); | 427 v8::Local<v8::Context>::New(isolate_, context_); |
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1120 EXPECT_TRUE( | 1120 EXPECT_TRUE( |
1121 base::Value::Equals(reference_number_value.get(), number_value.get())); | 1121 base::Value::Equals(reference_number_value.get(), number_value.get())); |
1122 | 1122 |
1123 v8::Local<v8::Primitive> undefined(v8::Undefined(isolate_)); | 1123 v8::Local<v8::Primitive> undefined(v8::Undefined(isolate_)); |
1124 std::unique_ptr<base::Value> undefined_value( | 1124 std::unique_ptr<base::Value> undefined_value( |
1125 converter.FromV8Value(undefined, context)); | 1125 converter.FromV8Value(undefined, context)); |
1126 EXPECT_FALSE(undefined_value); | 1126 EXPECT_FALSE(undefined_value); |
1127 } | 1127 } |
1128 | 1128 |
1129 } // namespace content | 1129 } // namespace content |
OLD | NEW |