| 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.h" | 10 #include "base/message_loop.h" |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 EXPECT_TRUE(panel->auto_resizable()); | 359 EXPECT_TRUE(panel->auto_resizable()); |
| 360 } | 360 } |
| 361 | 361 |
| 362 if (params.show_flag == SHOW_AS_ACTIVE) { | 362 if (params.show_flag == SHOW_AS_ACTIVE) { |
| 363 panel->Show(); | 363 panel->Show(); |
| 364 } else { | 364 } else { |
| 365 panel->ShowInactive(); | 365 panel->ShowInactive(); |
| 366 } | 366 } |
| 367 | 367 |
| 368 if (params.wait_for_fully_created) { | 368 if (params.wait_for_fully_created) { |
| 369 MessageLoopForUI::current()->RunUntilIdle(); | |
| 370 | |
| 371 #if defined(OS_LINUX) | 369 #if defined(OS_LINUX) |
| 372 // On bots, we might have a simple window manager which always activates new | 370 // On bots, we might have a simple window manager which always activates new |
| 373 // windows, and can't always deactivate them. Re-activate the main tabbed | 371 // windows, and can't always deactivate them. Re-activate the main tabbed |
| 374 // browser to "deactivate" the newly created panel. | 372 // browser to "deactivate" the newly created panel. |
| 375 if (params.expected_active_state == SHOW_AS_INACTIVE && | 373 if (params.expected_active_state == SHOW_AS_INACTIVE && |
| 376 ui::GuessWindowManager() == ui::WM_ICE_WM) { | 374 ui::GuessWindowManager() == ui::WM_ICE_WM) { |
| 377 // Wait for new panel to become active before deactivating to ensure | 375 // Wait for new panel to become active before deactivating to ensure |
| 378 // the activated notification is consumed before we wait for the panel | 376 // the activated notification is consumed before we wait for the panel |
| 379 // to become inactive. | 377 // to become inactive. |
| 380 WaitForPanelActiveState(panel, SHOW_AS_ACTIVE); | 378 WaitForPanelActiveState(panel, SHOW_AS_ACTIVE); |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 } | 510 } |
| 513 | 511 |
| 514 void BasePanelBrowserTest::MoveMouse(const gfx::Point& position) { | 512 void BasePanelBrowserTest::MoveMouse(const gfx::Point& position) { |
| 515 PanelManager::GetInstance()->mouse_watcher()->NotifyMouseMovement(position); | 513 PanelManager::GetInstance()->mouse_watcher()->NotifyMouseMovement(position); |
| 516 } | 514 } |
| 517 | 515 |
| 518 std::string BasePanelBrowserTest::MakePanelName(int index) { | 516 std::string BasePanelBrowserTest::MakePanelName(int index) { |
| 519 std::string panel_name("Panel"); | 517 std::string panel_name("Panel"); |
| 520 return panel_name + base::IntToString(index); | 518 return panel_name + base::IntToString(index); |
| 521 } | 519 } |
| OLD | NEW |