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

Unified Diff: chrome/browser/ui/panels/base_panel_browser_test.cc

Issue 10544105: Modify old Panel test files and include them in .gyp. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: exclude new panel browser tests files from chromeos Created 8 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 | « no previous file | chrome/browser/ui/panels/native_panel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/panels/base_panel_browser_test.cc
diff --git a/chrome/browser/ui/panels/base_panel_browser_test.cc b/chrome/browser/ui/panels/base_panel_browser_test.cc
index 52180e76eb72eb10e67844bcd87ce4ffa635102c..a472bfeb38c0fbccf956b53de994976bb8632637 100644
--- a/chrome/browser/ui/panels/base_panel_browser_test.cc
+++ b/chrome/browser/ui/panels/base_panel_browser_test.cc
@@ -330,20 +330,6 @@ Panel* BasePanelBrowserTest::CreatePanelWithParams(
EXPECT_TRUE(panel->auto_resizable());
}
-#if defined(OS_LINUX)
- // On bots, we might have a simple window manager which always activates new
- // windows, and can't always deactivate them. Keep track of the previously
- // active window so we can activate that window back to ensure the new window
- // is inactive.
- Browser* last_active_browser_to_restore = NULL;
- if (params.expected_active_state == SHOW_AS_INACTIVE &&
- ui::GuessWindowManager() == ui::WM_ICE_WM) {
- last_active_browser_to_restore = BrowserList::GetLastActive();
- EXPECT_TRUE(last_active_browser_to_restore);
- EXPECT_NE(last_active_browser_to_restore, panel_browser);
- }
-#endif
-
if (params.show_flag == SHOW_AS_ACTIVE) {
panel->Show();
} else {
@@ -354,9 +340,13 @@ Panel* BasePanelBrowserTest::CreatePanelWithParams(
MessageLoopForUI::current()->RunAllPending();
#if defined(OS_LINUX)
- // Restore focus where it was. It will deactivate the new panel.
- if (last_active_browser_to_restore)
- last_active_browser_to_restore->window()->Activate();
+ // On bots, we might have a simple window manager which always activates new
+ // windows, and can't always deactivate them. Re-activate the main tabbed
+ // browser to "deactivate" the newly created panel.
+ if (params.expected_active_state == SHOW_AS_INACTIVE &&
+ ui::GuessWindowManager() == ui::WM_ICE_WM) {
+ browser()->window()->Activate();
+ }
#endif
// More waiting, because gaining or losing focus may require inter-process
// asynchronous communication, and it is not enough to just run the local
« no previous file with comments | « no previous file | chrome/browser/ui/panels/native_panel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698