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

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

Issue 148213016: [PPAPI] Moving pp::VarResource_Dev API into pp::Var (now stable). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 6 years, 10 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/ppb_var_unittest.cc ('k') | ppapi/shared_impl/ppb_var_shared.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 "base/memory/ref_counted.h" 5 #include "base/memory/ref_counted.h"
6 #include "base/message_loop/message_loop.h" 6 #include "base/message_loop/message_loop.h"
7 #include "ppapi/c/pp_errors.h" 7 #include "ppapi/c/pp_errors.h"
8 #include "ppapi/c/ppb_var.h" 8 #include "ppapi/c/ppb_var.h"
9 #include "ppapi/c/ppb_websocket.h" 9 #include "ppapi/c/ppb_websocket.h"
10 #include "ppapi/proxy/locking_resource_releaser.h" 10 #include "ppapi/proxy/locking_resource_releaser.h"
(...skipping 28 matching lines...) Expand all
39 } 39 }
40 40
41 PP_CompletionCallback MakeCallback() { 41 PP_CompletionCallback MakeCallback() {
42 g_callback_called = false; 42 g_callback_called = false;
43 g_callback_result = PP_OK; 43 g_callback_result = PP_OK;
44 return PP_MakeCompletionCallback(Callback, NULL); 44 return PP_MakeCompletionCallback(Callback, NULL);
45 } 45 }
46 46
47 PP_Var MakeStringVar(const std::string& string) { 47 PP_Var MakeStringVar(const std::string& string) {
48 if (!ppb_var_) 48 if (!ppb_var_)
49 ppb_var_ = ppapi::PPB_Var_Shared::GetVarInterface1_1(); 49 ppb_var_ = ppapi::PPB_Var_Shared::GetVarInterface1_2();
50 return ppb_var_->VarFromUtf8(string.c_str(), string.length()); 50 return ppb_var_->VarFromUtf8(string.c_str(), string.length());
51 } 51 }
52 52
53 } // namespace 53 } // namespace
54 54
55 55
56 // Does a test of Connect(). 56 // Does a test of Connect().
57 TEST_F(WebSocketResourceTest, Connect) { 57 TEST_F(WebSocketResourceTest, Connect) {
58 const PPB_WebSocket_1_0* websocket_iface = 58 const PPB_WebSocket_1_0* websocket_iface =
59 thunk::GetPPB_WebSocket_1_0_Thunk(); 59 thunk::GetPPB_WebSocket_1_0_Thunk();
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 error_reply_params.set_result(PP_OK); 156 error_reply_params.set_result(PP_OK);
157 PluginMessageFilter::DispatchResourceReplyForTest( 157 PluginMessageFilter::DispatchResourceReplyForTest(
158 error_reply_params, PpapiPluginMsg_WebSocket_ErrorReply()); 158 error_reply_params, PpapiPluginMsg_WebSocket_ErrorReply());
159 159
160 EXPECT_EQ(PP_ERROR_FAILED, g_callback_result); 160 EXPECT_EQ(PP_ERROR_FAILED, g_callback_result);
161 EXPECT_TRUE(g_callback_called); 161 EXPECT_TRUE(g_callback_called);
162 } 162 }
163 163
164 } // namespace proxy 164 } // namespace proxy
165 } // namespace ppapi 165 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_var_unittest.cc ('k') | ppapi/shared_impl/ppb_var_shared.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698