summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjam <jam@chromium.org>2015-06-16 15:04:49 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-16 22:05:42 +0000
commita44c8609b62bb2a4a00d18abf61f9fa66a6bef56 (patch)
tree5a023e4971c17f0144daf4e878be852b3f555769 /chrome
parent4e09c29c1e240b86c942f7f67d047e398f00b6ac (diff)
downloadchromium_src-a44c8609b62bb2a4a00d18abf61f9fa66a6bef56.zip
chromium_src-a44c8609b62bb2a4a00d18abf61f9fa66a6bef56.tar.gz
chromium_src-a44c8609b62bb2a4a00d18abf61f9fa66a6bef56.tar.bz2
Delete the NPAPI plugin browsertests.
They're not needed anymore now that NPAPI plugin support is disabled. BUG=493212 Review URL: https://codereview.chromium.org/1182303010 Cr-Commit-Position: refs/heads/master@{#334711}
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/chrome_plugin_interactive_test.cc234
-rw-r--r--chrome/browser/content_settings/content_settings_browsertest.cc237
-rw-r--r--chrome/browser/ui/views/location_bar/star_view_browsertest.cc95
-rw-r--r--chrome/browser_tests.isolate1
-rw-r--r--chrome/chrome_tests.gypi8
-rw-r--r--chrome/interactive_ui_tests.isolate1
-rw-r--r--chrome/test/BUILD.gn6
-rw-r--r--chrome/test/data/load_all_blocked_plugins.html24
-rw-r--r--chrome/test/data/load_npapi_plugin.html31
-rw-r--r--chrome/test/data/plugin_delete_self_at_load.html18
-rw-r--r--chrome/test/data/printing/npapi_plugin.html18
-rw-r--r--chrome/test/data/windowed_npapi_plugin.html23
12 files changed, 0 insertions, 696 deletions
diff --git a/chrome/browser/chrome_plugin_interactive_test.cc b/chrome/browser/chrome_plugin_interactive_test.cc
deleted file mode 100644
index 5734730..0000000
--- a/chrome/browser/chrome_plugin_interactive_test.cc
+++ /dev/null
@@ -1,234 +0,0 @@
-// Copyright 2014 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.
-
-#include "base/files/file_util.h"
-#include "base/memory/ref_counted.h"
-#include "base/prefs/pref_service.h"
-#include "base/strings/utf_string_conversions.h"
-#include "chrome/app/chrome_command_ids.h"
-#include "chrome/browser/plugins/plugin_prefs.h"
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_commands.h"
-#include "chrome/browser/ui/find_bar/find_bar.h"
-#include "chrome/browser/ui/find_bar/find_bar_controller.h"
-#include "chrome/browser/ui/find_bar/find_bar_host_unittest_util.h"
-#include "chrome/browser/ui/tabs/tab_strip_model.h"
-#include "chrome/common/pref_names.h"
-#include "chrome/test/base/in_process_browser_test.h"
-#include "chrome/test/base/ui_test_utils.h"
-#include "content/public/browser/browser_thread.h"
-#include "content/public/browser/child_process_data.h"
-#include "content/public/browser/plugin_service.h"
-#include "content/public/browser/web_contents.h"
-#include "content/public/common/content_constants.h"
-#include "content/public/common/content_paths.h"
-#include "content/public/common/process_type.h"
-#include "content/public/common/webplugininfo.h"
-#include "content/public/test/browser_test_utils.h"
-#include "content/public/test/test_navigation_observer.h"
-#include "content/public/test/test_utils.h"
-
-#if defined(OS_WIN)
-#include "ui/aura/window.h"
-#include "ui/aura/window_tree_host.h"
-#endif
-
-#if defined(OS_WIN)
-
-namespace {
-
-BOOL CALLBACK EnumerateChildren(HWND hwnd, LPARAM l_param) {
- HWND* child = reinterpret_cast<HWND*>(l_param);
- *child = hwnd;
- // The first child window is the plugin, then its children. So stop
- // enumerating after the first callback.
- return FALSE;
-}
-
-} // namespace
-
-typedef InProcessBrowserTest ChromePluginTest;
-
-// Test that if a background tab loads an NPAPI plugin, they are displayed after
-// switching to that page. http://crbug.com/335900
-// flaky: http://crbug.com/406631
-IN_PROC_BROWSER_TEST_F(ChromePluginTest, DISABLED_WindowedNPAPIPluginHidden) {
- browser()->profile()->GetPrefs()->SetBoolean(prefs::kPluginsAlwaysAuthorize,
- true);
-
- // First load the page in the background and wait for the NPAPI plugin's
- // window to be created.
- GURL url = ui_test_utils::GetTestUrl(
- base::FilePath(),
- base::FilePath().AppendASCII("windowed_npapi_plugin.html"));
-
- ui_test_utils::NavigateToURLWithDisposition(
- browser(), url, NEW_BACKGROUND_TAB,
- ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION);
-
- // We create a third window just to trigger the second one to update its
- // constrained window list. Normally this would be triggered by the status bar
- // animation closing after the user middle clicked a link.
- ui_test_utils::NavigateToURLWithDisposition(
- browser(), GURL("about:blank"), NEW_BACKGROUND_TAB,
- ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB);
-
- base::string16 expected_title(base::ASCIIToUTF16("created"));
- content::WebContents* tab =
- browser()->tab_strip_model()->GetWebContentsAt(1);
- if (tab->GetTitle() != expected_title) {
- content::TitleWatcher title_watcher(tab, expected_title);
- EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
- }
-
- // Now activate the tab and verify that the plugin painted.
- browser()->tab_strip_model()->ActivateTabAt(1, true);
-
- base::string16 expected_title2(base::ASCIIToUTF16("shown"));
- content::TitleWatcher title_watcher2(tab, expected_title2);
- EXPECT_EQ(expected_title2, title_watcher2.WaitAndGetTitle());
-
- HWND child = NULL;
- HWND hwnd = tab->GetNativeView()->GetHost()->GetAcceleratedWidget();
- EnumChildWindows(hwnd, EnumerateChildren,reinterpret_cast<LPARAM>(&child));
-
- RECT region;
- int result = GetWindowRgnBox(child, &region);
- ASSERT_NE(result, NULLREGION);
-}
-
-typedef InProcessBrowserTest PrintPreviewTest;
-
-// This test verifies that constrained windows aren't covered by windowed NPAPI
-// plugins. The code which fixes this is in WebContentsViewAura::WindowObserver.
-// flaky: http://crbug.com/406631
-IN_PROC_BROWSER_TEST_F(PrintPreviewTest, DISABLED_WindowedNPAPIPluginHidden) {
- browser()->profile()->GetPrefs()->SetBoolean(prefs::kPluginsAlwaysAuthorize,
- true);
-
- // First load the page and wait for the NPAPI plugin's window to display.
- base::string16 expected_title(base::ASCIIToUTF16("ready"));
- content::WebContents* tab =
- browser()->tab_strip_model()->GetActiveWebContents();
- content::TitleWatcher title_watcher(tab, expected_title);
-
- GURL url = ui_test_utils::GetTestUrl(
- base::FilePath().AppendASCII("printing"),
- base::FilePath().AppendASCII("npapi_plugin.html"));
- ui_test_utils::NavigateToURL(browser(), url);
-
- EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
-
- // Now get the region of the plugin before and after the print preview is
- // shown. They should be different.
- HWND hwnd = tab->GetNativeView()->GetHost()->GetAcceleratedWidget();
- HWND child = NULL;
- EnumChildWindows(hwnd, EnumerateChildren,reinterpret_cast<LPARAM>(&child));
-
- RECT region_before, region_after;
- int result = GetWindowRgnBox(child, &region_before);
- ASSERT_EQ(result, SIMPLEREGION);
-
- // Now print preview.
- content::TestNavigationObserver nav_observer(NULL);
- nav_observer.StartWatchingNewWebContents();
- chrome::ExecuteCommand(browser(), IDC_PRINT);
- nav_observer.Wait();
- nav_observer.StopWatchingNewWebContents();
-
- result = GetWindowRgnBox(child, &region_after);
- if (result == NULLREGION) {
- // Depending on the browser window size, the plugin could be full covered.
- return;
- }
-
- if (result == COMPLEXREGION) {
- // Complex region, by definition not equal to the initial region.
- return;
- }
-
- ASSERT_EQ(result, SIMPLEREGION);
- bool rects_equal =
- region_before.left == region_after.left &&
- region_before.top == region_after.top &&
- region_before.right == region_after.right &&
- region_before.bottom == region_after.bottom;
- ASSERT_FALSE(rects_equal);
-}
-
-typedef InProcessBrowserTest FindInPageControllerTest;
-
-void EnsureFindBoxOpen(Browser* browser) {
- chrome::ShowFindBar(browser);
- gfx::Point position;
- bool fully_visible = false;
- FindBarTesting* find_bar =
- browser->GetFindBarController()->find_bar()->GetFindBarTesting();
- EXPECT_TRUE(find_bar->GetFindBarWindowInfo(&position, &fully_visible));
- EXPECT_TRUE(fully_visible);
-}
-
-// Ensure that the find bar is always over a windowed NPAPI plugin.
-// flaky: http://crbug.com/406631
-IN_PROC_BROWSER_TEST_F(FindInPageControllerTest,
- DISABLED_WindowedNPAPIPluginHidden) {
- chrome::DisableFindBarAnimationsDuringTesting(true);
- browser()->profile()->GetPrefs()->SetBoolean(prefs::kPluginsAlwaysAuthorize,
- true);
-
- // First load the page and wait for the NPAPI plugin's window to display.
- base::string16 expected_title(base::ASCIIToUTF16("ready"));
- content::WebContents* tab =
- browser()->tab_strip_model()->GetActiveWebContents();
- content::TitleWatcher title_watcher(tab, expected_title);
-
- GURL url = ui_test_utils::GetTestUrl(
- base::FilePath().AppendASCII("printing"),
- base::FilePath().AppendASCII("npapi_plugin.html"));
- ui_test_utils::NavigateToURL(browser(), url);
-
- EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
-
- // Now get the region of the plugin before the find bar is shown.
- HWND hwnd = tab->GetNativeView()->GetHost()->GetAcceleratedWidget();
- HWND child = NULL;
- EnumChildWindows(hwnd, EnumerateChildren, reinterpret_cast<LPARAM>(&child));
-
- RECT region_before, region_after;
- int result = GetWindowRgnBox(child, &region_before);
- ASSERT_EQ(result, SIMPLEREGION);
-
- // Create a new tab and open the find bar there.
- chrome::NewTab(browser());
- browser()->tab_strip_model()->ActivateTabAt(1, true);
- ui_test_utils::NavigateToURL(browser(), GURL(url::kAboutBlankURL));
-
- EnsureFindBoxOpen(browser());
-
- // Now switch back to the original tab with the plugin and show the find bar.
- browser()->tab_strip_model()->ActivateTabAt(0, true);
- EnsureFindBoxOpen(browser());
-
- result = GetWindowRgnBox(child, &region_after);
- if (result == NULLREGION) {
- // Depending on the browser window size, the plugin could be full covered.
- return;
- }
-
- if (result == COMPLEXREGION) {
- // Complex region, by definition not equal to the initial region.
- return;
- }
-
- ASSERT_EQ(result, SIMPLEREGION);
- bool rects_equal =
- region_before.left == region_after.left &&
- region_before.top == region_after.top &&
- region_before.right == region_after.right &&
- region_before.bottom == region_after.bottom;
- ASSERT_FALSE(rects_equal);
-}
-
-#endif
diff --git a/chrome/browser/content_settings/content_settings_browsertest.cc b/chrome/browser/content_settings/content_settings_browsertest.cc
index 8115527..6f15f49 100644
--- a/chrome/browser/content_settings/content_settings_browsertest.cc
+++ b/chrome/browser/content_settings/content_settings_browsertest.cc
@@ -291,243 +291,6 @@ IN_PROC_BROWSER_TEST_F(ContentSettingsTest, RedirectCrossOrigin) {
IsContentBlocked(CONTENT_SETTINGS_TYPE_COOKIES));
}
-// On Aura NPAPI only works on Windows.
-#if !defined(USE_AURA) || defined(OS_WIN)
-
-class LoadPluginTest : public ContentSettingsTest {
- protected:
- void PerformTest(bool expect_loaded) {
- GURL url = ui_test_utils::GetTestUrl(
- base::FilePath(),
- base::FilePath().AppendASCII("load_npapi_plugin.html"));
- ui_test_utils::NavigateToURL(browser(), url);
-
- const char* expected_result = expect_loaded ? "Loaded" : "Not Loaded";
- const char* unexpected_result = expect_loaded ? "Not Loaded" : "Loaded";
-
- base::string16 expected_title(base::ASCIIToUTF16(expected_result));
- base::string16 unexpected_title(base::ASCIIToUTF16(unexpected_result));
-
- content::TitleWatcher title_watcher(
- browser()->tab_strip_model()->GetActiveWebContents(), expected_title);
- title_watcher.AlsoWaitForTitle(unexpected_title);
-
- EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
- }
-
- void SetUpCommandLineInternal(base::CommandLine* command_line,
- bool expect_loaded) {
-#if defined(OS_MACOSX)
- base::FilePath plugin_dir;
- PathService::Get(base::DIR_MODULE, &plugin_dir);
- plugin_dir = plugin_dir.AppendASCII("plugins");
- // The plugins directory isn't read by default on the Mac, so it needs to be
- // explicitly registered.
- command_line->AppendSwitchPath(switches::kExtraPluginDir, plugin_dir);
-#endif
- command_line->AppendSwitch(switches::kAlwaysAuthorizePlugins);
- if (expect_loaded)
- command_line->AppendSwitch(switches::kEnableNpapiForTesting);
- }
-};
-
-class DisabledPluginTest : public LoadPluginTest {
- public:
- DisabledPluginTest() {}
-
- void SetUpCommandLine(base::CommandLine* command_line) override {
- SetUpCommandLineInternal(command_line, false);
- }
-};
-
-IN_PROC_BROWSER_TEST_F(DisabledPluginTest, Load) {
- PerformTest(false);
-}
-
-class EnabledPluginTest : public LoadPluginTest {
- public:
- EnabledPluginTest() {}
-
- void SetUpCommandLine(base::CommandLine* command_line) override {
- SetUpCommandLineInternal(command_line, true);
- }
-};
-
-IN_PROC_BROWSER_TEST_F(EnabledPluginTest, Load) {
- PerformTest(true);
-}
-
-class ClickToPlayPluginTest : public ContentSettingsTest {
- public:
- ClickToPlayPluginTest() {}
-
- void SetUpCommandLine(base::CommandLine* command_line) override {
-#if defined(OS_MACOSX)
- base::FilePath plugin_dir;
- PathService::Get(base::DIR_MODULE, &plugin_dir);
- plugin_dir = plugin_dir.AppendASCII("plugins");
- // The plugins directory isn't read by default on the Mac, so it needs to be
- // explicitly registered.
- command_line->AppendSwitchPath(switches::kExtraPluginDir, plugin_dir);
-#endif
- command_line->AppendSwitch(switches::kEnableNpapiForTesting);
- }
-};
-
-IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, Basic) {
- browser()->profile()->GetHostContentSettingsMap()->SetDefaultContentSetting(
- CONTENT_SETTINGS_TYPE_PLUGINS, CONTENT_SETTING_BLOCK);
-
- GURL url = ui_test_utils::GetTestUrl(
- base::FilePath(), base::FilePath().AppendASCII("clicktoplay.html"));
- ui_test_utils::NavigateToURL(browser(), url);
-
- base::string16 expected_title(base::ASCIIToUTF16("OK"));
- content::TitleWatcher title_watcher(
- browser()->tab_strip_model()->GetActiveWebContents(), expected_title);
-
- content::WebContents* web_contents =
- browser()->tab_strip_model()->GetActiveWebContents();
- ChromePluginServiceFilter* filter = ChromePluginServiceFilter::GetInstance();
- int process_id = web_contents->GetMainFrame()->GetProcess()->GetID();
- base::FilePath path(FILE_PATH_LITERAL("blah"));
- EXPECT_FALSE(filter->CanLoadPlugin(process_id, path));
- filter->AuthorizeAllPlugins(web_contents, true, std::string());
- EXPECT_TRUE(filter->CanLoadPlugin(process_id, path));
-
- EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
-}
-
-// Verify that plugins can be allowed on a domain by adding an exception
-IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, AllowException) {
- GURL url = ui_test_utils::GetTestUrl(
- base::FilePath(), base::FilePath().AppendASCII("clicktoplay.html"));
-
- browser()->profile()->GetHostContentSettingsMap()->SetDefaultContentSetting(
- CONTENT_SETTINGS_TYPE_PLUGINS, CONTENT_SETTING_BLOCK);
- browser()->profile()->GetHostContentSettingsMap()
- ->SetContentSetting(ContentSettingsPattern::FromURL(url),
- ContentSettingsPattern::Wildcard(),
- CONTENT_SETTINGS_TYPE_PLUGINS,
- std::string(),
- CONTENT_SETTING_ALLOW);
-
- base::string16 expected_title(base::ASCIIToUTF16("OK"));
- content::TitleWatcher title_watcher(
- browser()->tab_strip_model()->GetActiveWebContents(), expected_title);
- ui_test_utils::NavigateToURL(browser(), url);
- EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
-}
-
-// Verify that plugins can be blocked on a domain by adding an exception.
-IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, BlockException) {
- GURL url = ui_test_utils::GetTestUrl(
- base::FilePath(), base::FilePath().AppendASCII("clicktoplay.html"));
-
- browser()->profile()->GetHostContentSettingsMap()
- ->SetContentSetting(ContentSettingsPattern::FromURL(url),
- ContentSettingsPattern::Wildcard(),
- CONTENT_SETTINGS_TYPE_PLUGINS,
- std::string(),
- CONTENT_SETTING_BLOCK);
-
- base::string16 expected_title(base::ASCIIToUTF16("Click To Play"));
- content::TitleWatcher title_watcher(
- browser()->tab_strip_model()->GetActiveWebContents(), expected_title);
- ui_test_utils::NavigateToURL(browser(), url);
- EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
-}
-
-// Crashes on Mac Asan. http://crbug.com/239169
-#if defined(OS_MACOSX)
-#define MAYBE_LoadAllBlockedPlugins DISABLED_LoadAllBlockedPlugins
-// TODO(jschuh): Flaky plugin tests. crbug.com/244653
-#elif defined(OS_WIN) && defined(ARCH_CPU_X86_64)
-#define MAYBE_LoadAllBlockedPlugins DISABLED_LoadAllBlockedPlugins
-#else
-#define MAYBE_LoadAllBlockedPlugins LoadAllBlockedPlugins
-#endif
-IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, MAYBE_LoadAllBlockedPlugins) {
- browser()->profile()->GetHostContentSettingsMap()->SetDefaultContentSetting(
- CONTENT_SETTINGS_TYPE_PLUGINS, CONTENT_SETTING_BLOCK);
-
- GURL url = ui_test_utils::GetTestUrl(
- base::FilePath(),
- base::FilePath().AppendASCII("load_all_blocked_plugins.html"));
- ui_test_utils::NavigateToURL(browser(), url);
-
- base::string16 expected_title1(base::ASCIIToUTF16("1"));
- content::TitleWatcher title_watcher1(
- browser()->tab_strip_model()->GetActiveWebContents(), expected_title1);
-
- ChromePluginServiceFilter::GetInstance()->AuthorizeAllPlugins(
- browser()->tab_strip_model()->GetActiveWebContents(), true,
- std::string());
- EXPECT_EQ(expected_title1, title_watcher1.WaitAndGetTitle());
-
- base::string16 expected_title2(base::ASCIIToUTF16("2"));
- content::TitleWatcher title_watcher2(
- browser()->tab_strip_model()->GetActiveWebContents(), expected_title2);
-
- ASSERT_TRUE(content::ExecuteScript(
- browser()->tab_strip_model()->GetActiveWebContents(), "window.inject()"));
-
- EXPECT_EQ(expected_title2, title_watcher2.WaitAndGetTitle());
-}
-
-// If this flakes, use http://crbug.com/113057.
-// TODO(jschuh): Hanging plugin tests. crbug.com/244653
-#if !defined(OS_WIN) && !defined(ARCH_CPU_X86_64)
-IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, NoCallbackAtLoad) {
- browser()->profile()->GetHostContentSettingsMap()->SetDefaultContentSetting(
- CONTENT_SETTINGS_TYPE_PLUGINS, CONTENT_SETTING_BLOCK);
-
- GURL url("data:application/vnd.npapi-test,CallOnStartup();");
- ui_test_utils::NavigateToURL(browser(), url);
-
- std::string script("CallOnStartup = function() { ");
- script.append("document.documentElement.appendChild");
- script.append("(document.createElement(\"head\")); ");
- script.append("document.title = \"OK\"; }");
-
- // Inject the callback function into the HTML page generated by the browser.
- ASSERT_TRUE(content::ExecuteScript(
- browser()->tab_strip_model()->GetActiveWebContents(), script));
-
- base::string16 expected_title(base::ASCIIToUTF16("OK"));
- content::TitleWatcher title_watcher(
- browser()->tab_strip_model()->GetActiveWebContents(), expected_title);
-
- ChromePluginServiceFilter::GetInstance()->AuthorizeAllPlugins(
- browser()->tab_strip_model()->GetActiveWebContents(), true,
- std::string());
-
- EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
-}
-#endif
-
-IN_PROC_BROWSER_TEST_F(ClickToPlayPluginTest, DeleteSelfAtLoad) {
- browser()->profile()->GetHostContentSettingsMap()->SetDefaultContentSetting(
- CONTENT_SETTINGS_TYPE_PLUGINS, CONTENT_SETTING_BLOCK);
-
- GURL url = ui_test_utils::GetTestUrl(
- base::FilePath(),
- base::FilePath().AppendASCII("plugin_delete_self_at_load.html"));
- ui_test_utils::NavigateToURL(browser(), url);
-
- base::string16 expected_title(base::ASCIIToUTF16("OK"));
- content::TitleWatcher title_watcher(
- browser()->tab_strip_model()->GetActiveWebContents(), expected_title);
-
- ChromePluginServiceFilter::GetInstance()->AuthorizeAllPlugins(
- browser()->tab_strip_model()->GetActiveWebContents(), true,
- std::string());
-
- EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
-}
-
-#endif // !defined(USE_AURA) || defined(OS_WIN)
-
#if defined(ENABLE_PLUGINS)
class PepperContentSettingsSpecialCasesTest : public ContentSettingsTest {
protected:
diff --git a/chrome/browser/ui/views/location_bar/star_view_browsertest.cc b/chrome/browser/ui/views/location_bar/star_view_browsertest.cc
index c0b7b21..b7f6fc5 100644
--- a/chrome/browser/ui/views/location_bar/star_view_browsertest.cc
+++ b/chrome/browser/ui/views/location_bar/star_view_browsertest.cc
@@ -67,99 +67,4 @@ IN_PROC_BROWSER_TEST_F(StarViewTest, MAYBE_HideOnSecondClick) {
EXPECT_FALSE(BookmarkBubbleView::bookmark_bubble());
}
-#if defined(OS_WIN)
-
-class StarViewTestNoDWM : public InProcessBrowserTest {
- public:
- StarViewTestNoDWM() {}
-
- void SetUpCommandLine(base::CommandLine* command_line) override {
- command_line->AppendSwitch(switches::kDisableDwmComposition);
- }
-};
-
-BOOL CALLBACK EnumerateChildren(HWND hwnd, LPARAM l_param) {
- HWND* child = reinterpret_cast<HWND*>(l_param);
- *child = hwnd;
- // The first child window is the plugin, then its children. So stop
- // enumerating after the first callback.
- return FALSE;
-}
-
-// Ensure that UIs like the star window, user profiler picker, omnibox
-// popup and bookmark editor are always over a windowed NPAPI plugin even if
-// kDisableDwmComposition is used.
-// flaky: http://crbug.com/406631
-IN_PROC_BROWSER_TEST_F(StarViewTestNoDWM, DISABLED_WindowedNPAPIPluginHidden) {
- browser()->profile()->GetPrefs()->SetBoolean(prefs::kPluginsAlwaysAuthorize,
- true);
-
- // First switch to a new tab and back, to also test a scenario where we
- // stopped watching the root window.
- ui_test_utils::NavigateToURLWithDisposition(
- browser(), GURL("about:blank"), NEW_FOREGROUND_TAB,
- ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION);
- browser()->tab_strip_model()->ActivateTabAt(0, true);
-
- // First load the page and wait for the NPAPI plugin's window to display.
- base::string16 expected_title(base::ASCIIToUTF16("ready"));
- content::WebContents* tab =
- browser()->tab_strip_model()->GetActiveWebContents();
- content::TitleWatcher title_watcher(tab, expected_title);
-
- GURL url = ui_test_utils::GetTestUrl(
- base::FilePath().AppendASCII("printing"),
- base::FilePath().AppendASCII("npapi_plugin.html"));
- ui_test_utils::NavigateToURL(browser(), url);
- EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
-
- // Now get the region of the plugin before the star view is shown.
- HWND hwnd = tab->GetNativeView()->GetHost()->GetAcceleratedWidget();
- HWND child = NULL;
- EnumChildWindows(hwnd, EnumerateChildren,reinterpret_cast<LPARAM>(&child));
-
- RECT region_before, region_after;
- int result = GetWindowRgnBox(child, &region_before);
- ASSERT_EQ(result, SIMPLEREGION);
-
- // Now show the star view
- BrowserView* browser_view = reinterpret_cast<BrowserView*>(
- browser()->window());
- views::ImageView* star_view =
- browser_view->GetToolbarView()->location_bar()->star_view();
-
- scoped_refptr<content::MessageLoopRunner> runner =
- new content::MessageLoopRunner;
- // Verify that clicking once shows the bookmark bubble.
- ui_test_utils::MoveMouseToCenterAndPress(
- star_view,
- ui_controls::LEFT,
- ui_controls::DOWN | ui_controls::UP,
- runner->QuitClosure());
- runner->Run();
-
- EXPECT_TRUE(BookmarkBubbleView::bookmark_bubble());
-
- result = GetWindowRgnBox(child, &region_after);
- if (result == NULLREGION) {
- // Depending on the browser window size, the plugin could be full covered.
- return;
- }
-
- if (result == COMPLEXREGION) {
- // Complex region, by definition not equal to the initial region.
- return;
- }
-
- ASSERT_EQ(result, SIMPLEREGION);
- bool rects_equal =
- region_before.left == region_after.left &&
- region_before.top == region_after.top &&
- region_before.right == region_after.right &&
- region_before.bottom == region_after.bottom;
- ASSERT_FALSE(rects_equal);
-}
-
-#endif
-
} // namespace
diff --git a/chrome/browser_tests.isolate b/chrome/browser_tests.isolate
index 081cf1bf..0cff82a 100644
--- a/chrome/browser_tests.isolate
+++ b/chrome/browser_tests.isolate
@@ -183,7 +183,6 @@
'<(PRODUCT_DIR)/content_shell.pak',
'<(PRODUCT_DIR)/libclearkeycdm.dylib',
'<(PRODUCT_DIR)/osmesa.so',
- '<(PRODUCT_DIR)/plugins/npapi_test_plugin.plugin/',
'<(PRODUCT_DIR)/plugins/test_netscape_plugin.plugin/',
'<(PRODUCT_DIR)/power_saver_test_plugin.plugin/Contents/MacOS/power_saver_test_plugin',
'<(PRODUCT_DIR)/ppapi_tests.plugin/Contents/MacOS/ppapi_tests',
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index 13fd3b1..77de687 100644
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -941,7 +941,6 @@
'browser/autofill/autofill_interactive_uitest.cc',
'browser/autofill/autofill_uitest_util.cc',
'browser/browser_keyevents_browsertest.cc',
- 'browser/chrome_plugin_interactive_test.cc',
'browser/extensions/api/extension_action/browser_action_interactive_test.cc',
'browser/extensions/api/omnibox/omnibox_api_interactive_test.cc',
'browser/extensions/browsertest_util.cc',
@@ -2411,13 +2410,6 @@
'../v8/src/d8.gyp:d8#host',
],
}],
- ['OS!="android" and OS!="ios" and OS!="linux"', {
- # npapi test plugin doesn't build on android or ios
- 'dependencies': [
- # build time dependency.
- '../content/content_shell_and_tests.gyp:copy_npapi_test_plugin',
- ],
- }],
['enable_app_list==1', {
'sources': [ '<@(chrome_browser_tests_app_list_sources)' ],
}, {
diff --git a/chrome/interactive_ui_tests.isolate b/chrome/interactive_ui_tests.isolate
index f013ef6..1a5c74b 100644
--- a/chrome/interactive_ui_tests.isolate
+++ b/chrome/interactive_ui_tests.isolate
@@ -100,7 +100,6 @@
'<(PRODUCT_DIR)/libEGL.dll',
'<(PRODUCT_DIR)/libGLESv2.dll',
'<(PRODUCT_DIR)/osmesa.dll',
- '<(PRODUCT_DIR)/plugins/npapi_test_plugin.dll',
'<(PRODUCT_DIR)/ppapi_tests.dll',
],
},
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index 675e14c..9276818 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -970,12 +970,6 @@ if (!is_android) {
[ "../browser/copresence/chrome_whispernet_client_browsertest.cc" ]
deps += [ "//components/copresence" ]
}
- if (!is_android && !is_ios && !is_linux) {
- # NPAPI test plugin only works on some platforms.
- data_deps += [
- #'../content/content_shell_and_tests.gyp:copy_npapi_test_plugin', TODO(GYP)
- ]
- }
if (enable_app_list) {
sources += rebase_path(
chrome_tests_gypi_values.chrome_browser_tests_app_list_sources,
diff --git a/chrome/test/data/load_all_blocked_plugins.html b/chrome/test/data/load_all_blocked_plugins.html
deleted file mode 100644
index 8ae05db..0000000
--- a/chrome/test/data/load_all_blocked_plugins.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<html>
-<head>
-<script>
-var count = 0;
-function PluginCreated() {
- count++;
- document.title = count.toString();
-}
-
-var id = 1;
-function inject() {
- var child = document.createElement("div");
- child.innerHTML = '<embed type="application/vnd.npapi-test" src="foo" '+
- 'name="invoke_js_function_on_create" ' +
- 'id="' + id + '" mode="np_embed">';
- document.getElementById("content").appendChild(child);
- id++;
-}
-</script>
-</head>
-<body onload="inject();">
-<div id="content"></div>
-</body>
-</html>
diff --git a/chrome/test/data/load_npapi_plugin.html b/chrome/test/data/load_npapi_plugin.html
deleted file mode 100644
index 2b91f5f..0000000
--- a/chrome/test/data/load_npapi_plugin.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<html>
-<head>
-<title>Initial Title</title>
-<script>
-function PluginCreated() {
- document.title = "Loaded";
-}
-
-function injectPlugin() {
- var child = document.createElement('div');
- child.innerHTML = '<embed type="application/vnd.npapi-test" src="foo"' +
- ' name="invoke_js_function_on_create" id="plugin"' +
- ' mode="np_embed"></embed>';
- document.getElementById('content').appendChild(child);
- // Plugins are loaded synchronously during layout, so the plugin has either
- // been loaded or blocked at this point.
- var plugin = document.getElementById('plugin');
- // Check for the "loadedProperty" to determine if plugin is loaded.
- if (plugin.loadedProperty == true) {
- document.title = "Loaded";
- } else {
- document.title = "Not Loaded";
- }
-}
-</script>
-</head>
-<body onload='injectPlugin();'>
-<div id='content'></div>
-</embed>
-</body>
-</html>
diff --git a/chrome/test/data/plugin_delete_self_at_load.html b/chrome/test/data/plugin_delete_self_at_load.html
deleted file mode 100644
index 50805a2..0000000
--- a/chrome/test/data/plugin_delete_self_at_load.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<html>
-<head>
-<script>
-function PluginCreated() {
- document.body.innerHTML = '';
- document.title = "OK";
-}
-</script>
-</head>
-<body>
-<embed type="application/vnd.npapi-test"
- src="foo"
- name="invoke_js_function_on_create"
- id="plugin"
- mode="np_embed">
-</embed>
-</body>
-</html>
diff --git a/chrome/test/data/printing/npapi_plugin.html b/chrome/test/data/printing/npapi_plugin.html
deleted file mode 100644
index afbb9aa..0000000
--- a/chrome/test/data/printing/npapi_plugin.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<hmtl>
-<body>
-<embed type="application/vnd.npapi-test"
- height="300"
- width="100%"
- name="set_title_in_paint"
- id="1"
- mode="np_embed"/>
-</body>
-
-<script>
-function SetTitle() {
- window.document.title = "ready";
- return;
-}
-</script>
-
-</hmtl>
diff --git a/chrome/test/data/windowed_npapi_plugin.html b/chrome/test/data/windowed_npapi_plugin.html
deleted file mode 100644
index 1a0cc4b..0000000
--- a/chrome/test/data/windowed_npapi_plugin.html
+++ /dev/null
@@ -1,23 +0,0 @@
-<hmtl>
-<body>
-<embed type="application/vnd.npapi-test"
- height="300"
- width="100%"
- name="set_title_in_set_window_and_paint"
- id="1"
- mode="np_embed"/>
-</body>
-
-<script>
-function PluginCreated() {
- window.document.title = "created";
- return;
-}
-
-function PluginShown() {
- window.document.title = "shown";
- return;
-}
-</script>
-
-</hmtl>