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

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

Issue 11196002: Fix ppapi TwoWayTest so that it constructs a unique IPC::ChannelHandle. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 | « no previous file | ppapi/proxy/ppapi_proxy_test.cc » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ipc/ipc_test_sink.h" 5 #include "ipc/ipc_test_sink.h"
6 #include "ppapi/c/dev/ppp_class_deprecated.h" 6 #include "ppapi/c/dev/ppp_class_deprecated.h"
7 #include "ppapi/proxy/plugin_var_tracker.h" 7 #include "ppapi/proxy/plugin_var_tracker.h"
8 #include "ppapi/proxy/ppapi_messages.h" 8 #include "ppapi/proxy/ppapi_messages.h"
9 #include "ppapi/proxy/ppapi_proxy_test.h" 9 #include "ppapi/proxy/ppapi_proxy_test.h"
10 #include "ppapi/proxy/proxy_object_var.h" 10 #include "ppapi/proxy/proxy_object_var.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 EXPECT_EQ(0, 150 EXPECT_EQ(0,
151 var_tracker().GetTrackedWithNoReferenceCountForObject(plugin_var)); 151 var_tracker().GetTrackedWithNoReferenceCountForObject(plugin_var));
152 EXPECT_EQ(0u, sink().message_count()); 152 EXPECT_EQ(0u, sink().message_count());
153 153
154 // Now free via the refcount, this should delete it. 154 // Now free via the refcount, this should delete it.
155 var_tracker().ReleaseVar(plugin_var); 155 var_tracker().ReleaseVar(plugin_var);
156 EXPECT_EQ(-1, var_tracker().GetRefCountForObject(plugin_var)); 156 EXPECT_EQ(-1, var_tracker().GetRefCountForObject(plugin_var));
157 EXPECT_EQ(host_object.value.as_id, GetObjectIDForUniqueReleaseObject()); 157 EXPECT_EQ(host_object.value.as_id, GetObjectIDForUniqueReleaseObject());
158 } 158 }
159 159
160 TEST_F(PluginVarTrackerTest, DISABLED_RecursiveTrackWithNoRef) { 160 TEST_F(PluginVarTrackerTest, RecursiveTrackWithNoRef) {
161 PP_Var host_object = MakeObject(12345); 161 PP_Var host_object = MakeObject(12345);
162 162
163 // Receive a tracked object twice. 163 // Receive a tracked object twice.
164 PP_Var plugin_var = var_tracker().TrackObjectWithNoReference( 164 PP_Var plugin_var = var_tracker().TrackObjectWithNoReference(
165 host_object, plugin_dispatcher()); 165 host_object, plugin_dispatcher());
166 EXPECT_EQ(1, 166 EXPECT_EQ(1,
167 var_tracker().GetTrackedWithNoReferenceCountForObject(plugin_var)); 167 var_tracker().GetTrackedWithNoReferenceCountForObject(plugin_var));
168 PP_Var plugin_var2 = var_tracker().TrackObjectWithNoReference( 168 PP_Var plugin_var2 = var_tracker().TrackObjectWithNoReference(
169 host_object, plugin_dispatcher()); 169 host_object, plugin_dispatcher());
170 EXPECT_EQ(plugin_var.value.as_id, plugin_var2.value.as_id); 170 EXPECT_EQ(plugin_var.value.as_id, plugin_var2.value.as_id);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 236
237 // Release the plugin ref to the var. Since the instance is gone this should 237 // Release the plugin ref to the var. Since the instance is gone this should
238 // call deallocate. 238 // call deallocate.
239 object = NULL; 239 object = NULL;
240 var_tracker().ReleaseVar(plugin_var); 240 var_tracker().ReleaseVar(plugin_var);
241 EXPECT_EQ(1, deallocate_called); 241 EXPECT_EQ(1, deallocate_called);
242 } 242 }
243 243
244 } // namespace proxy 244 } // namespace proxy
245 } // namespace ppapi 245 } // namespace ppapi
OLDNEW
« no previous file with comments | « no previous file | ppapi/proxy/ppapi_proxy_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698