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

Side by Side Diff: Source/bindings/core/v8/ToV8Test.cpp

Issue 972153002: [bindings] Remove custom binding usage in SQLResultSetRowList. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@test
Patch Set: Patch for landing Created 5 years, 9 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
« no previous file with comments | « Source/bindings/core/v8/ToV8.h ('k') | Source/bindings/modules/v8/ToV8ForModules.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 doubleVector.append(4.2); 220 doubleVector.append(4.2);
221 TEST_TOV8("2.3,4.2", doubleVector); 221 TEST_TOV8("2.3,4.2", doubleVector);
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, dictionaryVector)
231 {
232 Vector<std::pair<String, int>> dictionary;
233 dictionary.append(std::make_pair("one", 1));
234 dictionary.append(std::make_pair("two", 2));
235 TEST_TOV8("[object Object]", dictionary);
236 v8::Handle<v8::Object> result = toV8(dictionary, m_scope.scriptState()->cont ext()->Global(), m_scope.isolate())->ToObject();
237 EXPECT_EQ(1, result->Get(v8String(m_scope.isolate(), "one"))->NumberValue()) ;
238 EXPECT_EQ(2, result->Get(v8String(m_scope.isolate(), "two"))->NumberValue()) ;
239 }
240
230 TEST_F(ToV8Test, heapVector) 241 TEST_F(ToV8Test, heapVector)
231 { 242 {
232 HeapVector<Member<GarbageCollectedScriptWrappable>> v; 243 HeapVector<Member<GarbageCollectedScriptWrappable>> v;
233 v.append(new GarbageCollectedScriptWrappable("hoge")); 244 v.append(new GarbageCollectedScriptWrappable("hoge"));
234 v.append(new GarbageCollectedScriptWrappable("fuga")); 245 v.append(new GarbageCollectedScriptWrappable("fuga"));
235 v.append(nullptr); 246 v.append(nullptr);
236 247
237 TEST_TOV8("hoge,fuga,", v); 248 TEST_TOV8("hoge,fuga,", v);
238 } 249 }
239 250
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 HeapVector<bool> boolVector; 296 HeapVector<bool> boolVector;
286 boolVector.append(true); 297 boolVector.append(true);
287 boolVector.append(true); 298 boolVector.append(true);
288 boolVector.append(false); 299 boolVector.append(false);
289 TEST_TOV8("true,true,false", boolVector); 300 TEST_TOV8("true,true,false", boolVector);
290 } 301 }
291 302
292 } // namespace 303 } // namespace
293 304
294 } // namespace blink 305 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/ToV8.h ('k') | Source/bindings/modules/v8/ToV8ForModules.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698