| 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/ToV8.h" | 6 #include "bindings/core/v8/ToV8.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/V8Binding.h" | 8 #include "bindings/core/v8/V8Binding.h" |
| 9 #include "core/testing/GarbageCollectedScriptWrappable.h" | 9 #include "core/testing/GarbageCollectedScriptWrappable.h" |
| 10 #include "core/testing/RefCountedScriptWrappable.h" | 10 #include "core/testing/RefCountedScriptWrappable.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 161 |
| 162 TEST_F(ToV8Test, scriptValue) | 162 TEST_F(ToV8Test, scriptValue) |
| 163 { | 163 { |
| 164 ScriptValue value(m_scope.scriptState(), v8::Number::New(m_scope.isolate(),
1234)); | 164 ScriptValue value(m_scope.scriptState(), v8::Number::New(m_scope.isolate(),
1234)); |
| 165 | 165 |
| 166 TEST_TOV8("1234", value); | 166 TEST_TOV8("1234", value); |
| 167 } | 167 } |
| 168 | 168 |
| 169 TEST_F(ToV8Test, vector) | 169 TEST_F(ToV8Test, vector) |
| 170 { | 170 { |
| 171 Vector<RefPtr<RefCountedScriptWrappable> > v; | 171 Vector<RefPtr<RefCountedScriptWrappable>> v; |
| 172 v.append(RefCountedScriptWrappable::create("foo")); | 172 v.append(RefCountedScriptWrappable::create("foo")); |
| 173 v.append(RefCountedScriptWrappable::create("bar")); | 173 v.append(RefCountedScriptWrappable::create("bar")); |
| 174 | 174 |
| 175 TEST_TOV8("foo,bar", v); | 175 TEST_TOV8("foo,bar", v); |
| 176 } | 176 } |
| 177 | 177 |
| 178 TEST_F(ToV8Test, stringVectors) | 178 TEST_F(ToV8Test, stringVectors) |
| 179 { | 179 { |
| 180 Vector<String> stringVector; | 180 Vector<String> stringVector; |
| 181 stringVector.append("foo"); | 181 stringVector.append("foo"); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 | 222 |
| 223 Vector<bool> boolVector; | 223 Vector<bool> boolVector; |
| 224 boolVector.append(true); | 224 boolVector.append(true); |
| 225 boolVector.append(true); | 225 boolVector.append(true); |
| 226 boolVector.append(false); | 226 boolVector.append(false); |
| 227 TEST_TOV8("true,true,false", boolVector); | 227 TEST_TOV8("true,true,false", boolVector); |
| 228 } | 228 } |
| 229 | 229 |
| 230 TEST_F(ToV8Test, heapVector) | 230 TEST_F(ToV8Test, heapVector) |
| 231 { | 231 { |
| 232 HeapVector<Member<GarbageCollectedScriptWrappable> > v; | 232 HeapVector<Member<GarbageCollectedScriptWrappable>> v; |
| 233 v.append(new GarbageCollectedScriptWrappable("hoge")); | 233 v.append(new GarbageCollectedScriptWrappable("hoge")); |
| 234 v.append(new GarbageCollectedScriptWrappable("fuga")); | 234 v.append(new GarbageCollectedScriptWrappable("fuga")); |
| 235 v.append(nullptr); | 235 v.append(nullptr); |
| 236 | 236 |
| 237 TEST_TOV8("hoge,fuga,", v); | 237 TEST_TOV8("hoge,fuga,", v); |
| 238 } | 238 } |
| 239 | 239 |
| 240 TEST_F(ToV8Test, stringHeapVectors) | 240 TEST_F(ToV8Test, stringHeapVectors) |
| 241 { | 241 { |
| 242 HeapVector<String> stringVector; | 242 HeapVector<String> stringVector; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 HeapVector<bool> boolVector; | 285 HeapVector<bool> boolVector; |
| 286 boolVector.append(true); | 286 boolVector.append(true); |
| 287 boolVector.append(true); | 287 boolVector.append(true); |
| 288 boolVector.append(false); | 288 boolVector.append(false); |
| 289 TEST_TOV8("true,true,false", boolVector); | 289 TEST_TOV8("true,true,false", boolVector); |
| 290 } | 290 } |
| 291 | 291 |
| 292 } // namespace | 292 } // namespace |
| 293 | 293 |
| 294 } // namespace blink | 294 } // namespace blink |
| OLD | NEW |