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

Unified 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: 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/core/v8/ToV8Test.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ToV8Test.cpp b/third_party/WebKit/Source/bindings/core/v8/ToV8Test.cpp
index 4f1e054e9d0c94a0a0072c819a0861801e14be15..9306a9814ef4efe5d8c0d3383d24b11736c615d8 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ToV8Test.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ToV8Test.cpp
@@ -303,6 +303,17 @@ TEST_F(ToV8Test, basicTypeHeapVectors)
TEST_TOV8("true,true,false", boolVector);
}
+TEST_F(ToV8Test, withScriptState)
+{
+ ScriptValue value(m_scope.scriptState(), v8::Number::New(m_scope.isolate(), 1234.0));
+
+ v8::Local<v8::Value> actual = toV8(value, m_scope.scriptState());
+ EXPECT_FALSE(actual.IsEmpty());
+
+ double actualAsNumber = actual.As<v8::Number>()->Value();
+ EXPECT_EQ(1234.0, actualAsNumber);
+}
+
} // namespace
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698