OLD | NEW |
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 Loading... |
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 |
OLD | NEW |