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_setup_test.h" | |
19 #include "webkit/glue/plugins/test/plugin_thread_async_call_test.h" | |
20 #include "webkit/glue/plugins/test/plugin_window_size_test.h" | |
21 #if defined(OS_WIN) | |
22 #include "webkit/glue/plugins/test/plugin_windowed_test.h" | |
23 #endif | |
24 #include "webkit/glue/plugins/test/plugin_windowless_test.h" | |
25 | |
26 namespace NPAPIClient { | |
27 | |
28 PluginTest* CreatePluginTest(const std::string& test_name, | |
29 NPP instance, | |
30 NPNetscapeFuncs* host_functions) { | |
31 PluginTest* new_test = NULL; | |
32 | |
33 if (test_name == "arguments") { | |
34 new_test = new PluginArgumentsTest(instance, host_functions); | |
35 } else if (test_name == "geturl" || test_name == "geturl_404_response" || | |
36 test_name == "geturl_fail_write" || | |
37 test_name == "plugin_referrer_test" || | |
38 test_name == "geturlredirectnotify") { | |
39 new_test = new PluginGetURLTest(instance, host_functions); | |
40 } else if (test_name == "npobject_proxy") { | |
41 new_test = new NPObjectProxyTest(instance, host_functions); | |
42 #if defined(OS_WIN) || defined(OS_MACOSX) | |
43 // TODO(port): plugin_windowless_test.*. | |
44 } else if (test_name == "execute_script_delete_in_paint" || | |
45 test_name == "execute_script_delete_in_mouse_move" || | |
46 test_name == "delete_frame_test" || | |
47 test_name == "multiple_instances_sync_calls" || | |
48 test_name == "no_hang_if_init_crashes" || | |
49 test_name == "convert_point") { | |
50 new_test = new WindowlessPluginTest(instance, host_functions); | |
51 #endif | |
52 } else if (test_name == "getjavascripturl") { | |
53 new_test = new ExecuteGetJavascriptUrlTest(instance, host_functions); | |
54 } else if (test_name == "getjavascripturl2") { | |
55 new_test = new ExecuteGetJavascriptUrl2Test(instance, host_functions); | |
56 #if defined(OS_WIN) | |
57 // TODO(port): plugin_window_size_test.*. | |
58 } else if (test_name == "checkwindowrect") { | |
59 new_test = new PluginWindowSizeTest(instance, host_functions); | |
60 #endif | |
61 } else if (test_name == "self_delete_plugin_stream") { | |
62 new_test = new DeletePluginInStreamTest(instance, host_functions); | |
63 #if defined(OS_WIN) | |
64 // TODO(port): plugin_npobject_lifetime_test.*. | |
65 } else if (test_name == "npobject_lifetime_test") { | |
66 new_test = new NPObjectLifetimeTest(instance, host_functions); | |
67 } else if (test_name == "npobject_lifetime_test_second_instance") { | |
68 new_test = new NPObjectLifetimeTestInstance2(instance, host_functions); | |
69 } else if (test_name == "new_fails") { | |
70 new_test = new NewFailsTest(instance, host_functions); | |
71 } else if (test_name == "npobject_delete_plugin_in_evaluate" || | |
72 test_name == "npobject_delete_create_plugin_in_evaluate") { | |
73 new_test = new NPObjectDeletePluginInNPN_Evaluate(instance, host_functions); | |
74 #endif | |
75 } else if (test_name == "plugin_javascript_open_popup_with_plugin") { | |
76 new_test = new ExecuteJavascriptOpenPopupWithPluginTest( | |
77 instance, host_functions); | |
78 } else if (test_name == "plugin_popup_with_plugin_target") { | |
79 new_test = new ExecuteJavascriptPopupWindowTargetPluginTest( | |
80 instance, host_functions); | |
81 } else if (test_name == "plugin_thread_async_call") { | |
82 new_test = new PluginThreadAsyncCallTest(instance, host_functions); | |
83 } else if (test_name == "private") { | |
84 new_test = new PrivateTest(instance, host_functions); | |
85 } else if (test_name == "schedule_timer") { | |
86 new_test = new ScheduleTimerTest(instance, host_functions); | |
87 #if defined(OS_WIN) | |
88 // TODO(port): plugin_windowed_test.*. | |
89 } else if (test_name == "hidden_plugin" || | |
90 test_name == "create_instance_in_paint" || | |
91 test_name == "alert_in_window_message" || | |
92 test_name == "ensure_scripting_works_in_destroy" || | |
93 test_name == "invoke_js_function_on_create") { | |
94 new_test = new WindowedPluginTest(instance, host_functions); | |
95 #endif | |
96 } else if (test_name == "setup") { | |
97 // "plugin" is the name for plugin documents. | |
98 new_test = new PluginSetupTest(instance, host_functions); | |
99 } | |
100 | |
101 return new_test; | |
102 } | |
103 | |
104 } // namespace NPAPIClient | |
OLD | NEW |