Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(685)

Unified Diff: chrome/browser/ui/views/location_bar/star_view_browsertest.cc

Issue 1182303010: Delete the NPAPI plugin browsertests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/content_settings/content_settings_browsertest.cc ('k') | chrome/browser_tests.isolate » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/location_bar/star_view_browsertest.cc
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 c0b7b21b05d5a761a3780638be3c7cc92d0d3997..b7f6fc58d85fe084f057c85d9e8099e0c1cb0b9f 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
« no previous file with comments | « chrome/browser/content_settings/content_settings_browsertest.cc ('k') | chrome/browser_tests.isolate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698