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

Unified Diff: ppapi/tests/blink_deprecated_test_plugin.cc

Issue 1813823002: Handle the case where the v8 scriptable object has a property defined with value undefined. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add doc and use v8CallBoolean instead of FromJust() Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/plugins/plugin-scriptable.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/blink_deprecated_test_plugin.cc
diff --git a/ppapi/tests/blink_deprecated_test_plugin.cc b/ppapi/tests/blink_deprecated_test_plugin.cc
index 064cc90f2dafaa013b16919825c0881a74d1943c..cda8f207469dc46e5c064e61df4ee0e2e4403651 100644
--- a/ppapi/tests/blink_deprecated_test_plugin.cc
+++ b/ppapi/tests/blink_deprecated_test_plugin.cc
@@ -49,6 +49,8 @@
// Properties:
// * plugin.testObject (read-only): a TestObject instance (see below).
//
+// * plugin.testGetUndefined (read-only): returns undefined.
+//
//
// TestObject exposes the following interface:
// Properties:
@@ -199,6 +201,9 @@ class InstanceSO : public ScriptableBase {
properties_.insert(std::make_pair(
"testObject", base::Bind(&InstanceSO::TestObjectAccessor,
base::Unretained(this))));
+ properties_.insert(std::make_pair(
+ "testGetUndefined", base::Bind(&InstanceSO::TestGetUndefinedAccessor,
+ base::Unretained(this))));
}
~InstanceSO() override {}
@@ -274,6 +279,12 @@ class InstanceSO : public ScriptableBase {
*var = test_object_;
}
+ void TestGetUndefinedAccessor(bool set, pp::Var* var) {
+ if (set)
+ return;
+ *var = pp::Var();
+ }
+
pp::VarPrivate test_object_;
pp::Var remembered_;
};
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/plugins/plugin-scriptable.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698