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

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

Issue 644473006: Rename 'ScalarValueString' to 'USVString' to match Web IDL (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/core/v8/V8Binding.cpp ('k') | Source/bindings/scripts/idl_types.py » ('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/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 "core/testing/GarbageCollectedScriptWrappable.h" 9 #include "core/testing/GarbageCollectedScriptWrappable.h"
10 #include "core/testing/RefCountedScriptWrappable.h" 10 #include "core/testing/RefCountedScriptWrappable.h"
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 } 341 }
342 { 342 {
343 v8::Handle<v8::Array> v8Array = v8::Array::New(m_scope.isolate(), 3); 343 v8::Handle<v8::Array> v8Array = v8::Array::New(m_scope.isolate(), 3);
344 v8Array->Set(toV8Value(0), toV8Value("Vini, vidi, vici.")); 344 v8Array->Set(toV8Value(0), toV8Value("Vini, vidi, vici."));
345 v8Array->Set(toV8Value(1), toV8Value(65535)); 345 v8Array->Set(toV8Value(1), toV8Value(65535));
346 v8Array->Set(toV8Value(2), toV8Value(0.125)); 346 v8Array->Set(toV8Value(2), toV8Value(0.125));
347 347
348 NonThrowableExceptionState exceptionState; 348 NonThrowableExceptionState exceptionState;
349 Vector<v8::Handle<v8::Value> > v8HandleVector = toImplArray<v8::Handle<v 8::Value> >(v8Array, 0, m_scope.isolate(), exceptionState); 349 Vector<v8::Handle<v8::Value> > v8HandleVector = toImplArray<v8::Handle<v 8::Value> >(v8Array, 0, m_scope.isolate(), exceptionState);
350 EXPECT_EQ(3U, v8HandleVector.size()); 350 EXPECT_EQ(3U, v8HandleVector.size());
351 EXPECT_EQ("Vini, vidi, vici.", toScalarValueString(v8HandleVector[0], ex ceptionState)); 351 EXPECT_EQ("Vini, vidi, vici.", toUSVString(v8HandleVector[0], exceptionS tate));
352 EXPECT_EQ(65535U, toUInt32(v8HandleVector[1])); 352 EXPECT_EQ(65535U, toUInt32(v8HandleVector[1]));
353 EXPECT_EQ(0.125, toFloat(v8HandleVector[2])); 353 EXPECT_EQ(0.125, toFloat(v8HandleVector[2]));
354 354
355 Vector<ScriptValue> scriptValueVector = toImplArray<ScriptValue>(v8Array , 0, m_scope.isolate(), exceptionState); 355 Vector<ScriptValue> scriptValueVector = toImplArray<ScriptValue>(v8Array , 0, m_scope.isolate(), exceptionState);
356 EXPECT_EQ(3U, scriptValueVector.size()); 356 EXPECT_EQ(3U, scriptValueVector.size());
357 String reportOnZela; 357 String reportOnZela;
358 EXPECT_TRUE(scriptValueVector[0].toString(reportOnZela)); 358 EXPECT_TRUE(scriptValueVector[0].toString(reportOnZela));
359 EXPECT_EQ("Vini, vidi, vici.", reportOnZela); 359 EXPECT_EQ("Vini, vidi, vici.", reportOnZela);
360 EXPECT_EQ(65535U, toUInt32(scriptValueVector[1].v8Value())); 360 EXPECT_EQ(65535U, toUInt32(scriptValueVector[1].v8Value()));
361 EXPECT_EQ(0.125, toFloat(scriptValueVector[2].v8Value())); 361 EXPECT_EQ(0.125, toFloat(scriptValueVector[2].v8Value()));
(...skipping 19 matching lines...) Expand all
381 EXPECT_EQ(3U, stringVectorVector[1].size()); 381 EXPECT_EQ(3U, stringVectorVector[1].size());
382 EXPECT_EQ("x", stringVectorVector[1][0]); 382 EXPECT_EQ("x", stringVectorVector[1][0]);
383 EXPECT_EQ("y", stringVectorVector[1][1]); 383 EXPECT_EQ("y", stringVectorVector[1][1]);
384 EXPECT_EQ("z", stringVectorVector[1][2]); 384 EXPECT_EQ("z", stringVectorVector[1][2]);
385 } 385 }
386 } 386 }
387 387
388 } // namespace 388 } // namespace
389 389
390 } // namespace blink 390 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/V8Binding.cpp ('k') | Source/bindings/scripts/idl_types.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698