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

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

Issue 1591033002: Add toV8(value, scriptState) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update in response to review comments Created 4 years, 11 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 | « third_party/WebKit/Source/bindings/core/v8/ToV8.h ('k') | no next file » | 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 "bindings/core/v8/ToV8.h" 5 #include "bindings/core/v8/ToV8.h"
6 6
7 #include "bindings/core/v8/V8Binding.h" 7 #include "bindings/core/v8/V8Binding.h"
8 #include "bindings/core/v8/V8BindingForTesting.h" 8 #include "bindings/core/v8/V8BindingForTesting.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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 doubleVector.append(4.2); 296 doubleVector.append(4.2);
297 TEST_TOV8("2.3,4.2", doubleVector); 297 TEST_TOV8("2.3,4.2", doubleVector);
298 298
299 HeapVector<bool> boolVector; 299 HeapVector<bool> boolVector;
300 boolVector.append(true); 300 boolVector.append(true);
301 boolVector.append(true); 301 boolVector.append(true);
302 boolVector.append(false); 302 boolVector.append(false);
303 TEST_TOV8("true,true,false", boolVector); 303 TEST_TOV8("true,true,false", boolVector);
304 } 304 }
305 305
306 TEST_F(ToV8Test, withScriptState)
307 {
308 ScriptValue value(m_scope.scriptState(), v8::Number::New(m_scope.isolate(), 1234.0));
309
310 v8::Local<v8::Value> actual = toV8(value, m_scope.scriptState());
311 EXPECT_FALSE(actual.IsEmpty());
312
313 double actualAsNumber = actual.As<v8::Number>()->Value();
314 EXPECT_EQ(1234.0, actualAsNumber);
315 }
316
306 } // namespace 317 } // namespace
307 318
308 } // namespace blink 319 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ToV8.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698