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

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

Issue 8826011: Remove PP_Module from parameters for PPB_Var.VarFromUtf8. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 9 years 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/ppb_var_unittest.cc ('k') | ppapi/proxy/proxy_object_var.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) 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 <cstring> 5 #include <cstring>
6 6
7 #include "base/synchronization/waitable_event.h" 7 #include "base/synchronization/waitable_event.h"
8 #include "ppapi/c/pp_var.h" 8 #include "ppapi/c/pp_var.h"
9 #include "ppapi/c/ppb_var.h" 9 #include "ppapi/c/ppb_var.h"
10 #include "ppapi/c/ppp_messaging.h" 10 #include "ppapi/c/ppp_messaging.h"
(...skipping 28 matching lines...) Expand all
39 39
40 PPP_Messaging ppp_messaging_mock = { 40 PPP_Messaging ppp_messaging_mock = {
41 &HandleMessage 41 &HandleMessage
42 }; 42 };
43 43
44 // Define a fake PPB_Var for the host side so that we can send a string var. 44 // Define a fake PPB_Var for the host side so that we can send a string var.
45 void AddRef(PP_Var /*var*/) { 45 void AddRef(PP_Var /*var*/) {
46 } 46 }
47 void Release(PP_Var /*var*/) { 47 void Release(PP_Var /*var*/) {
48 } 48 }
49 PP_Var VarFromUtf8(PP_Module /*module*/, const char* /*data*/, uint32_t len) { 49 PP_Var VarFromUtf8(const char* /*data*/, uint32_t len) {
50 return PP_MakeUndefined(); 50 return PP_MakeUndefined();
51 } 51 }
52 // No matter what id we're given, always provide kTestString and its length. 52 // No matter what id we're given, always provide kTestString and its length.
53 const std::string kTestString = "Hello world!"; 53 const std::string kTestString = "Hello world!";
54 const char* VarToUtf8(PP_Var /*var*/, uint32_t* len) { 54 const char* VarToUtf8(PP_Var /*var*/, uint32_t* len) {
55 *len = kTestString.size(); 55 *len = kTestString.size();
56 return kTestString.c_str(); 56 return kTestString.c_str();
57 } 57 }
58 58
59 PPB_Var ppb_var_mock = { 59 PPB_Var ppb_var_mock = {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 EXPECT_EQ(kTestString, received_string->value()); 133 EXPECT_EQ(kTestString, received_string->value());
134 // Now release the var, and the string should go away (because the ref 134 // Now release the var, and the string should go away (because the ref
135 // count should be one). 135 // count should be one).
136 plugin().var_tracker().ReleaseVar(received_var); 136 plugin().var_tracker().ReleaseVar(received_var);
137 EXPECT_FALSE(StringVar::FromPPVar(received_var)); 137 EXPECT_FALSE(StringVar::FromPPVar(received_var));
138 } 138 }
139 139
140 } // namespace proxy 140 } // namespace proxy
141 } // namespace ppapi 141 } // namespace ppapi
142 142
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_var_unittest.cc ('k') | ppapi/proxy/proxy_object_var.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698