| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/panels/base_panel_browser_test.h" | 5 #include "chrome/browser/ui/panels/base_panel_browser_test.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 | 239 |
| 240 BasePanelBrowserTest::BasePanelBrowserTest() | 240 BasePanelBrowserTest::BasePanelBrowserTest() |
| 241 : InProcessBrowserTest(), | 241 : InProcessBrowserTest(), |
| 242 mock_display_settings_enabled_(true) { | 242 mock_display_settings_enabled_(true) { |
| 243 } | 243 } |
| 244 | 244 |
| 245 BasePanelBrowserTest::~BasePanelBrowserTest() { | 245 BasePanelBrowserTest::~BasePanelBrowserTest() { |
| 246 } | 246 } |
| 247 | 247 |
| 248 bool BasePanelBrowserTest::SkipTestIfIceWM() { | 248 bool BasePanelBrowserTest::SkipTestIfIceWM() { |
| 249 #if defined(OS_LINUX) | 249 #if defined(OS_LINUX) && defined(USE_X11) |
| 250 return ui::GuessWindowManager() == ui::WM_ICE_WM; | 250 return ui::GuessWindowManager() == ui::WM_ICE_WM; |
| 251 #else | 251 #else |
| 252 return false; | 252 return false; |
| 253 #endif | 253 #endif |
| 254 } | 254 } |
| 255 | 255 |
| 256 bool BasePanelBrowserTest::SkipTestIfCompizWM() { | 256 bool BasePanelBrowserTest::SkipTestIfCompizWM() { |
| 257 #if defined(OS_LINUX) | 257 #if defined(OS_LINUX) && defined(USE_X11) |
| 258 return ui::GuessWindowManager() == ui::WM_COMPIZ; | 258 return ui::GuessWindowManager() == ui::WM_COMPIZ; |
| 259 #else | 259 #else |
| 260 return false; | 260 return false; |
| 261 #endif | 261 #endif |
| 262 } | 262 } |
| 263 | 263 |
| 264 void BasePanelBrowserTest::SetUpCommandLine(CommandLine* command_line) { | 264 void BasePanelBrowserTest::SetUpCommandLine(CommandLine* command_line) { |
| 265 command_line->AppendSwitch(switches::kEnablePanels); | 265 command_line->AppendSwitch(switches::kEnablePanels); |
| 266 } | 266 } |
| 267 | 267 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 | 385 |
| 386 if (params.show_flag == SHOW_AS_ACTIVE) { | 386 if (params.show_flag == SHOW_AS_ACTIVE) { |
| 387 panel->Show(); | 387 panel->Show(); |
| 388 } else { | 388 } else { |
| 389 panel->ShowInactive(); | 389 panel->ShowInactive(); |
| 390 } | 390 } |
| 391 | 391 |
| 392 if (params.wait_for_fully_created) { | 392 if (params.wait_for_fully_created) { |
| 393 base::MessageLoopForUI::current()->RunUntilIdle(); | 393 base::MessageLoopForUI::current()->RunUntilIdle(); |
| 394 | 394 |
| 395 #if defined(OS_LINUX) | 395 #if defined(OS_LINUX) && defined(USE_X11) |
| 396 // On bots, we might have a simple window manager which always activates new | 396 // On bots, we might have a simple window manager which always activates new |
| 397 // windows, and can't always deactivate them. Re-activate the main tabbed | 397 // windows, and can't always deactivate them. Re-activate the main tabbed |
| 398 // browser to "deactivate" the newly created panel. | 398 // browser to "deactivate" the newly created panel. |
| 399 if (params.expected_active_state == SHOW_AS_INACTIVE && | 399 if (params.expected_active_state == SHOW_AS_INACTIVE && |
| 400 ui::GuessWindowManager() == ui::WM_ICE_WM) { | 400 ui::GuessWindowManager() == ui::WM_ICE_WM) { |
| 401 // Wait for new panel to become active before deactivating to ensure | 401 // Wait for new panel to become active before deactivating to ensure |
| 402 // the activated notification is consumed before we wait for the panel | 402 // the activated notification is consumed before we wait for the panel |
| 403 // to become inactive. | 403 // to become inactive. |
| 404 WaitForPanelActiveState(panel, SHOW_AS_ACTIVE); | 404 WaitForPanelActiveState(panel, SHOW_AS_ACTIVE); |
| 405 browser()->window()->Activate(); | 405 browser()->window()->Activate(); |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 } | 613 } |
| 614 | 614 |
| 615 std::string BasePanelBrowserTest::MakePanelName(int index) { | 615 std::string BasePanelBrowserTest::MakePanelName(int index) { |
| 616 std::string panel_name("Panel"); | 616 std::string panel_name("Panel"); |
| 617 return panel_name + base::IntToString(index); | 617 return panel_name + base::IntToString(index); |
| 618 } | 618 } |
| 619 | 619 |
| 620 bool BasePanelBrowserTest::WmSupportWindowActivation() { | 620 bool BasePanelBrowserTest::WmSupportWindowActivation() { |
| 621 return true; | 621 return true; |
| 622 } | 622 } |
| OLD | NEW |