summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-14 23:40:32 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-14 23:40:32 +0000
commit6bc688d1136d35e7ea1ae6d47296abce9dee75b5 (patch)
treeadcd4e70c28de0c550645632824dfb10a7f59ec1
parent2314065e95af424b73ba587fccba11030d774909 (diff)
downloadchromium_src-6bc688d1136d35e7ea1ae6d47296abce9dee75b5.zip
chromium_src-6bc688d1136d35e7ea1ae6d47296abce9dee75b5.tar.gz
chromium_src-6bc688d1136d35e7ea1ae6d47296abce9dee75b5.tar.bz2
Convert the remaining plugin_tests from ui_tests to browser_tests. Also remove the remaining references to ui_tests and plugin_tests from gypi files.
BUG=121574 Review URL: https://chromiumcodereview.appspot.com/10389111 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137010 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--build/all.gyp3
-rw-r--r--chrome/browser/plugin_test.cc207
-rw-r--r--chrome/chrome_tests.gypi68
-rw-r--r--chrome/test/data/npapi/layout_test_plugin.html2
-rw-r--r--chrome/test/data/simple.html1
-rw-r--r--content/browser/plugin_browsertest.cc192
6 files changed, 157 insertions, 316 deletions
diff --git a/build/all.gyp b/build/all.gyp
index 00289020..9e28399 100644
--- a/build/all.gyp
+++ b/build/all.gyp
@@ -242,7 +242,6 @@
'chromium_builder_qa', # needed for pyauto
'../chrome/chrome.gyp:performance_browser_tests',
'../chrome/chrome.gyp:performance_ui_tests',
- '../chrome/chrome.gyp:plugin_tests',
'../chrome/chrome.gyp:sync_performance_tests',
],
}, # target_name: chromium_builder_perf
@@ -331,7 +330,6 @@
'../chrome/chrome.gyp:browser_tests',
'../chrome/chrome.gyp:performance_browser_tests',
'../chrome/chrome.gyp:performance_ui_tests',
- '../chrome/chrome.gyp:plugin_tests',
'../chrome/chrome.gyp:safe_browsing_tests',
'../chrome/chrome.gyp:sync_integration_tests',
'../chrome/chrome.gyp:unit_tests',
@@ -407,7 +405,6 @@
'../chrome/chrome.gyp:mini_installer_test',
'../chrome/chrome.gyp:performance_browser_tests',
'../chrome/chrome.gyp:performance_ui_tests',
- '../chrome/chrome.gyp:plugin_tests',
'../chrome/chrome.gyp:safe_browsing_tests',
'../chrome/chrome.gyp:sync_integration_tests',
'../chrome/chrome.gyp:unit_tests',
diff --git a/chrome/browser/plugin_test.cc b/chrome/browser/plugin_test.cc
deleted file mode 100644
index 4d1cb22..0000000
--- a/chrome/browser/plugin_test.cc
+++ /dev/null
@@ -1,207 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Tests for the top plugins to catch regressions in our plugin host code, as
-// well as in the out of process code. Currently this tests:
-// Flash
-// Real
-// QuickTime
-// Windows Media Player
-// -this includes both WMP plugins. npdsplay.dll is the older one that
-// comes with XP. np-mswmp.dll can be downloaded from Microsoft and
-// needs SP2 or Vista.
-
-#include "build/build_config.h"
-
-#if defined(OS_WIN)
-#include <windows.h>
-#include <shellapi.h>
-#include <shlobj.h>
-#include <comutil.h>
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include <memory.h>
-
-#include <string>
-
-#include "base/file_util.h"
-#include "base/path_service.h"
-#include "base/test/test_timeouts.h"
-#include "chrome/common/chrome_switches.h"
-#include "chrome/common/chrome_paths.h"
-#include "chrome/test/automation/automation_proxy.h"
-#include "chrome/test/automation/tab_proxy.h"
-#include "chrome/test/base/ui_test_utils.h"
-#include "chrome/test/ui/ui_test.h"
-#include "content/test/net/url_request_mock_http_job.h"
-#include "net/base/net_util.h"
-#include "third_party/npapi/bindings/npapi.h"
-#include "webkit/plugins/npapi/plugin_constants_win.h"
-#include "webkit/plugins/npapi/plugin_list.h"
-#include "webkit/plugins/plugin_switches.h"
-
-#if defined(OS_WIN)
-#include "base/win/registry.h"
-#endif
-
-class PluginTest : public UITest {
- public:
- // Generate the URL for testing a particular test.
- // HTML for the tests is all located in test_directory\plugin\<testcase>
- // Set |mock_http| to true to use mock HTTP server.
- static GURL GetTestUrl(const std::string& test_case,
- const std::string& query,
- bool mock_http) {
- static const FilePath::CharType kPluginPath[] = FILE_PATH_LITERAL("plugin");
- if (mock_http) {
- FilePath plugin_path = FilePath(kPluginPath).AppendASCII(test_case);
- GURL url = URLRequestMockHTTPJob::GetMockUrl(plugin_path);
- if (!query.empty()) {
- GURL::Replacements replacements;
- replacements.SetQueryStr(query);
- return url.ReplaceComponents(replacements);
- }
- return url;
- }
-
- FilePath path;
- PathService::Get(chrome::DIR_TEST_DATA, &path);
- path = path.Append(kPluginPath).AppendASCII(test_case);
- return ui_test_utils::GetFileUrlWithQuery(path, query);
- }
-
- protected:
- virtual void SetUp() {
-#if defined(OS_WIN)
- const testing::TestInfo* const test_info =
- testing::UnitTest::GetInstance()->current_test_info();
- if (strcmp(test_info->name(), "MediaPlayerNew") == 0) {
- // The installer adds our process names to the registry key below. Since
- // the installer might not have run on this machine, add it manually.
- base::win::RegKey regkey;
- if (regkey.Open(HKEY_LOCAL_MACHINE,
- L"Software\\Microsoft\\MediaPlayer\\ShimInclusionList",
- KEY_WRITE) == ERROR_SUCCESS) {
- regkey.CreateKey(L"CHROME.EXE", KEY_READ);
- }
- } else if (strcmp(test_info->name(), "MediaPlayerOld") == 0) {
- // When testing the old WMP plugin, we need to force Chrome to not load
- // the new plugin.
- launch_arguments_.AppendSwitch(switches::kUseOldWMPPlugin);
- } else if (strcmp(test_info->name(), "FlashSecurity") == 0) {
- launch_arguments_.AppendSwitchASCII(switches::kTestSandbox,
- "security_tests.dll");
- }
-#elif defined(OS_MACOSX)
- // The plugins directory isn't read by default on the Mac, so it needs to be
- // explicitly registered.
- launch_arguments_.AppendSwitchPath(
- switches::kExtraPluginDir, browser_directory_.AppendASCII("plugins"));
-#endif // defined(OS_WIN)
-
- launch_arguments_.AppendSwitch(switches::kAllowOutdatedPlugins);
- launch_arguments_.AppendSwitch(switches::kAlwaysAuthorizePlugins);
-
- UITest::SetUp();
- }
-
- void TestPlugin(const std::string& test_case,
- const std::string& query,
- int timeout,
- bool mock_http) {
- GURL url = GetTestUrl(test_case, query, mock_http);
- NavigateToURL(url);
- WaitForFinish(timeout, mock_http);
- }
-
- // Waits for the test case to finish.
- void WaitForFinish(const int wait_time, bool mock_http) {
- static const char kTestCompleteCookie[] = "status";
- static const char kTestCompleteSuccess[] = "OK";
-
- GURL url = GetTestUrl("done", "", mock_http);
- scoped_refptr<TabProxy> tab(GetActiveTab());
-
- const std::string result =
- WaitUntilCookieNonEmpty(tab, url, kTestCompleteCookie, wait_time);
- ASSERT_EQ(kTestCompleteSuccess, result);
- }
-};
-
-TEST_F(PluginTest, Flash) {
- // Note: This does not work with the npwrapper on 64-bit Linux. Install the
- // native 64-bit Flash to run the test.
- // TODO(thestig) Update this list if we decide to only test against internal
- // Flash plugin in the future?
- std::string kFlashQuery =
-#if defined(OS_WIN)
- "npswf32.dll"
-#elif defined(OS_MACOSX)
- "Flash Player.plugin"
-#elif defined(OS_POSIX)
- "libflashplayer.so"
-#endif
- "";
- TestPlugin("flash.html", kFlashQuery,
- TestTimeouts::action_max_timeout_ms(), false);
-}
-
-#if defined(OS_WIN)
-// Windows only test
-TEST_F(PluginTest, DISABLED_FlashSecurity) {
- TestPlugin("flash.html", "", TestTimeouts::action_max_timeout_ms(), false);
-}
-#endif // defined(OS_WIN)
-
-#if defined(OS_WIN)
-// TODO(port) Port the following tests to platforms that have the required
-// plugins.
-// Flaky: http://crbug.com/55915
-TEST_F(PluginTest, DISABLED_Quicktime) {
- TestPlugin("quicktime.html", "",
- TestTimeouts::action_max_timeout_ms(), false);
-}
-
-// Disabled - http://crbug.com/44662
-TEST_F(PluginTest, DISABLED_MediaPlayerNew) {
- TestPlugin("wmp_new.html", "", TestTimeouts::action_max_timeout_ms(), false);
-}
-
-// http://crbug.com/4809
-TEST_F(PluginTest, DISABLED_MediaPlayerOld) {
- TestPlugin("wmp_old.html", "", TestTimeouts::action_max_timeout_ms(), false);
-}
-
-// Disabled - http://crbug.com/44673
-TEST_F(PluginTest, DISABLED_Real) {
- TestPlugin("real.html", "", TestTimeouts::action_max_timeout_ms(), false);
-}
-
-TEST_F(PluginTest, FlashOctetStream) {
- TestPlugin("flash-octet-stream.html", "",
- TestTimeouts::action_max_timeout_ms(), false);
-}
-
-#if defined(OS_WIN)
-// http://crbug.com/53926
-TEST_F(PluginTest, DISABLED_FlashLayoutWhilePainting) {
-#else
-TEST_F(PluginTest, FlashLayoutWhilePainting) {
-#endif
- TestPlugin("flash-layout-while-painting.html", "",
- TestTimeouts::action_max_timeout_ms(), true);
-}
-
-// http://crbug.com/8690
-TEST_F(PluginTest, DISABLED_Java) {
- TestPlugin("Java.html", "", TestTimeouts::action_max_timeout_ms(), false);
-}
-
-TEST_F(PluginTest, Silverlight) {
- TestPlugin("silverlight.html", "",
- TestTimeouts::action_max_timeout_ms(), false);
-}
-#endif // defined(OS_WIN)
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index e2506e0..a0f5489 100644
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -685,34 +685,6 @@
}], # OS != "win"
], # conditions
},
- # TODO(jam): delete ui_tests target once no tests use this.
- {
- 'target_name': 'ui_tests',
- 'type': 'executable',
- 'dependencies': [
- '../testing/gtest.gyp:gtest',
- '../base/base.gyp:test_support_base',
- ],
- 'include_dirs': [
- '..',
- ],
- 'sources': [
- '../jingle/run_all_unittests.cc',
- ],
- 'conditions': [
- ['OS=="win"', {
- 'configurations': {
- 'Debug_Base': {
- 'msvs_settings': {
- 'VCLinkerTool': {
- 'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
- },
- },
- },
- },
- }],
- ],
- },
{
# Third-party support sources for chromedriver_lib.
'target_name': 'chromedriver_support',
@@ -2988,7 +2960,7 @@
'test/data/webui/print_preview.cc',
'test/data/webui/print_preview.h',
'test/data/webui/print_preview.js',
- 'test/data/webui/suidsandbox_browsertest.js',
+ 'test/data/webui/suidsandbox_browsertest.js',
'test/gpu/gpu_feature_browsertest.cc',
'test/security_tests/sandbox_browsertest.cc',
'test/ui/ppapi_uitest.cc',
@@ -4183,44 +4155,6 @@
'test/gpu/gpu_pixel_browsertest.cc',
],
},
- {
- 'target_name': 'plugin_tests',
- 'type': 'executable',
- 'dependencies': [
- 'chrome',
- 'chrome_resources.gyp:chrome_resources',
- 'chrome_resources.gyp:chrome_strings',
- 'test_support_common',
- 'test_support_ui',
- '../skia/skia.gyp:skia',
- '../testing/gtest.gyp:gtest',
- '../third_party/libxslt/libxslt.gyp:libxslt',
- '../third_party/npapi/npapi.gyp:npapi',
- ],
- 'include_dirs': [
- '..',
- ],
- 'sources': [
- 'browser/plugin_test.cc',
- ],
- 'conditions': [
- ['OS=="win"', {
- 'dependencies': [
- 'security_tests', # run time dependency
- ],
- 'conditions': [
- ['win_use_allocator_shim==1', {
- 'dependencies': [
- '<(allocator_target)',
- ],
- }],
- ],
- 'include_dirs': [
- '<(DEPTH)/third_party/wtl/include',
- ],
- },],
- ],
- },
],
'conditions': [
['OS=="mac"', {
diff --git a/chrome/test/data/npapi/layout_test_plugin.html b/chrome/test/data/npapi/layout_test_plugin.html
index d523d3c..7ee5492de 100644
--- a/chrome/test/data/npapi/layout_test_plugin.html
+++ b/chrome/test/data/npapi/layout_test_plugin.html
@@ -1,6 +1,6 @@
<html>
<head>
-<title>Layout Test Plugin Test</title>
+<title>OK</title>
</head>
<body>
<embed name="plg" type="application/x-webkit-test-netscape"></embed>
diff --git a/chrome/test/data/simple.html b/chrome/test/data/simple.html
index dfc2bc2..70db0f2 100644
--- a/chrome/test/data/simple.html
+++ b/chrome/test/data/simple.html
@@ -1,3 +1,4 @@
<html>
+<head><title>OK</title></head>
<body></body>
</html>
diff --git a/content/browser/plugin_browsertest.cc b/content/browser/plugin_browsertest.cc
index f35bbd4d9..c669b3c 100644
--- a/content/browser/plugin_browsertest.cc
+++ b/content/browser/plugin_browsertest.cc
@@ -11,6 +11,11 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_switches.h"
#include "content/test/net/url_request_mock_http_job.h"
+#include "webkit/plugins/plugin_switches.h"
+
+#if defined(OS_WIN)
+#include "base/win/registry.h"
+#endif
using content::BrowserThread;
@@ -31,7 +36,27 @@ class PluginTest : public InProcessBrowserTest {
command_line->AppendSwitchASCII(switches::kJavaScriptFlags, "--expose_gc");
// For OpenPopupWindowWithPlugin.
command_line->AppendSwitch(switches::kDisablePopupBlocking);
-#if defined(OS_MACOSX)
+#if defined(OS_WIN)
+ const testing::TestInfo* const test_info =
+ testing::UnitTest::GetInstance()->current_test_info();
+ if (strcmp(test_info->name(), "MediaPlayerNew") == 0) {
+ // The installer adds our process names to the registry key below. Since
+ // the installer might not have run on this machine, add it manually.
+ base::win::RegKey regkey;
+ if (regkey.Open(HKEY_LOCAL_MACHINE,
+ L"Software\\Microsoft\\MediaPlayer\\ShimInclusionList",
+ KEY_WRITE) == ERROR_SUCCESS) {
+ regkey.CreateKey(L"BROWSER_TESTS.EXE", KEY_READ);
+ }
+ } else if (strcmp(test_info->name(), "MediaPlayerOld") == 0) {
+ // When testing the old WMP plugin, we need to force Chrome to not load
+ // the new plugin.
+ command_line->AppendSwitch(switches::kUseOldWMPPlugin);
+ } else if (strcmp(test_info->name(), "FlashSecurity") == 0) {
+ command_line->AppendSwitchASCII(switches::kTestSandbox,
+ "security_tests.dll");
+ }
+#elif defined(OS_MACOSX)
FilePath plugin_dir;
PathService::Get(base::DIR_MODULE, &plugin_dir);
plugin_dir = plugin_dir.AppendASCII("plugins");
@@ -39,6 +64,15 @@ class PluginTest : public InProcessBrowserTest {
// explicitly registered.
command_line->AppendSwitchPath(switches::kExtraPluginDir, plugin_dir);
#endif
+
+ // TODO(jam): since these plugin tests are running under Chrome, we need to
+ // tell it to disable its security features for old plugins. Once this is
+ // running under content_browsertests, these flags won't be needed.
+ // http://crbug.com/90448
+ // switches::kAllowOutdatedPlugins
+ command_line->AppendSwitch("allow-outdated-plugins");
+ // switches::kAlwaysAuthorizePlugins
+ command_line->AppendSwitch("always-authorize-plugins");
}
virtual void SetUpOnMainThread() OVERRIDE {
@@ -47,31 +81,56 @@ class PluginTest : public InProcessBrowserTest {
BrowserThread::IO, FROM_HERE, base::Bind(&SetUrlRequestMock, path));
}
- void LoadAndWait(const GURL& url, const char* title) {
- string16 expected_title(ASCIIToUTF16(title));
+ void LoadAndWait(const GURL& url) {
+ string16 expected_title(ASCIIToUTF16("OK"));
ui_test_utils::TitleWatcher title_watcher(
browser()->GetSelectedWebContents(), expected_title);
title_watcher.AlsoWaitForTitle(ASCIIToUTF16("FAIL"));
+ title_watcher.AlsoWaitForTitle(ASCIIToUTF16("plugin_not_found"));
ui_test_utils::NavigateToURL(browser(), url);
- EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
+ string16 title = title_watcher.WaitAndGetTitle();
+ if (title == ASCIIToUTF16("plugin_not_found")) {
+ const testing::TestInfo* const test_info =
+ testing::UnitTest::GetInstance()->current_test_info();
+ LOG(INFO) << "PluginTest." << test_info->name() <<
+ " not running because plugin not installed.";
+ } else {
+ EXPECT_EQ(expected_title, title);
+ }
}
GURL GetURL(const char* filename) {
return ui_test_utils::GetTestUrl(
- FilePath().AppendASCII("npapi"), FilePath().AppendASCII(filename));
+ FilePath().AppendASCII("npapi"), FilePath().AppendASCII(filename));
}
void NavigateAway() {
GURL url = ui_test_utils::GetTestUrl(
FilePath(), FilePath().AppendASCII("simple.html"));
- LoadAndWait(url, "simple.html");
+ LoadAndWait(url);
+ }
+
+ void TestPlugin(const char* filename) {
+ FilePath path = ui_test_utils::GetTestFilePath(
+ FilePath().AppendASCII("plugin"), FilePath().AppendASCII(filename));
+ if (!file_util::PathExists(path)) {
+ const testing::TestInfo* const test_info =
+ testing::UnitTest::GetInstance()->current_test_info();
+ LOG(INFO) << "PluginTest." << test_info->name() <<
+ " not running because test data wasn't found.";
+ return;
+ }
+
+ GURL url = ui_test_utils::GetTestUrl(
+ FilePath().AppendASCII("plugin"), FilePath().AppendASCII(filename));
+ LoadAndWait(url);
}
};
// Make sure that navigating away from a plugin referenced by JS doesn't
// crash.
IN_PROC_BROWSER_TEST_F(PluginTest, UnloadNoCrash) {
- LoadAndWait(GetURL("layout_test_plugin.html"), "Layout Test Plugin Test");
+ LoadAndWait(GetURL("layout_test_plugin.html"));
NavigateAway();
}
@@ -79,14 +138,14 @@ IN_PROC_BROWSER_TEST_F(PluginTest, UnloadNoCrash) {
// works without crashing or hanging
// Flaky: http://crbug.com/59327
IN_PROC_BROWSER_TEST_F(PluginTest, SelfDeletePluginGetUrl) {
- LoadAndWait(GetURL("self_delete_plugin_geturl.html"), "OK");
+ LoadAndWait(GetURL("self_delete_plugin_geturl.html"));
}
// Tests if a plugin executing a self deleting script using Invoke
// works without crashing or hanging
// Flaky. See http://crbug.com/30702
IN_PROC_BROWSER_TEST_F(PluginTest, SelfDeletePluginInvoke) {
- LoadAndWait(GetURL("self_delete_plugin_invoke.html"), "OK");
+ LoadAndWait(GetURL("self_delete_plugin_invoke.html"));
}
IN_PROC_BROWSER_TEST_F(PluginTest, NPObjectReleasedOnDestruction) {
@@ -100,7 +159,7 @@ IN_PROC_BROWSER_TEST_F(PluginTest, NPObjectReleasedOnDestruction) {
// the more interesting case is out of process, where we must route
// the exception to the correct renderer.
IN_PROC_BROWSER_TEST_F(PluginTest, NPObjectSetException) {
- LoadAndWait(GetURL("npobject_set_exception.html"), "OK");
+ LoadAndWait(GetURL("npobject_set_exception.html"));
}
#if defined(OS_WIN)
@@ -128,7 +187,7 @@ IN_PROC_BROWSER_TEST_F(PluginTest, GetURLRequest404Response) {
GURL url(URLRequestMockHTTPJob::GetMockUrl(
FilePath().AppendASCII("npapi").
AppendASCII("plugin_url_request_404.html")));
- LoadAndWait(url, "OK");
+ LoadAndWait(url);
}
// Tests if a plugin executing a self deleting script using Invoke with
@@ -153,47 +212,47 @@ IN_PROC_BROWSER_TEST_F(PluginTest, SelfDeletePluginInvokeAlert) {
// Test passing arguments to a plugin.
IN_PROC_BROWSER_TEST_F(PluginTest, Arguments) {
- LoadAndWait(GetURL("arguments.html"), "OK");
+ LoadAndWait(GetURL("arguments.html"));
}
// Test invoking many plugins within a single page.
IN_PROC_BROWSER_TEST_F(PluginTest, ManyPlugins) {
- LoadAndWait(GetURL("many_plugins.html"), "OK");
+ LoadAndWait(GetURL("many_plugins.html"));
}
// Test various calls to GetURL from a plugin.
IN_PROC_BROWSER_TEST_F(PluginTest, GetURL) {
- LoadAndWait(GetURL("geturl.html"), "OK");
+ LoadAndWait(GetURL("geturl.html"));
}
// Test various calls to GetURL for javascript URLs with
// non NULL targets from a plugin.
IN_PROC_BROWSER_TEST_F(PluginTest, GetJavaScriptURL) {
- LoadAndWait(GetURL("get_javascript_url.html"), "OK");
+ LoadAndWait(GetURL("get_javascript_url.html"));
}
// Test that calling GetURL with a javascript URL and target=_self
// works properly when the plugin is embedded in a subframe.
IN_PROC_BROWSER_TEST_F(PluginTest, GetJavaScriptURL2) {
- LoadAndWait(GetURL("get_javascript_url2.html"), "OK");
+ LoadAndWait(GetURL("get_javascript_url2.html"));
}
// Test is flaky on linux/cros/win builders. http://crbug.com/71904
IN_PROC_BROWSER_TEST_F(PluginTest, GetURLRedirectNotification) {
- LoadAndWait(GetURL("geturl_redirect_notify.html"), "OK");
+ LoadAndWait(GetURL("geturl_redirect_notify.html"));
}
// Tests that identity is preserved for NPObjects passed from a plugin
// into JavaScript.
IN_PROC_BROWSER_TEST_F(PluginTest, NPObjectIdentity) {
- LoadAndWait(GetURL("npobject_identity.html"), "OK");
+ LoadAndWait(GetURL("npobject_identity.html"));
}
// Tests that if an NPObject is proxies back to its original process, the
// original pointer is returned and not a proxy. If this fails the plugin
// will crash.
IN_PROC_BROWSER_TEST_F(PluginTest, NPObjectProxy) {
- LoadAndWait(GetURL("npobject_proxy.html"), "OK");
+ LoadAndWait(GetURL("npobject_proxy.html"));
}
#if defined(OS_WIN) || defined(OS_MACOSX)
@@ -201,32 +260,32 @@ IN_PROC_BROWSER_TEST_F(PluginTest, NPObjectProxy) {
// a synchronous paint event works correctly
// http://crbug.com/44960
IN_PROC_BROWSER_TEST_F(PluginTest, SelfDeletePluginInvokeInSynchronousPaint) {
- LoadAndWait(GetURL("execute_script_delete_in_paint.html"), "OK");
+ LoadAndWait(GetURL("execute_script_delete_in_paint.html"));
}
#endif
IN_PROC_BROWSER_TEST_F(PluginTest, SelfDeletePluginInNewStream) {
- LoadAndWait(GetURL("self_delete_plugin_stream.html"), "OK");
+ LoadAndWait(GetURL("self_delete_plugin_stream.html"));
}
// This test asserts on Mac in plugin_host in the NPNVWindowNPObject case.
#if !(defined(OS_MACOSX) && !defined(NDEBUG))
// If this test flakes use http://crbug.com/95558.
IN_PROC_BROWSER_TEST_F(PluginTest, DeletePluginInDeallocate) {
- LoadAndWait(GetURL("plugin_delete_in_deallocate.html"), "OK");
+ LoadAndWait(GetURL("plugin_delete_in_deallocate.html"));
}
#endif
#if defined(OS_WIN)
IN_PROC_BROWSER_TEST_F(PluginTest, VerifyPluginWindowRect) {
- LoadAndWait(GetURL("verify_plugin_window_rect.html"), "OK");
+ LoadAndWait(GetURL("verify_plugin_window_rect.html"));
}
// Tests that creating a new instance of a plugin while another one is handling
// a paint message doesn't cause deadlock.
IN_PROC_BROWSER_TEST_F(PluginTest, CreateInstanceInPaint) {
- LoadAndWait(GetURL("create_instance_in_paint.html"), "OK");
+ LoadAndWait(GetURL("create_instance_in_paint.html"));
}
// Tests that putting up an alert in response to a paint doesn't deadlock.
@@ -239,20 +298,20 @@ IN_PROC_BROWSER_TEST_F(PluginTest, AlertInWindowMessage) {
}
IN_PROC_BROWSER_TEST_F(PluginTest, VerifyNPObjectLifetimeTest) {
- LoadAndWait(GetURL("npobject_lifetime_test.html"), "OK");
+ LoadAndWait(GetURL("npobject_lifetime_test.html"));
}
// Tests that we don't crash or assert if NPP_New fails
IN_PROC_BROWSER_TEST_F(PluginTest, NewFails) {
- LoadAndWait(GetURL("new_fails.html"), "OK");
+ LoadAndWait(GetURL("new_fails.html"));
}
IN_PROC_BROWSER_TEST_F(PluginTest, SelfDeletePluginInNPNEvaluate) {
- LoadAndWait(GetURL("execute_script_delete_in_npn_evaluate.html"), "OK");
+ LoadAndWait(GetURL("execute_script_delete_in_npn_evaluate.html"));
}
IN_PROC_BROWSER_TEST_F(PluginTest, SelfDeleteCreatePluginInNPNEvaluate) {
- LoadAndWait(GetURL("npn_plugin_delete_create_in_evaluate.html"), "OK");
+ LoadAndWait(GetURL("npn_plugin_delete_create_in_evaluate.html"));
}
#endif // OS_WIN
@@ -263,34 +322,34 @@ IN_PROC_BROWSER_TEST_F(PluginTest, SelfDeleteCreatePluginInNPNEvaluate) {
// Disabled on Mac because the plugin side isn't implemented yet, see
// "TODO(port)" in plugin_javascript_open_popup.cc.
IN_PROC_BROWSER_TEST_F(PluginTest, OpenPopupWindowWithPlugin) {
- LoadAndWait(GetURL("get_javascript_open_popup_with_plugin.html"), "OK");
+ LoadAndWait(GetURL("get_javascript_open_popup_with_plugin.html"));
}
#endif
// Test checking the privacy mode is off.
IN_PROC_BROWSER_TEST_F(PluginTest, PrivateDisabled) {
- LoadAndWait(GetURL("private.html"), "OK");
+ LoadAndWait(GetURL("private.html"));
}
IN_PROC_BROWSER_TEST_F(PluginTest, ScheduleTimer) {
- LoadAndWait(GetURL("schedule_timer.html"), "OK");
+ LoadAndWait(GetURL("schedule_timer.html"));
}
IN_PROC_BROWSER_TEST_F(PluginTest, PluginThreadAsyncCall) {
- LoadAndWait(GetURL("plugin_thread_async_call.html"), "OK");
+ LoadAndWait(GetURL("plugin_thread_async_call.html"));
}
// Test checking the privacy mode is on.
// If this flakes on Linux, use http://crbug.com/104380
IN_PROC_BROWSER_TEST_F(PluginTest, PrivateEnabled) {
- LoadAndWait(GetURL("private.html"), "OK");
+ LoadAndWait(GetURL("private.html"));
}
#if defined(OS_WIN) || defined(OS_MACOSX)
// Test a browser hang due to special case of multiple
// plugin instances indulged in sync calls across renderer.
IN_PROC_BROWSER_TEST_F(PluginTest, MultipleInstancesSyncCalls) {
- LoadAndWait(GetURL("multiple_instances_sync_calls.html"), "OK");
+ LoadAndWait(GetURL("multiple_instances_sync_calls.html"));
}
#endif
@@ -298,12 +357,12 @@ IN_PROC_BROWSER_TEST_F(PluginTest, GetURLRequestFailWrite) {
GURL url(URLRequestMockHTTPJob::GetMockUrl(
FilePath().AppendASCII("npapi").
AppendASCII("plugin_url_request_fail_write.html")));
- LoadAndWait(url, "OK");
+ LoadAndWait(url);
}
#if defined(OS_WIN)
IN_PROC_BROWSER_TEST_F(PluginTest, EnsureScriptingWorksInDestroy) {
- LoadAndWait(GetURL("ensure_scripting_works_in_destroy.html"), "OK");
+ LoadAndWait(GetURL("ensure_scripting_works_in_destroy.html"));
}
// This test uses a Windows Event to signal to the plugin that it should crash
@@ -311,7 +370,7 @@ IN_PROC_BROWSER_TEST_F(PluginTest, EnsureScriptingWorksInDestroy) {
IN_PROC_BROWSER_TEST_F(PluginTest, NoHangIfInitCrashes) {
HANDLE crash_event = CreateEvent(NULL, TRUE, FALSE, L"TestPluginCrashOnInit");
SetEvent(crash_event);
- LoadAndWait(GetURL("no_hang_if_init_crashes.html"), "OK");
+ LoadAndWait(GetURL("no_hang_if_init_crashes.html"));
CloseHandle(crash_event);
}
#endif
@@ -321,7 +380,7 @@ IN_PROC_BROWSER_TEST_F(PluginTest, PluginReferrerTest) {
GURL url(URLRequestMockHTTPJob::GetMockUrl(
FilePath().AppendASCII("npapi").
AppendASCII("plugin_url_request_referrer_test.html")));
- LoadAndWait(url, "OK");
+ LoadAndWait(url);
}
#if defined(OS_MACOSX)
@@ -344,3 +403,60 @@ IN_PROC_BROWSER_TEST_F(PluginTest, PluginConvertPointTest) {
EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
}
#endif
+
+IN_PROC_BROWSER_TEST_F(PluginTest, Flash) {
+ TestPlugin("flash.html");
+}
+
+#if defined(OS_WIN)
+// Windows only test
+IN_PROC_BROWSER_TEST_F(PluginTest, DISABLED_FlashSecurity) {
+ TestPlugin("flash.html");
+}
+#endif // defined(OS_WIN)
+
+#if defined(OS_WIN)
+// TODO(port) Port the following tests to platforms that have the required
+// plugins.
+// Flaky: http://crbug.com/55915
+IN_PROC_BROWSER_TEST_F(PluginTest, DISABLED_Quicktime) {
+ TestPlugin("quicktime.html");
+}
+
+// Disabled - http://crbug.com/44662
+IN_PROC_BROWSER_TEST_F(PluginTest, DISABLED_MediaPlayerNew) {
+ TestPlugin("wmp_new.html");
+}
+
+// http://crbug.com/4809
+IN_PROC_BROWSER_TEST_F(PluginTest, DISABLED_MediaPlayerOld) {
+ TestPlugin("wmp_old.html");
+}
+
+// Disabled - http://crbug.com/44673
+IN_PROC_BROWSER_TEST_F(PluginTest, DISABLED_Real) {
+ TestPlugin("real.html");
+}
+
+IN_PROC_BROWSER_TEST_F(PluginTest, FlashOctetStream) {
+ TestPlugin("flash-octet-stream.html");
+}
+
+#if defined(OS_WIN)
+// http://crbug.com/53926
+IN_PROC_BROWSER_TEST_F(PluginTest, DISABLED_FlashLayoutWhilePainting) {
+#else
+IN_PROC_BROWSER_TEST_F(PluginTest, FlashLayoutWhilePainting) {
+#endif
+ TestPlugin("flash-layout-while-painting.html");
+}
+
+// http://crbug.com/8690
+IN_PROC_BROWSER_TEST_F(PluginTest, DISABLED_Java) {
+ TestPlugin("Java.html");
+}
+
+IN_PROC_BROWSER_TEST_F(PluginTest, Silverlight) {
+ TestPlugin("silverlight.html");
+}
+#endif // defined(OS_WIN)