| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <comutil.h> | 8 #include <comutil.h> |
| 9 #include <shellapi.h> | 9 #include <shellapi.h> |
| 10 #include <shlobj.h> | 10 #include <shlobj.h> |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "base/test/test_timeouts.h" | 22 #include "base/test/test_timeouts.h" |
| 23 #include "chrome/common/chrome_paths.h" | 23 #include "chrome/common/chrome_paths.h" |
| 24 #include "chrome/common/url_constants.h" | 24 #include "chrome/common/url_constants.h" |
| 25 #include "chrome/test/automation/automation_proxy.h" | 25 #include "chrome/test/automation/automation_proxy.h" |
| 26 #include "chrome/test/automation/browser_proxy.h" | 26 #include "chrome/test/automation/browser_proxy.h" |
| 27 #include "chrome/test/automation/tab_proxy.h" | 27 #include "chrome/test/automation/tab_proxy.h" |
| 28 #include "chrome/test/automation/window_proxy.h" | 28 #include "chrome/test/automation/window_proxy.h" |
| 29 #include "chrome/test/base/ui_test_utils.h" | 29 #include "chrome/test/base/ui_test_utils.h" |
| 30 #include "chrome/test/ui/npapi_test_helper.h" | 30 #include "chrome/test/ui/npapi_test_helper.h" |
| 31 #include "content/browser/net/url_request_mock_http_job.h" | 31 #include "content/browser/net/url_request_mock_http_job.h" |
| 32 #include "content/common/content_switches.h" |
| 32 | 33 |
| 33 using npapi_test::kTestCompleteCookie; | 34 using npapi_test::kTestCompleteCookie; |
| 34 using npapi_test::kTestCompleteSuccess; | 35 using npapi_test::kTestCompleteSuccess; |
| 35 | 36 |
| 36 static const FilePath::CharType* kTestDir = FILE_PATH_LITERAL("npapi"); | 37 namespace { |
| 37 | 38 |
| 38 namespace { | 39 const FilePath::CharType* kTestDir = FILE_PATH_LITERAL("npapi"); |
| 39 | 40 |
| 40 class NPAPIAutomationEnabledTest : public NPAPIVisiblePluginTester { | 41 class NPAPIAutomationEnabledTest : public NPAPIVisiblePluginTester { |
| 41 public: | 42 public: |
| 42 NPAPIAutomationEnabledTest() { | 43 NPAPIAutomationEnabledTest() { |
| 43 dom_automation_enabled_ = true; | 44 dom_automation_enabled_ = true; |
| 44 } | 45 } |
| 45 }; | 46 }; |
| 46 | 47 |
| 47 } | 48 } |
| 48 | 49 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 TEST_F(NPAPIVisiblePluginTester, SelfDeletePluginInNewStream) { | 153 TEST_F(NPAPIVisiblePluginTester, SelfDeletePluginInNewStream) { |
| 153 show_window_ = true; | 154 show_window_ = true; |
| 154 const FilePath test_case(FILE_PATH_LITERAL("self_delete_plugin_stream.html")); | 155 const FilePath test_case(FILE_PATH_LITERAL("self_delete_plugin_stream.html")); |
| 155 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); | 156 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); |
| 156 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); | 157 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); |
| 157 WaitForFinish("self_delete_plugin_stream", "1", url, | 158 WaitForFinish("self_delete_plugin_stream", "1", url, |
| 158 kTestCompleteCookie, kTestCompleteSuccess, | 159 kTestCompleteCookie, kTestCompleteSuccess, |
| 159 TestTimeouts::action_max_timeout_ms()); | 160 TestTimeouts::action_max_timeout_ms()); |
| 160 } | 161 } |
| 161 | 162 |
| 163 TEST_F(NPAPIVisiblePluginTester, DeletePluginInDeallocate) { |
| 164 show_window_ = true; |
| 165 const FilePath test_case( |
| 166 FILE_PATH_LITERAL("plugin_delete_in_deallocate.html")); |
| 167 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); |
| 168 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); |
| 169 WaitForFinish("delete_plugin_in_deallocate_test", "signaller", url, |
| 170 kTestCompleteCookie, kTestCompleteSuccess, |
| 171 TestTimeouts::action_max_timeout_ms()); |
| 172 } |
| 173 |
| 162 #if defined(OS_WIN) | 174 #if defined(OS_WIN) |
| 163 // Tests if a plugin has a non zero window rect. | 175 // Tests if a plugin has a non zero window rect. |
| 164 TEST_F(NPAPIVisiblePluginTester, VerifyPluginWindowRect) { | 176 TEST_F(NPAPIVisiblePluginTester, VerifyPluginWindowRect) { |
| 165 show_window_ = true; | 177 show_window_ = true; |
| 166 const FilePath test_case(FILE_PATH_LITERAL("verify_plugin_window_rect.html")); | 178 const FilePath test_case(FILE_PATH_LITERAL("verify_plugin_window_rect.html")); |
| 167 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); | 179 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); |
| 168 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); | 180 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); |
| 169 WaitForFinish("checkwindowrect", "1", url, kTestCompleteCookie, | 181 WaitForFinish("checkwindowrect", "1", url, kTestCompleteCookie, |
| 170 kTestCompleteSuccess, TestTimeouts::action_max_timeout_ms()); | 182 kTestCompleteSuccess, TestTimeouts::action_max_timeout_ms()); |
| 171 } | 183 } |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 ASSERT_TRUE(tab->LoadBlockedPlugins()); | 437 ASSERT_TRUE(tab->LoadBlockedPlugins()); |
| 426 | 438 |
| 427 WaitForFinish("setup", "1", url, kTestCompleteCookie, | 439 WaitForFinish("setup", "1", url, kTestCompleteCookie, |
| 428 kTestCompleteSuccess, TestTimeouts::action_max_timeout_ms()); | 440 kTestCompleteSuccess, TestTimeouts::action_max_timeout_ms()); |
| 429 | 441 |
| 430 ASSERT_TRUE(tab->ExecuteJavaScript("window.inject()")); | 442 ASSERT_TRUE(tab->ExecuteJavaScript("window.inject()")); |
| 431 | 443 |
| 432 WaitForFinish("setup", "2", url, kTestCompleteCookie, | 444 WaitForFinish("setup", "2", url, kTestCompleteCookie, |
| 433 kTestCompleteSuccess, TestTimeouts::action_max_timeout_ms()); | 445 kTestCompleteSuccess, TestTimeouts::action_max_timeout_ms()); |
| 434 } | 446 } |
| OLD | NEW |