OLD | NEW |
1 // Copyright 2008, Google Inc. | 1 // Copyright 2008, Google Inc. |
2 // All rights reserved. | 2 // All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
(...skipping 13 matching lines...) Expand all Loading... |
24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 | 29 |
30 // | 30 // |
31 // NPAPI interactive UI tests. | 31 // NPAPI interactive UI tests. |
32 // | 32 // |
33 | 33 |
34 #include "app/keyboard_codes.h" | |
35 #include "base/file_path.h" | 34 #include "base/file_path.h" |
| 35 #include "base/keyboard_codes.h" |
36 #include "chrome/browser/net/url_request_mock_http_job.h" | 36 #include "chrome/browser/net/url_request_mock_http_job.h" |
37 #include "chrome/test/automation/tab_proxy.h" | 37 #include "chrome/test/automation/tab_proxy.h" |
38 #include "chrome/test/automation/window_proxy.h" | 38 #include "chrome/test/automation/window_proxy.h" |
39 #include "chrome/test/ui/npapi_test_helper.h" | 39 #include "chrome/test/ui/npapi_test_helper.h" |
40 #include "chrome/test/ui_test_utils.h" | 40 #include "chrome/test/ui_test_utils.h" |
41 | 41 |
42 const char kTestCompleteCookie[] = "status"; | 42 const char kTestCompleteCookie[] = "status"; |
43 const char kTestCompleteSuccess[] = "OK"; | 43 const char kTestCompleteSuccess[] = "OK"; |
44 static const FilePath::CharType* kTestDir = FILE_PATH_LITERAL("npapi"); | 44 static const FilePath::CharType* kTestDir = FILE_PATH_LITERAL("npapi"); |
45 | 45 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 GURL url(URLRequestMockHTTPJob::GetMockUrl( | 88 GURL url(URLRequestMockHTTPJob::GetMockUrl( |
89 FilePath(FILE_PATH_LITERAL( | 89 FilePath(FILE_PATH_LITERAL( |
90 "npapi/plugin_url_request_404.html")))); | 90 "npapi/plugin_url_request_404.html")))); |
91 | 91 |
92 NavigateToURL(url); | 92 NavigateToURL(url); |
93 | 93 |
94 // Wait for the alert dialog and then close it. | 94 // Wait for the alert dialog and then close it. |
95 automation()->WaitForAppModalDialog(); | 95 automation()->WaitForAppModalDialog(); |
96 scoped_refptr<WindowProxy> window(automation()->GetActiveWindow()); | 96 scoped_refptr<WindowProxy> window(automation()->GetActiveWindow()); |
97 ASSERT_TRUE(window.get()); | 97 ASSERT_TRUE(window.get()); |
98 ASSERT_TRUE(window->SimulateOSKeyPress(app::VKEY_ESCAPE, 0)); | 98 ASSERT_TRUE(window->SimulateOSKeyPress(base::VKEY_ESCAPE, 0)); |
99 | 99 |
100 WaitForFinish("geturl_404_response", "1", url, kTestCompleteCookie, | 100 WaitForFinish("geturl_404_response", "1", url, kTestCompleteCookie, |
101 kTestCompleteSuccess, action_max_timeout_ms()); | 101 kTestCompleteSuccess, action_max_timeout_ms()); |
102 } | 102 } |
103 | 103 |
104 // Tests if a plugin executing a self deleting script using Invoke with | 104 // Tests if a plugin executing a self deleting script using Invoke with |
105 // a modal dialog showing works without crashing or hanging | 105 // a modal dialog showing works without crashing or hanging |
106 // Disabled, flakily exceeds timeout, http://crbug.com/46257. | 106 // Disabled, flakily exceeds timeout, http://crbug.com/46257. |
107 TEST_F(NPAPIVisiblePluginTester, DISABLED_SelfDeletePluginInvokeAlert) { | 107 TEST_F(NPAPIVisiblePluginTester, DISABLED_SelfDeletePluginInvokeAlert) { |
108 const FilePath test_case( | 108 const FilePath test_case( |
109 FILE_PATH_LITERAL("self_delete_plugin_invoke_alert.html")); | 109 FILE_PATH_LITERAL("self_delete_plugin_invoke_alert.html")); |
110 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); | 110 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); |
111 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); | 111 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); |
112 | 112 |
113 // Wait for the alert dialog and then close it. | 113 // Wait for the alert dialog and then close it. |
114 ASSERT_TRUE(automation()->WaitForAppModalDialog()); | 114 ASSERT_TRUE(automation()->WaitForAppModalDialog()); |
115 scoped_refptr<WindowProxy> window(automation()->GetActiveWindow()); | 115 scoped_refptr<WindowProxy> window(automation()->GetActiveWindow()); |
116 ASSERT_TRUE(window.get()); | 116 ASSERT_TRUE(window.get()); |
117 ASSERT_TRUE(window->SimulateOSKeyPress(app::VKEY_ESCAPE, 0)); | 117 ASSERT_TRUE(window->SimulateOSKeyPress(base::VKEY_ESCAPE, 0)); |
118 | 118 |
119 WaitForFinish("self_delete_plugin_invoke_alert", "1", url, | 119 WaitForFinish("self_delete_plugin_invoke_alert", "1", url, |
120 kTestCompleteCookie, kTestCompleteSuccess, | 120 kTestCompleteCookie, kTestCompleteSuccess, |
121 action_max_timeout_ms()); | 121 action_max_timeout_ms()); |
122 } | 122 } |
OLD | NEW |