Index: ppapi/proxy/serialized_var_unittest.cc |
diff --git a/ppapi/proxy/serialized_var_unittest.cc b/ppapi/proxy/serialized_var_unittest.cc |
index fcde77795a37b71cf2fa5baa718b040779c420dc..94961afeb04c914c6f28718ac3bcb810bd8ac6c4 100644 |
--- a/ppapi/proxy/serialized_var_unittest.cc |
+++ b/ppapi/proxy/serialized_var_unittest.cc |
@@ -272,6 +272,18 @@ TEST_F(SerializedVarTest, PluginVectorReceiveInput) { |
EXPECT_EQ(-1, var_tracker().GetRefCountForObject(plugin_objects2[1])); |
} |
+// Tests the browser sending a String var as a return value to make sure we |
+// ref-count the host side properly. |
+typedef HostProxyTest HostSerializedVarTest; |
+TEST_F(HostSerializedVarTest, PluginReceiveStringReturn) { |
+ PP_Var string_var = StringVar::StringToPPVar("Hello"); |
+ EXPECT_EQ(1, var_tracker().GetRefCountForObject(string_var)); |
+ GetDispatcher()->serialization_rules()->BeginSendPassRef(string_var); |
+ GetDispatcher()->serialization_rules()->EndSendPassRef(string_var); |
+ // It should be gone, so we should get -1 to indicate that. |
+ EXPECT_EQ(-1, var_tracker().GetRefCountForObject(string_var)); |
raymes
2015/01/27 00:12:44
Should we test the object var case too? Or does th
|
+} |
+ |
// Tests the plugin receiving a var as a return value from the browser |
// two different times (passing ownership). |
TEST_F(SerializedVarTest, PluginReceiveReturn) { |