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 "chrome/browser/ui/browser_list.h" | 7 #include "chrome/browser/ui/browser_list.h" |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 ui_test_utils::WindowedNotificationObserver observer( | 321 ui_test_utils::WindowedNotificationObserver observer( |
322 content::NOTIFICATION_LOAD_STOP, | 322 content::NOTIFICATION_LOAD_STOP, |
323 content::NotificationService::AllSources()); | 323 content::NotificationService::AllSources()); |
324 panel_browser->AddSelectedTabWithURL(params.url, | 324 panel_browser->AddSelectedTabWithURL(params.url, |
325 content::PAGE_TRANSITION_START_PAGE); | 325 content::PAGE_TRANSITION_START_PAGE); |
326 observer.Wait(); | 326 observer.Wait(); |
327 } | 327 } |
328 | 328 |
329 Panel* panel = static_cast<Panel*>(panel_browser->window()); | 329 Panel* panel = static_cast<Panel*>(panel_browser->window()); |
330 | 330 |
331 if (params.bounds.width() || params.bounds.height()) | 331 if (!PanelManager::GetInstance()->auto_sizing_enabled() || |
| 332 params.bounds.width() || params.bounds.height()) { |
332 EXPECT_FALSE(panel->auto_resizable()); | 333 EXPECT_FALSE(panel->auto_resizable()); |
333 else | 334 } else { |
334 EXPECT_TRUE(panel->auto_resizable()); | 335 EXPECT_TRUE(panel->auto_resizable()); |
| 336 } |
335 | 337 |
336 #if defined(OS_LINUX) | 338 #if defined(OS_LINUX) |
337 // On bots, we might have a simple window manager which always activates new | 339 // On bots, we might have a simple window manager which always activates new |
338 // windows, and can't always deactivate them. Keep track of the previously | 340 // windows, and can't always deactivate them. Keep track of the previously |
339 // active window so we can activate that window back to ensure the new window | 341 // active window so we can activate that window back to ensure the new window |
340 // is inactive. | 342 // is inactive. |
341 Browser* last_active_browser_to_restore = NULL; | 343 Browser* last_active_browser_to_restore = NULL; |
342 if (params.expected_active_state == SHOW_AS_INACTIVE && | 344 if (params.expected_active_state == SHOW_AS_INACTIVE && |
343 ui::GuessWindowManager() == ui::WM_ICE_WM) { | 345 ui::GuessWindowManager() == ui::WM_ICE_WM) { |
344 last_active_browser_to_restore = BrowserList::GetLastActive(); | 346 last_active_browser_to_restore = BrowserList::GetLastActive(); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 } | 436 } |
435 | 437 |
436 void BasePanelBrowserTest::MoveMouse(const gfx::Point& position) { | 438 void BasePanelBrowserTest::MoveMouse(const gfx::Point& position) { |
437 PanelManager::GetInstance()->mouse_watcher()->NotifyMouseMovement(position); | 439 PanelManager::GetInstance()->mouse_watcher()->NotifyMouseMovement(position); |
438 } | 440 } |
439 | 441 |
440 std::string BasePanelBrowserTest::MakePanelName(int index) { | 442 std::string BasePanelBrowserTest::MakePanelName(int index) { |
441 std::string panel_name("Panel"); | 443 std::string panel_name("Panel"); |
442 return panel_name + base::IntToString(index); | 444 return panel_name + base::IntToString(index); |
443 } | 445 } |
OLD | NEW |