OLD | NEW |
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/synchronization/waitable_event.h" | 5 #include "base/synchronization/waitable_event.h" |
6 #include "ipc/ipc_message_utils.h" | 6 #include "ipc/ipc_message_utils.h" |
7 #include "ppapi/c/pp_var.h" | 7 #include "ppapi/c/pp_var.h" |
8 #include "ppapi/c/ppb_core.h" | 8 #include "ppapi/c/ppb_core.h" |
9 #include "ppapi/c/ppb_fullscreen.h" | 9 #include "ppapi/c/ppb_fullscreen.h" |
10 #include "ppapi/c/ppb_url_loader.h" | 10 #include "ppapi/c/ppb_url_loader.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 expected_argn.push_back("Hello"); | 133 expected_argn.push_back("Hello"); |
134 expected_argn.push_back("world."); | 134 expected_argn.push_back("world."); |
135 expected_argv.push_back("elloHay"); | 135 expected_argv.push_back("elloHay"); |
136 expected_argv.push_back("orldway."); | 136 expected_argv.push_back("orldway."); |
137 std::vector<const char*> argn_to_pass, argv_to_pass; | 137 std::vector<const char*> argn_to_pass, argv_to_pass; |
138 CHECK(expected_argn.size() == expected_argv.size()); | 138 CHECK(expected_argn.size() == expected_argv.size()); |
139 for (size_t i = 0; i < expected_argn.size(); ++i) { | 139 for (size_t i = 0; i < expected_argn.size(); ++i) { |
140 argn_to_pass.push_back(expected_argn[i].c_str()); | 140 argn_to_pass.push_back(expected_argn[i].c_str()); |
141 argv_to_pass.push_back(expected_argv[i].c_str()); | 141 argv_to_pass.push_back(expected_argv[i].c_str()); |
142 } | 142 } |
143 uint32_t expected_argc = expected_argn.size(); | 143 uint32_t expected_argc = static_cast<uint32_t>(expected_argn.size()); |
144 bool_to_return = PP_TRUE; | 144 bool_to_return = PP_TRUE; |
145 ResetReceived(); | 145 ResetReceived(); |
146 // Tell the host resource tracker about the instance. | 146 // Tell the host resource tracker about the instance. |
147 host().resource_tracker().DidCreateInstance(expected_instance); | 147 host().resource_tracker().DidCreateInstance(expected_instance); |
148 EXPECT_EQ(bool_to_return, ppp_instance->DidCreate(expected_instance, | 148 EXPECT_EQ(bool_to_return, ppp_instance->DidCreate(expected_instance, |
149 expected_argc, | 149 expected_argc, |
150 &argn_to_pass[0], | 150 &argn_to_pass[0], |
151 &argv_to_pass[0])); | 151 &argv_to_pass[0])); |
152 EXPECT_EQ(received_instance, expected_instance); | 152 EXPECT_EQ(received_instance, expected_instance); |
153 EXPECT_EQ(received_argc, expected_argc); | 153 EXPECT_EQ(received_argc, expected_argc); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 // TODO(dmichael): Need to mock out a resource Tracker to be able to test | 188 // TODO(dmichael): Need to mock out a resource Tracker to be able to test |
189 // HandleResourceLoad. It also requires | 189 // HandleResourceLoad. It also requires |
190 // PPB_Core.AddRefResource and for PPB_URLLoader to be | 190 // PPB_Core.AddRefResource and for PPB_URLLoader to be |
191 // registered. | 191 // registered. |
192 | 192 |
193 host().resource_tracker().DidDeleteInstance(expected_instance); | 193 host().resource_tracker().DidDeleteInstance(expected_instance); |
194 } | 194 } |
195 | 195 |
196 } // namespace proxy | 196 } // namespace proxy |
197 } // namespace ppapi | 197 } // namespace ppapi |
OLD | NEW |