OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "bindings/core/v8/ToV8.h" | 5 #include "bindings/core/v8/ToV8.h" |
6 | 6 |
| 7 #include <limits> |
7 #include "bindings/core/v8/V8Binding.h" | 8 #include "bindings/core/v8/V8Binding.h" |
8 #include "bindings/core/v8/V8BindingForTesting.h" | 9 #include "bindings/core/v8/V8BindingForTesting.h" |
9 #include "core/testing/GarbageCollectedScriptWrappable.h" | 10 #include "core/testing/GarbageCollectedScriptWrappable.h" |
10 #include "platform/heap/Heap.h" | 11 #include "platform/heap/Heap.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
12 #include "wtf/Vector.h" | 13 #include "wtf/Vector.h" |
13 #include <limits> | |
14 | 14 |
15 #define TEST_TOV8(expected, value) \ | 15 #define TEST_TOV8(expected, value) \ |
16 testToV8(&scope, expected, value, __FILE__, __LINE__) | 16 testToV8(&scope, expected, value, __FILE__, __LINE__) |
17 | 17 |
18 namespace blink { | 18 namespace blink { |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 template <typename T> | 22 template <typename T> |
23 void testToV8(V8TestingScope* scope, | 23 void testToV8(V8TestingScope* scope, |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 v8::Local<v8::Value> actual = ToV8(value, scope.getScriptState()); | 270 v8::Local<v8::Value> actual = ToV8(value, scope.getScriptState()); |
271 EXPECT_FALSE(actual.IsEmpty()); | 271 EXPECT_FALSE(actual.IsEmpty()); |
272 | 272 |
273 double actualAsNumber = actual.As<v8::Number>()->Value(); | 273 double actualAsNumber = actual.As<v8::Number>()->Value(); |
274 EXPECT_EQ(1234.0, actualAsNumber); | 274 EXPECT_EQ(1234.0, actualAsNumber); |
275 } | 275 } |
276 | 276 |
277 } // namespace | 277 } // namespace |
278 | 278 |
279 } // namespace blink | 279 } // namespace blink |
OLD | NEW |