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/old_base_panel_browser_test.h" | 5 #include "chrome/browser/ui/panels/old_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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 Panel* panel, Panel::ExpansionState expansion_state) { | 286 Panel* panel, Panel::ExpansionState expansion_state) { |
287 content::WindowedNotificationObserver signal( | 287 content::WindowedNotificationObserver signal( |
288 chrome::NOTIFICATION_PANEL_CHANGED_EXPANSION_STATE, | 288 chrome::NOTIFICATION_PANEL_CHANGED_EXPANSION_STATE, |
289 content::Source<Panel>(panel)); | 289 content::Source<Panel>(panel)); |
290 if (panel->expansion_state() == expansion_state) | 290 if (panel->expansion_state() == expansion_state) |
291 return; | 291 return; |
292 signal.Wait(); | 292 signal.Wait(); |
293 EXPECT_EQ(expansion_state, panel->expansion_state()); | 293 EXPECT_EQ(expansion_state, panel->expansion_state()); |
294 } | 294 } |
295 | 295 |
| 296 OldBasePanelBrowserTest::CreatePanelParams::CreatePanelParams( |
| 297 const std::string& name, |
| 298 const gfx::Rect& bounds, |
| 299 ActiveState show_flag) |
| 300 : name(name), |
| 301 bounds(bounds), |
| 302 show_flag(show_flag), |
| 303 wait_for_fully_created(true), |
| 304 expected_active_state(show_flag) { |
| 305 } |
| 306 |
296 Panel* OldBasePanelBrowserTest::CreatePanelWithParams( | 307 Panel* OldBasePanelBrowserTest::CreatePanelWithParams( |
297 const CreatePanelParams& params) { | 308 const CreatePanelParams& params) { |
298 #if defined(OS_MACOSX) | 309 #if defined(OS_MACOSX) |
299 // Opening panels on a Mac causes NSWindowController of the Panel window | 310 // Opening panels on a Mac causes NSWindowController of the Panel window |
300 // to be autoreleased. We need a pool drained after it's done so the test | 311 // to be autoreleased. We need a pool drained after it's done so the test |
301 // can close correctly. The NSWindowController of the Panel window controls | 312 // can close correctly. The NSWindowController of the Panel window controls |
302 // lifetime of the Browser object so we want to release it as soon as | 313 // lifetime of the Browser object so we want to release it as soon as |
303 // possible. In real Chrome, this is done by message pump. | 314 // possible. In real Chrome, this is done by message pump. |
304 // On non-Mac platform, this is an empty class. | 315 // On non-Mac platform, this is an empty class. |
305 base::mac::ScopedNSAutoreleasePool autorelease_pool; | 316 base::mac::ScopedNSAutoreleasePool autorelease_pool; |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 } | 495 } |
485 | 496 |
486 void OldBasePanelBrowserTest::MoveMouse(const gfx::Point& position) { | 497 void OldBasePanelBrowserTest::MoveMouse(const gfx::Point& position) { |
487 PanelManager::GetInstance()->mouse_watcher()->NotifyMouseMovement(position); | 498 PanelManager::GetInstance()->mouse_watcher()->NotifyMouseMovement(position); |
488 } | 499 } |
489 | 500 |
490 std::string OldBasePanelBrowserTest::MakePanelName(int index) { | 501 std::string OldBasePanelBrowserTest::MakePanelName(int index) { |
491 std::string panel_name("Panel"); | 502 std::string panel_name("Panel"); |
492 return panel_name + base::IntToString(index); | 503 return panel_name + base::IntToString(index); |
493 } | 504 } |
OLD | NEW |