| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 NativePanelTesting::Create(panel->native_panel())); | 247 NativePanelTesting::Create(panel->native_panel())); |
| 248 ui_test_utils::WindowedNotificationObserver signal( | 248 ui_test_utils::WindowedNotificationObserver signal( |
| 249 chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, | 249 chrome::NOTIFICATION_PANEL_BOUNDS_ANIMATIONS_FINISHED, |
| 250 content::Source<Panel>(panel)); | 250 content::Source<Panel>(panel)); |
| 251 if (!panel_testing->IsAnimatingBounds()) | 251 if (!panel_testing->IsAnimatingBounds()) |
| 252 return; | 252 return; |
| 253 signal.Wait(); | 253 signal.Wait(); |
| 254 EXPECT_TRUE(!panel_testing->IsAnimatingBounds()); | 254 EXPECT_TRUE(!panel_testing->IsAnimatingBounds()); |
| 255 } | 255 } |
| 256 | 256 |
| 257 void BasePanelBrowserTest::WaitForExpansionStateChanged( |
| 258 Panel* panel, Panel::ExpansionState expansion_state) { |
| 259 ui_test_utils::WindowedNotificationObserver signal( |
| 260 chrome::NOTIFICATION_PANEL_CHANGED_EXPANSION_STATE, |
| 261 content::Source<Panel>(panel)); |
| 262 if (panel->expansion_state() == expansion_state) |
| 263 return; |
| 264 signal.Wait(); |
| 265 EXPECT_EQ(expansion_state, panel->expansion_state()); |
| 266 } |
| 267 |
| 257 Panel* BasePanelBrowserTest::CreatePanelWithParams( | 268 Panel* BasePanelBrowserTest::CreatePanelWithParams( |
| 258 const CreatePanelParams& params) { | 269 const CreatePanelParams& params) { |
| 259 #if defined(OS_MACOSX) | 270 #if defined(OS_MACOSX) |
| 260 // Opening panels on a Mac causes NSWindowController of the Panel window | 271 // Opening panels on a Mac causes NSWindowController of the Panel window |
| 261 // to be autoreleased. We need a pool drained after it's done so the test | 272 // to be autoreleased. We need a pool drained after it's done so the test |
| 262 // can close correctly. The NSWindowController of the Panel window controls | 273 // can close correctly. The NSWindowController of the Panel window controls |
| 263 // lifetime of the Browser object so we want to release it as soon as | 274 // lifetime of the Browser object so we want to release it as soon as |
| 264 // possible. In real Chrome, this is done by message pump. | 275 // possible. In real Chrome, this is done by message pump. |
| 265 // On non-Mac platform, this is an empty class. | 276 // On non-Mac platform, this is an empty class. |
| 266 base::mac::ScopedNSAutoreleasePool autorelease_pool; | 277 base::mac::ScopedNSAutoreleasePool autorelease_pool; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 std::string error; | 372 std::string error; |
| 362 scoped_refptr<Extension> extension = Extension::Create( | 373 scoped_refptr<Extension> extension = Extension::Create( |
| 363 full_path, location, *input_value, | 374 full_path, location, *input_value, |
| 364 Extension::STRICT_ERROR_CHECKS, &error); | 375 Extension::STRICT_ERROR_CHECKS, &error); |
| 365 EXPECT_TRUE(extension.get()); | 376 EXPECT_TRUE(extension.get()); |
| 366 EXPECT_STREQ("", error.c_str()); | 377 EXPECT_STREQ("", error.c_str()); |
| 367 browser()->GetProfile()->GetExtensionService()-> | 378 browser()->GetProfile()->GetExtensionService()-> |
| 368 OnExtensionInstalled(extension.get(), false, -1); | 379 OnExtensionInstalled(extension.get(), false, -1); |
| 369 return extension; | 380 return extension; |
| 370 } | 381 } |
| OLD | NEW |