| Index: webkit/glue/plugins/test/plugin_client.cc
|
| ===================================================================
|
| --- webkit/glue/plugins/test/plugin_client.cc (revision 13823)
|
| +++ webkit/glue/plugins/test/plugin_client.cc (working copy)
|
| @@ -43,7 +43,7 @@
|
| pFuncs->urlnotify = NPP_URLNotify;
|
| pFuncs->getvalue = NPP_GetValue;
|
| pFuncs->setvalue = NPP_SetValue;
|
| - pFuncs->javaClass = reinterpret_cast<JRIGlobalRef>(NPP_GetJavaClass);
|
| + pFuncs->javaClass = static_cast<JRIGlobalRef>(NPP_GetJavaClass);
|
|
|
| return NPERR_NO_ERROR;
|
| }
|
| @@ -79,83 +79,79 @@
|
| // that against a given test and try to instantiate it.
|
|
|
| // lookup the name parameter
|
| - int name_index = 0;
|
| - for (name_index = 0; name_index < argc; name_index++)
|
| - if (base::strcasecmp(argn[name_index], "name") == 0)
|
| + std::string test_name;
|
| + for (int name_index = 0; name_index < argc; name_index++)
|
| + if (base::strcasecmp(argn[name_index], "name") == 0) {
|
| + test_name = argv[name_index];
|
| break;
|
| + }
|
|
|
| - if (name_index >= argc)
|
| + if (test_name.empty())
|
| return NPERR_GENERIC_ERROR; // no name found
|
|
|
| NPError ret = NPERR_GENERIC_ERROR;
|
| bool windowless_plugin = false;
|
| -
|
| +
|
| NPAPIClient::PluginTest *new_test = NULL;
|
| - if (base::strcasecmp(argv[name_index], "arguments") == 0) {
|
| + if (test_name == "arguments") {
|
| new_test = new NPAPIClient::PluginArgumentsTest(instance,
|
| NPAPIClient::PluginClient::HostFunctions());
|
| - } else if (base::strcasecmp(argv[name_index], "geturl") == 0) {
|
| + } else if (test_name == "geturl") {
|
| new_test = new NPAPIClient::PluginGetURLTest(instance,
|
| NPAPIClient::PluginClient::HostFunctions());
|
| - } else if (base::strcasecmp(argv[name_index], "npobject_proxy") == 0) {
|
| + } else if (test_name == "npobject_proxy") {
|
| new_test = new NPAPIClient::NPObjectProxyTest(instance,
|
| NPAPIClient::PluginClient::HostFunctions());
|
| #if defined(OS_WIN)
|
| // TODO(port): plugin_windowless_test.*.
|
| - } else if ((base::strcasecmp(argv[name_index],
|
| - "execute_script_delete_in_paint") == 0) ||
|
| - (base::strcasecmp(argv[name_index],
|
| - "execute_script_delete_in_mouse_move") == 0)) {
|
| + } else if (test_name == "execute_script_delete_in_paint" ||
|
| + test_name == "execute_script_delete_in_mouse_move" ||
|
| + test_name == "delete_frame_test") {
|
| new_test = new NPAPIClient::WindowlessPluginTest(instance,
|
| - NPAPIClient::PluginClient::HostFunctions(), argv[name_index]);
|
| + NPAPIClient::PluginClient::HostFunctions(), test_name);
|
| windowless_plugin = true;
|
| #endif
|
| - } else if (base::strcasecmp(argv[name_index], "getjavascripturl") == 0) {
|
| + } else if (test_name == "getjavascripturl") {
|
| new_test = new NPAPIClient::ExecuteGetJavascriptUrlTest(instance,
|
| NPAPIClient::PluginClient::HostFunctions());
|
| #if defined(OS_WIN)
|
| // TODO(port): plugin_window_size_test.*.
|
| - } else if (base::strcasecmp(argv[name_index], "checkwindowrect") == 0) {
|
| + } else if (test_name == "checkwindowrect") {
|
| new_test = new NPAPIClient::PluginWindowSizeTest(instance,
|
| NPAPIClient::PluginClient::HostFunctions());
|
| #endif
|
| - } else if (base::strcasecmp(argv[name_index],
|
| - "self_delete_plugin_stream") == 0) {
|
| + } else if (test_name == "self_delete_plugin_stream") {
|
| new_test = new NPAPIClient::DeletePluginInStreamTest(instance,
|
| NPAPIClient::PluginClient::HostFunctions());
|
| #if defined(OS_WIN)
|
| // TODO(port): plugin_npobject_lifetime_test.*.
|
| - } else if (base::strcasecmp(argv[name_index],
|
| - "npobject_lifetime_test") == 0) {
|
| + } else if (test_name == "npobject_lifetime_test") {
|
| new_test = new NPAPIClient::NPObjectLifetimeTest(instance,
|
| NPAPIClient::PluginClient::HostFunctions());
|
| - } else if (base::strcasecmp(argv[name_index],
|
| - "npobject_lifetime_test_second_instance") == 0) {
|
| + } else if (test_name == "npobject_lifetime_test_second_instance") {
|
| new_test = new NPAPIClient::NPObjectLifetimeTestInstance2(instance,
|
| NPAPIClient::PluginClient::HostFunctions());
|
| - } else if (base::strcasecmp(argv[name_index],
|
| - "npobject_delete_plugin_in_evaluate") == 0) {
|
| + } else if (test_name == "new_fails") {
|
| + new_test = new NPAPIClient::NewFailsTest(instance,
|
| + NPAPIClient::PluginClient::HostFunctions());
|
| + } else if (test_name == "npobject_delete_plugin_in_evaluate") {
|
| new_test = new NPAPIClient::NPObjectDeletePluginInNPN_Evaluate(instance,
|
| NPAPIClient::PluginClient::HostFunctions());
|
| #endif
|
| - } else if (base::strcasecmp(argv[name_index], "new_fails") == 0) {
|
| - new_test = new NPAPIClient::NewFailsTest(instance,
|
| - NPAPIClient::PluginClient::HostFunctions());
|
| - } else if (base::strcasecmp(argv[name_index],
|
| - "plugin_javascript_open_popup_with_plugin") == 0) {
|
| + } else if (test_name ==
|
| + "plugin_javascript_open_popup_with_plugin") {
|
| new_test = new NPAPIClient::ExecuteJavascriptOpenPopupWithPluginTest(
|
| instance, NPAPIClient::PluginClient::HostFunctions());
|
| - } else if (base::strcasecmp(argv[name_index],
|
| - "plugin_popup_with_plugin_target") == 0) {
|
| + } else if (test_name == "plugin_popup_with_plugin_target") {
|
| new_test = new NPAPIClient::ExecuteJavascriptPopupWindowTargetPluginTest(
|
| instance, NPAPIClient::PluginClient::HostFunctions());
|
| - } else if (base::strcasecmp(argv[name_index], "private") == 0) {
|
| + } else if (test_name == "private") {
|
| new_test = new NPAPIClient::PrivateTest(instance,
|
| NPAPIClient::PluginClient::HostFunctions());
|
| } else {
|
| // If we don't have a test case for this, create a
|
| // generic one which basically never fails.
|
| - LOG(WARNING) << "Unknown test name '" << argv[name_index]
|
| + LOG(WARNING) << "Unknown test name '" << test_name
|
| << "'; using default test.";
|
| new_test = new NPAPIClient::PluginTest(instance,
|
| NPAPIClient::PluginClient::HostFunctions());
|
|
|