| 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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 #if defined(OS_MACOSX) | 318 #if defined(OS_MACOSX) |
| 319 // Opening panels on a Mac causes NSWindowController of the Panel window | 319 // Opening panels on a Mac causes NSWindowController of the Panel window |
| 320 // to be autoreleased. We need a pool drained after it's done so the test | 320 // to be autoreleased. We need a pool drained after it's done so the test |
| 321 // can close correctly. The NSWindowController of the Panel window controls | 321 // can close correctly. The NSWindowController of the Panel window controls |
| 322 // lifetime of the Browser object so we want to release it as soon as | 322 // lifetime of the Browser object so we want to release it as soon as |
| 323 // possible. In real Chrome, this is done by message pump. | 323 // possible. In real Chrome, this is done by message pump. |
| 324 // On non-Mac platform, this is an empty class. | 324 // On non-Mac platform, this is an empty class. |
| 325 base::mac::ScopedNSAutoreleasePool autorelease_pool; | 325 base::mac::ScopedNSAutoreleasePool autorelease_pool; |
| 326 #endif | 326 #endif |
| 327 | 327 |
| 328 Browser* panel_browser = Browser::CreateForApp(Browser::TYPE_PANEL, | 328 Browser* panel_browser = Browser::CreateWithParams( |
| 329 params.name, | 329 Browser::CreateParams::CreateForApp( |
| 330 params.bounds, | 330 Browser::TYPE_PANEL, params.name, params.bounds, |
| 331 browser()->profile()); | 331 browser()->profile())); |
| 332 EXPECT_TRUE(panel_browser->is_type_panel()); | 332 EXPECT_TRUE(panel_browser->is_type_panel()); |
| 333 | 333 |
| 334 if (!params.url.is_empty()) { | 334 if (!params.url.is_empty()) { |
| 335 ui_test_utils::WindowedNotificationObserver observer( | 335 ui_test_utils::WindowedNotificationObserver observer( |
| 336 content::NOTIFICATION_LOAD_STOP, | 336 content::NOTIFICATION_LOAD_STOP, |
| 337 content::NotificationService::AllSources()); | 337 content::NotificationService::AllSources()); |
| 338 panel_browser->AddSelectedTabWithURL(params.url, | 338 panel_browser->AddSelectedTabWithURL(params.url, |
| 339 content::PAGE_TRANSITION_START_PAGE); | 339 content::PAGE_TRANSITION_START_PAGE); |
| 340 observer.Wait(); | 340 observer.Wait(); |
| 341 } | 341 } |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 } | 504 } |
| 505 | 505 |
| 506 void BasePanelBrowserTest::MoveMouse(const gfx::Point& position) { | 506 void BasePanelBrowserTest::MoveMouse(const gfx::Point& position) { |
| 507 PanelManager::GetInstance()->mouse_watcher()->NotifyMouseMovement(position); | 507 PanelManager::GetInstance()->mouse_watcher()->NotifyMouseMovement(position); |
| 508 } | 508 } |
| 509 | 509 |
| 510 std::string BasePanelBrowserTest::MakePanelName(int index) { | 510 std::string BasePanelBrowserTest::MakePanelName(int index) { |
| 511 std::string panel_name("Panel"); | 511 std::string panel_name("Panel"); |
| 512 return panel_name + base::IntToString(index); | 512 return panel_name + base::IntToString(index); |
| 513 } | 513 } |
| OLD | NEW |