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

Side by Side Diff: ppapi/proxy/serialized_var_unittest.cc

Issue 9034035: Make it possible to have 1 PpapiGlobals per thread. Update unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comments. Created 8 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 | Annotate | Revision Log
« no previous file with comments | « ppapi/proxy/ppp_messaging_proxy_unittest.cc ('k') | ppapi/shared_impl/ppapi_globals.h » ('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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ppapi/proxy/ppapi_proxy_test.h" 5 #include "ppapi/proxy/ppapi_proxy_test.h"
6 6
7 #include "ppapi/proxy/serialized_var.h" 7 #include "ppapi/proxy/serialized_var.h"
8 8
9 namespace ppapi { 9 namespace ppapi {
10 namespace proxy { 10 namespace proxy {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 EXPECT_EQ(kTestString, reader.GetString()); 108 EXPECT_EQ(kTestString, reader.GetString());
109 EXPECT_EQ(2, var_tracker().GetRefCountForObject(plugin_string)); 109 EXPECT_EQ(2, var_tracker().GetRefCountForObject(plugin_string));
110 EXPECT_EQ(0u, sink().message_count()); 110 EXPECT_EQ(0u, sink().message_count());
111 } 111 }
112 // The reference the string had initially should be gone, and the reference we 112 // The reference the string had initially should be gone, and the reference we
113 // passed to the host should also be gone, so the string should be removed. 113 // passed to the host should also be gone, so the string should be removed.
114 EXPECT_EQ(-1, var_tracker().GetRefCountForObject(plugin_string)); 114 EXPECT_EQ(-1, var_tracker().GetRefCountForObject(plugin_string));
115 EXPECT_EQ(0u, sink().message_count()); 115 EXPECT_EQ(0u, sink().message_count());
116 } 116 }
117 117
118 // Tests receiving an argument and passing it back out as an output parameter. 118 // Tests receiving an argument and passing it back to the browser as an output
119 // parameter.
119 TEST_F(SerializedVarTest, PluginSerializedVarOutParam) { 120 TEST_F(SerializedVarTest, PluginSerializedVarOutParam) {
120 PP_Var host_object = MakeObjectVar(0x31337); 121 PP_Var host_object = MakeObjectVar(0x31337);
121 122
122 // Start tracking this object in the plugin. 123 // Start tracking this object in the plugin.
123 PP_Var plugin_object = var_tracker().ReceiveObjectPassRef( 124 PP_Var plugin_object = var_tracker().ReceiveObjectPassRef(
124 host_object, plugin_dispatcher()); 125 host_object, plugin_dispatcher());
125 EXPECT_EQ(1, var_tracker().GetRefCountForObject(plugin_object)); 126 EXPECT_EQ(1, var_tracker().GetRefCountForObject(plugin_object));
126 127
127 { 128 {
128 SerializedVar sv; 129 SerializedVar sv;
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 } 331 }
331 332
332 // When the ReturnValue object goes out of scope, it should have sent a 333 // When the ReturnValue object goes out of scope, it should have sent a
333 // release message to the browser. 334 // release message to the browser.
334 EXPECT_EQ(-1, var_tracker().GetRefCountForObject(plugin_object)); 335 EXPECT_EQ(-1, var_tracker().GetRefCountForObject(plugin_object));
335 EXPECT_EQ(1u, sink().message_count()); 336 EXPECT_EQ(1u, sink().message_count());
336 } 337 }
337 338
338 } // namespace proxy 339 } // namespace proxy
339 } // namespace ppapi 340 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/ppp_messaging_proxy_unittest.cc ('k') | ppapi/shared_impl/ppapi_globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698