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

Side by Side Diff: chrome/browser/ui/panels/base_panel_browser_test.cc

Issue 9517010: Change panels to be able to turn off autoresize. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix assert at the end of RenderWidget::Resize which fixes the tests on OSX. Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/browser_window.h ('k') | chrome/browser/ui/panels/detached_panel_strip.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_window.h ('k') | chrome/browser/ui/panels/detached_panel_strip.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698