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

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

Issue 7621054: Don't use a scoped_refptr for StringVar::FromPPVar (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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_proxy.cc ('k') | ppapi/proxy/resource_creation_proxy.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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 EXPECT_EQ(expected_var.value.as_double, received_var.value.as_double); 121 EXPECT_EQ(expected_var.value.as_double, received_var.value.as_double);
122 122
123 expected_var.type = PP_VARTYPE_STRING; 123 expected_var.type = PP_VARTYPE_STRING;
124 expected_var.value.as_id = 1979; 124 expected_var.value.as_id = 1979;
125 ResetReceived(); 125 ResetReceived();
126 ppp_messaging->HandleMessage(expected_instance, expected_var); 126 ppp_messaging->HandleMessage(expected_instance, expected_var);
127 handle_message_called.Wait(); 127 handle_message_called.Wait();
128 EXPECT_EQ(expected_instance, received_instance); 128 EXPECT_EQ(expected_instance, received_instance);
129 EXPECT_EQ(expected_var.type, received_var.type); 129 EXPECT_EQ(expected_var.type, received_var.type);
130 130
131 scoped_refptr<StringVar> received_string(StringVar::FromPPVar(received_var)); 131 StringVar* received_string = StringVar::FromPPVar(received_var);
132 ASSERT_TRUE(received_string.get()); 132 ASSERT_TRUE(received_string.get());
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).get()); 137 EXPECT_FALSE(StringVar::FromPPVar(received_var).get());
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_proxy.cc ('k') | ppapi/proxy/resource_creation_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698