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

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

Issue 1159553007: Move Tuple to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « ppapi/proxy/nacl_message_scanner.cc ('k') | ppapi/proxy/ppapi_message_utils.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) 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 protected: 50 protected:
51 // Asserts that there is a unique "release object" IPC message in the test 51 // Asserts that there is a unique "release object" IPC message in the test
52 // sink. This will return the var ID from the message or -1 if none found. 52 // sink. This will return the var ID from the message or -1 if none found.
53 int32 GetObjectIDForUniqueReleaseObject() { 53 int32 GetObjectIDForUniqueReleaseObject() {
54 const IPC::Message* release_msg = sink().GetUniqueMessageMatching( 54 const IPC::Message* release_msg = sink().GetUniqueMessageMatching(
55 PpapiHostMsg_PPBVar_ReleaseObject::ID); 55 PpapiHostMsg_PPBVar_ReleaseObject::ID);
56 if (!release_msg) 56 if (!release_msg)
57 return -1; 57 return -1;
58 58
59 Tuple<int64> id; 59 base::Tuple<int64> id;
60 PpapiHostMsg_PPBVar_ReleaseObject::Read(release_msg, &id); 60 PpapiHostMsg_PPBVar_ReleaseObject::Read(release_msg, &id);
61 return get<0>(id); 61 return base::get<0>(id);
62 } 62 }
63 }; 63 };
64 64
65 TEST_F(PluginVarTrackerTest, GetHostObject) { 65 TEST_F(PluginVarTrackerTest, GetHostObject) {
66 ProxyAutoLock lock; 66 ProxyAutoLock lock;
67 PP_Var host_object = MakeObject(12345); 67 PP_Var host_object = MakeObject(12345);
68 68
69 // Round-trip through the tracker to make sure the host object comes out the 69 // Round-trip through the tracker to make sure the host object comes out the
70 // other end. 70 // other end.
71 PP_Var plugin_object = var_tracker().ReceiveObjectPassRef( 71 PP_Var plugin_object = var_tracker().ReceiveObjectPassRef(
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 239
240 // Release the plugin ref to the var. Since the instance is gone this should 240 // Release the plugin ref to the var. Since the instance is gone this should
241 // call deallocate. 241 // call deallocate.
242 object = NULL; 242 object = NULL;
243 var_tracker().ReleaseVar(plugin_var); 243 var_tracker().ReleaseVar(plugin_var);
244 EXPECT_EQ(1, deallocate_called); 244 EXPECT_EQ(1, deallocate_called);
245 } 245 }
246 246
247 } // namespace proxy 247 } // namespace proxy
248 } // namespace ppapi 248 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/nacl_message_scanner.cc ('k') | ppapi/proxy/ppapi_message_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698