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 "config.h" | 5 #include "config.h" |
6 #include "bindings/core/v8/V8Binding.h" | 6 #include "bindings/core/v8/V8Binding.h" |
7 | 7 |
8 #include "bindings/core/v8/ExceptionState.h" | 8 #include "bindings/core/v8/ExceptionState.h" |
9 #include "bindings/core/v8/ToV8.h" | 9 #include "bindings/core/v8/ToV8.h" |
10 #include "wtf/Vector.h" | 10 #include "wtf/Vector.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 EXPECT_EQ(1U, floatVector.size()); | 67 EXPECT_EQ(1U, floatVector.size()); |
68 EXPECT_EQ(floatPi, floatVector[0]); | 68 EXPECT_EQ(floatPi, floatVector[0]); |
69 } | 69 } |
70 { | 70 { |
71 v8::Handle<v8::Array> v8Array = v8::Array::New(m_scope.isolate(), 3); | 71 v8::Handle<v8::Array> v8Array = v8::Array::New(m_scope.isolate(), 3); |
72 v8Array->Set(toV8(0), toV8("Vini, vidi, vici.")); | 72 v8Array->Set(toV8(0), toV8("Vini, vidi, vici.")); |
73 v8Array->Set(toV8(1), toV8(65535)); | 73 v8Array->Set(toV8(1), toV8(65535)); |
74 v8Array->Set(toV8(2), toV8(0.125)); | 74 v8Array->Set(toV8(2), toV8(0.125)); |
75 | 75 |
76 NonThrowableExceptionState exceptionState; | 76 NonThrowableExceptionState exceptionState; |
77 Vector<v8::Handle<v8::Value> > v8HandleVector = toImplArray<v8::Handle<v
8::Value> >(v8Array, 0, m_scope.isolate(), exceptionState); | 77 Vector<v8::Local<v8::Value> > v8HandleVector = toImplArray<v8::Local<v8:
:Value> >(v8Array, 0, m_scope.isolate(), exceptionState); |
78 EXPECT_EQ(3U, v8HandleVector.size()); | 78 EXPECT_EQ(3U, v8HandleVector.size()); |
79 EXPECT_EQ("Vini, vidi, vici.", toUSVString(v8HandleVector[0], exceptionS
tate)); | 79 EXPECT_EQ("Vini, vidi, vici.", toUSVString(v8HandleVector[0], exceptionS
tate)); |
80 EXPECT_EQ(65535U, toUInt32(v8HandleVector[1])); | 80 EXPECT_EQ(65535U, toUInt32(v8HandleVector[1])); |
81 EXPECT_EQ(0.125, toFloat(v8HandleVector[2])); | 81 EXPECT_EQ(0.125, toFloat(v8HandleVector[2])); |
82 | 82 |
83 Vector<ScriptValue> scriptValueVector = toImplArray<ScriptValue>(v8Array
, 0, m_scope.isolate(), exceptionState); | 83 Vector<ScriptValue> scriptValueVector = toImplArray<ScriptValue>(v8Array
, 0, m_scope.isolate(), exceptionState); |
84 EXPECT_EQ(3U, scriptValueVector.size()); | 84 EXPECT_EQ(3U, scriptValueVector.size()); |
85 String reportOnZela; | 85 String reportOnZela; |
86 EXPECT_TRUE(scriptValueVector[0].toString(reportOnZela)); | 86 EXPECT_TRUE(scriptValueVector[0].toString(reportOnZela)); |
87 EXPECT_EQ("Vini, vidi, vici.", reportOnZela); | 87 EXPECT_EQ("Vini, vidi, vici.", reportOnZela); |
(...skipping 21 matching lines...) Expand all Loading... |
109 EXPECT_EQ(3U, stringVectorVector[1].size()); | 109 EXPECT_EQ(3U, stringVectorVector[1].size()); |
110 EXPECT_EQ("x", stringVectorVector[1][0]); | 110 EXPECT_EQ("x", stringVectorVector[1][0]); |
111 EXPECT_EQ("y", stringVectorVector[1][1]); | 111 EXPECT_EQ("y", stringVectorVector[1][1]); |
112 EXPECT_EQ("z", stringVectorVector[1][2]); | 112 EXPECT_EQ("z", stringVectorVector[1][2]); |
113 } | 113 } |
114 } | 114 } |
115 | 115 |
116 } // namespace | 116 } // namespace |
117 | 117 |
118 } // namespace blink | 118 } // namespace blink |
OLD | NEW |