OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "webkit/glue/plugins/test/plugin_test_factory.h" |
| 6 |
| 7 #include "webkit/glue/plugins/test/plugin_arguments_test.h" |
| 8 #include "webkit/glue/plugins/test/plugin_delete_plugin_in_stream_test.h" |
| 9 #include "webkit/glue/plugins/test/plugin_get_javascript_url_test.h" |
| 10 #include "webkit/glue/plugins/test/plugin_get_javascript_url2_test.h" |
| 11 #include "webkit/glue/plugins/test/plugin_geturl_test.h" |
| 12 #include "webkit/glue/plugins/test/plugin_javascript_open_popup.h" |
| 13 #include "webkit/glue/plugins/test/plugin_new_fails_test.h" |
| 14 #include "webkit/glue/plugins/test/plugin_npobject_lifetime_test.h" |
| 15 #include "webkit/glue/plugins/test/plugin_npobject_proxy_test.h" |
| 16 #include "webkit/glue/plugins/test/plugin_private_test.h" |
| 17 #include "webkit/glue/plugins/test/plugin_schedule_timer_test.h" |
| 18 #include "webkit/glue/plugins/test/plugin_thread_async_call_test.h" |
| 19 #include "webkit/glue/plugins/test/plugin_window_size_test.h" |
| 20 #if defined(OS_WIN) |
| 21 #include "webkit/glue/plugins/test/plugin_windowed_test.h" |
| 22 #endif |
| 23 #include "webkit/glue/plugins/test/plugin_windowless_test.h" |
| 24 |
| 25 namespace NPAPIClient { |
| 26 |
| 27 PluginTest* CreatePluginTest(const std::string& test_name, |
| 28 NPP instance, |
| 29 NPNetscapeFuncs* host_functions) { |
| 30 PluginTest* new_test = NULL; |
| 31 |
| 32 if (test_name == "arguments") { |
| 33 new_test = new PluginArgumentsTest(instance, host_functions); |
| 34 } else if (test_name == "geturl" || test_name == "geturl_404_response" || |
| 35 test_name == "geturl_fail_write" || |
| 36 test_name == "plugin_referrer_test") { |
| 37 new_test = new PluginGetURLTest(instance, host_functions); |
| 38 } else if (test_name == "npobject_proxy") { |
| 39 new_test = new NPObjectProxyTest(instance, host_functions); |
| 40 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 41 // TODO(port): plugin_windowless_test.*. |
| 42 } else if (test_name == "execute_script_delete_in_paint" || |
| 43 test_name == "execute_script_delete_in_mouse_move" || |
| 44 test_name == "delete_frame_test" || |
| 45 test_name == "multiple_instances_sync_calls" || |
| 46 test_name == "no_hang_if_init_crashes" || |
| 47 test_name == "convert_point") { |
| 48 new_test = new WindowlessPluginTest(instance, host_functions); |
| 49 #endif |
| 50 } else if (test_name == "getjavascripturl") { |
| 51 new_test = new ExecuteGetJavascriptUrlTest(instance, host_functions); |
| 52 } else if (test_name == "getjavascripturl2") { |
| 53 new_test = new ExecuteGetJavascriptUrl2Test(instance, host_functions); |
| 54 #if defined(OS_WIN) |
| 55 // TODO(port): plugin_window_size_test.*. |
| 56 } else if (test_name == "checkwindowrect") { |
| 57 new_test = new PluginWindowSizeTest(instance, host_functions); |
| 58 #endif |
| 59 } else if (test_name == "self_delete_plugin_stream") { |
| 60 new_test = new DeletePluginInStreamTest(instance, host_functions); |
| 61 #if defined(OS_WIN) |
| 62 // TODO(port): plugin_npobject_lifetime_test.*. |
| 63 } else if (test_name == "npobject_lifetime_test") { |
| 64 new_test = new NPObjectLifetimeTest(instance, host_functions); |
| 65 } else if (test_name == "npobject_lifetime_test_second_instance") { |
| 66 new_test = new NPObjectLifetimeTestInstance2(instance, host_functions); |
| 67 } else if (test_name == "new_fails") { |
| 68 new_test = new NewFailsTest(instance, host_functions); |
| 69 } else if (test_name == "npobject_delete_plugin_in_evaluate") { |
| 70 new_test = new NPObjectDeletePluginInNPN_Evaluate(instance, host_functions); |
| 71 #endif |
| 72 } else if (test_name == "plugin_javascript_open_popup_with_plugin") { |
| 73 new_test = new ExecuteJavascriptOpenPopupWithPluginTest( |
| 74 instance, host_functions); |
| 75 } else if (test_name == "plugin_popup_with_plugin_target") { |
| 76 new_test = new ExecuteJavascriptPopupWindowTargetPluginTest( |
| 77 instance, host_functions); |
| 78 } else if (test_name == "plugin_thread_async_call") { |
| 79 new_test = new PluginThreadAsyncCallTest(instance, host_functions); |
| 80 } else if (test_name == "private") { |
| 81 new_test = new PrivateTest(instance, host_functions); |
| 82 } else if (test_name == "schedule_timer") { |
| 83 new_test = new ScheduleTimerTest(instance, host_functions); |
| 84 #if defined(OS_WIN) |
| 85 // TODO(port): plugin_windowed_test.*. |
| 86 } else if (test_name == "hidden_plugin" || |
| 87 test_name == "create_instance_in_paint" || |
| 88 test_name == "alert_in_window_message" || |
| 89 test_name == "ensure_scripting_works_in_destroy") { |
| 90 new_test = new WindowedPluginTest(instance, host_functions); |
| 91 #endif |
| 92 } |
| 93 |
| 94 return new_test; |
| 95 } |
| 96 |
| 97 } // namespace NPAPIClient |
OLD | NEW |