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 #define STRSAFE_NO_DEPRECATE | 5 #define STRSAFE_NO_DEPRECATE |
6 #include "base/string_number_conversions.h" | 6 #include "base/string_number_conversions.h" |
7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
8 #include "webkit/plugins/npapi/test/plugin_windowless_test.h" | 8 #include "webkit/plugins/npapi/test/plugin_windowless_test.h" |
9 #include "webkit/plugins/npapi/test/plugin_client.h" | 9 #include "webkit/plugins/npapi/test/plugin_client.h" |
10 | 10 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
127 } | 127 } |
128 // If this test failed, then we'd have crashed by now. | 128 // If this test failed, then we'd have crashed by now. |
129 return PluginTest::HandleEvent(event); | 129 return PluginTest::HandleEvent(event); |
130 } | 130 } |
131 | 131 |
132 NPError WindowlessPluginTest::ExecuteScript(NPNetscapeFuncs* browser, NPP id, | 132 NPError WindowlessPluginTest::ExecuteScript(NPNetscapeFuncs* browser, NPP id, |
133 const std::string& script, NPVariant* result) { | 133 const std::string& script, NPVariant* result) { |
134 std::string script_url = "javascript:"; | 134 std::string script_url = "javascript:"; |
135 script_url += script; | 135 script_url += script; |
136 | 136 |
137 NPString script_string = { script_url.c_str(), script_url.length() }; | 137 NPString script_string = { script_url.c_str(), |
agl
2012/07/25 20:32:34
ditto.
Han
2012/07/25 22:28:44
Done.
| |
138 static_cast<uint32_t>(script_url.length()) }; | |
138 NPObject *window_obj = NULL; | 139 NPObject *window_obj = NULL; |
139 browser->getvalue(id, NPNVWindowNPObject, &window_obj); | 140 browser->getvalue(id, NPNVWindowNPObject, &window_obj); |
140 | 141 |
141 NPVariant unused_result; | 142 NPVariant unused_result; |
142 if (!result) | 143 if (!result) |
143 result = &unused_result; | 144 result = &unused_result; |
144 | 145 |
145 return browser->evaluate(id, window_obj, &script_string, result); | 146 return browser->evaluate(id, window_obj, &script_string, result); |
146 } | 147 } |
147 | 148 |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
265 error_string.append(StringForPoint(flipped_window_x, flipped_window_y)); | 266 error_string.append(StringForPoint(flipped_window_x, flipped_window_y)); |
266 SetError(error_string); | 267 SetError(error_string); |
267 } | 268 } |
268 #else | 269 #else |
269 SetError("Unimplemented"); | 270 SetError("Unimplemented"); |
270 #endif | 271 #endif |
271 SignalTestCompleted(); | 272 SignalTestCompleted(); |
272 } | 273 } |
273 | 274 |
274 } // namespace NPAPIClient | 275 } // namespace NPAPIClient |
OLD | NEW |