| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/string_util.h" | 5 #include "base/string_util.h" |
| 6 #include "webkit/glue/plugins/test/plugin_client.h" | 6 #include "webkit/glue/plugins/test/plugin_client.h" |
| 7 #include "webkit/glue/plugins/test/plugin_arguments_test.h" | 7 #include "webkit/glue/plugins/test/plugin_arguments_test.h" |
| 8 #include "webkit/glue/plugins/test/plugin_delete_plugin_in_stream_test.h" | 8 #include "webkit/glue/plugins/test/plugin_delete_plugin_in_stream_test.h" |
| 9 #include "webkit/glue/plugins/test/plugin_execute_script_delete_test.h" | |
| 10 #include "webkit/glue/plugins/test/plugin_get_javascript_url_test.h" | 9 #include "webkit/glue/plugins/test/plugin_get_javascript_url_test.h" |
| 11 #include "webkit/glue/plugins/test/plugin_geturl_test.h" | 10 #include "webkit/glue/plugins/test/plugin_geturl_test.h" |
| 12 #include "webkit/glue/plugins/test/plugin_javascript_open_popup.h" | 11 #include "webkit/glue/plugins/test/plugin_javascript_open_popup.h" |
| 13 #include "webkit/glue/plugins/test/plugin_new_fails_test.h" | 12 #include "webkit/glue/plugins/test/plugin_new_fails_test.h" |
| 14 #include "webkit/glue/plugins/test/plugin_private_test.h" | 13 #include "webkit/glue/plugins/test/plugin_private_test.h" |
| 15 #include "webkit/glue/plugins/test/plugin_npobject_lifetime_test.h" | 14 #include "webkit/glue/plugins/test/plugin_npobject_lifetime_test.h" |
| 16 #include "webkit/glue/plugins/test/plugin_npobject_proxy_test.h" | 15 #include "webkit/glue/plugins/test/plugin_npobject_proxy_test.h" |
| 17 #include "webkit/glue/plugins/test/plugin_window_size_test.h" | 16 #include "webkit/glue/plugins/test/plugin_window_size_test.h" |
| 17 #include "webkit/glue/plugins/test/plugin_windowless_test.h" |
| 18 #include "third_party/npapi/bindings/npapi.h" | 18 #include "third_party/npapi/bindings/npapi.h" |
| 19 #include "third_party/npapi/bindings/npruntime.h" | 19 #include "third_party/npapi/bindings/npruntime.h" |
| 20 | 20 |
| 21 namespace NPAPIClient { | 21 namespace NPAPIClient { |
| 22 | 22 |
| 23 NPNetscapeFuncs* PluginClient::host_functions_; | 23 NPNetscapeFuncs* PluginClient::host_functions_; |
| 24 | 24 |
| 25 NPError PluginClient::GetEntryPoints(NPPluginFuncs* pFuncs) { | 25 NPError PluginClient::GetEntryPoints(NPPluginFuncs* pFuncs) { |
| 26 if (pFuncs == NULL) | 26 if (pFuncs == NULL) |
| 27 return NPERR_INVALID_FUNCTABLE_ERROR; | 27 return NPERR_INVALID_FUNCTABLE_ERROR; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 NPAPIClient::PluginTest *new_test = NULL; | 93 NPAPIClient::PluginTest *new_test = NULL; |
| 94 if (base::strcasecmp(argv[name_index], "arguments") == 0) { | 94 if (base::strcasecmp(argv[name_index], "arguments") == 0) { |
| 95 new_test = new NPAPIClient::PluginArgumentsTest(instance, | 95 new_test = new NPAPIClient::PluginArgumentsTest(instance, |
| 96 NPAPIClient::PluginClient::HostFunctions()); | 96 NPAPIClient::PluginClient::HostFunctions()); |
| 97 } else if (base::strcasecmp(argv[name_index], "geturl") == 0) { | 97 } else if (base::strcasecmp(argv[name_index], "geturl") == 0) { |
| 98 new_test = new NPAPIClient::PluginGetURLTest(instance, | 98 new_test = new NPAPIClient::PluginGetURLTest(instance, |
| 99 NPAPIClient::PluginClient::HostFunctions()); | 99 NPAPIClient::PluginClient::HostFunctions()); |
| 100 } else if (base::strcasecmp(argv[name_index], "npobject_proxy") == 0) { | 100 } else if (base::strcasecmp(argv[name_index], "npobject_proxy") == 0) { |
| 101 new_test = new NPAPIClient::NPObjectProxyTest(instance, | 101 new_test = new NPAPIClient::NPObjectProxyTest(instance, |
| 102 NPAPIClient::PluginClient::HostFunctions()); | 102 NPAPIClient::PluginClient::HostFunctions()); |
| 103 } else if (base::strcasecmp(argv[name_index], | 103 } else if ((base::strcasecmp(argv[name_index], |
| 104 "execute_script_delete_in_paint") == 0) { | 104 "execute_script_delete_in_paint") == 0) || |
| 105 new_test = new NPAPIClient::ExecuteScriptDeleteTest(instance, | 105 (base::strcasecmp(argv[name_index], |
| 106 "execute_script_delete_in_mouse_move") == 0)) { |
| 107 new_test = new NPAPIClient::WindowlessPluginTest(instance, |
| 106 NPAPIClient::PluginClient::HostFunctions(), argv[name_index]); | 108 NPAPIClient::PluginClient::HostFunctions(), argv[name_index]); |
| 107 windowless_plugin = true; | 109 windowless_plugin = true; |
| 108 } else if (base::strcasecmp(argv[name_index], "getjavascripturl") == 0) { | 110 } else if (base::strcasecmp(argv[name_index], "getjavascripturl") == 0) { |
| 109 new_test = new NPAPIClient::ExecuteGetJavascriptUrlTest(instance, | 111 new_test = new NPAPIClient::ExecuteGetJavascriptUrlTest(instance, |
| 110 NPAPIClient::PluginClient::HostFunctions()); | 112 NPAPIClient::PluginClient::HostFunctions()); |
| 111 } else if (base::strcasecmp(argv[name_index], "checkwindowrect") == 0) { | 113 } else if (base::strcasecmp(argv[name_index], "checkwindowrect") == 0) { |
| 112 new_test = new NPAPIClient::PluginWindowSizeTest(instance, | 114 new_test = new NPAPIClient::PluginWindowSizeTest(instance, |
| 113 NPAPIClient::PluginClient::HostFunctions()); | 115 NPAPIClient::PluginClient::HostFunctions()); |
| 114 } else if (base::strcasecmp(argv[name_index], | 116 } else if (base::strcasecmp(argv[name_index], |
| 115 "self_delete_plugin_stream") == 0) { | 117 "self_delete_plugin_stream") == 0) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 131 new_test = new NPAPIClient::NPObjectDeletePluginInNPN_Evaluate(instance, | 133 new_test = new NPAPIClient::NPObjectDeletePluginInNPN_Evaluate(instance, |
| 132 NPAPIClient::PluginClient::HostFunctions()); | 134 NPAPIClient::PluginClient::HostFunctions()); |
| 133 } else if (base::strcasecmp(argv[name_index], | 135 } else if (base::strcasecmp(argv[name_index], |
| 134 "plugin_javascript_open_popup_with_plugin") == 0) { | 136 "plugin_javascript_open_popup_with_plugin") == 0) { |
| 135 new_test = new NPAPIClient::ExecuteJavascriptOpenPopupWithPluginTest( | 137 new_test = new NPAPIClient::ExecuteJavascriptOpenPopupWithPluginTest( |
| 136 instance, NPAPIClient::PluginClient::HostFunctions()); | 138 instance, NPAPIClient::PluginClient::HostFunctions()); |
| 137 } else if (base::strcasecmp(argv[name_index], | 139 } else if (base::strcasecmp(argv[name_index], |
| 138 "plugin_popup_with_plugin_target") == 0) { | 140 "plugin_popup_with_plugin_target") == 0) { |
| 139 new_test = new NPAPIClient::ExecuteJavascriptPopupWindowTargetPluginTest( | 141 new_test = new NPAPIClient::ExecuteJavascriptPopupWindowTargetPluginTest( |
| 140 instance, NPAPIClient::PluginClient::HostFunctions()); | 142 instance, NPAPIClient::PluginClient::HostFunctions()); |
| 141 } else if (base::strcasecmp(argv[name_index], | |
| 142 "execute_script_delete_in_mouse_move") == 0) { | |
| 143 new_test = new NPAPIClient::ExecuteScriptDeleteTest(instance, | |
| 144 NPAPIClient::PluginClient::HostFunctions(), argv[name_index]); | |
| 145 windowless_plugin = true; | |
| 146 } else if (base::strcasecmp(argv[name_index], "private") == 0) { | 143 } else if (base::strcasecmp(argv[name_index], "private") == 0) { |
| 147 new_test = new NPAPIClient::PrivateTest(instance, | 144 new_test = new NPAPIClient::PrivateTest(instance, |
| 148 NPAPIClient::PluginClient::HostFunctions()); | 145 NPAPIClient::PluginClient::HostFunctions()); |
| 149 } else { | 146 } else { |
| 150 // If we don't have a test case for this, create a | 147 // If we don't have a test case for this, create a |
| 151 // generic one which basically never fails. | 148 // generic one which basically never fails. |
| 152 new_test = new NPAPIClient::PluginTest(instance, | 149 new_test = new NPAPIClient::PluginTest(instance, |
| 153 NPAPIClient::PluginClient::HostFunctions()); | 150 NPAPIClient::PluginClient::HostFunctions()); |
| 154 } | 151 } |
| 155 | 152 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 (NPAPIClient::PluginTest*)instance->pdata; | 282 (NPAPIClient::PluginTest*)instance->pdata; |
| 286 | 283 |
| 287 return plugin->HandleEvent(event); | 284 return plugin->HandleEvent(event); |
| 288 } | 285 } |
| 289 | 286 |
| 290 void* NPP_GetJavaClass(void) { | 287 void* NPP_GetJavaClass(void) { |
| 291 // XXXMB - do work here. | 288 // XXXMB - do work here. |
| 292 return NULL; | 289 return NULL; |
| 293 } | 290 } |
| 294 } // extern "C" | 291 } // extern "C" |
| OLD | NEW |