| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 PanelManager* panel_manager = PanelManager::GetInstance(); | 184 PanelManager* panel_manager = PanelManager::GetInstance(); |
| 185 mock_auto_hiding_desktop_bar_ = new MockAutoHidingDesktopBarImpl( | 185 mock_auto_hiding_desktop_bar_ = new MockAutoHidingDesktopBarImpl( |
| 186 panel_manager); | 186 panel_manager); |
| 187 panel_manager->set_auto_hiding_desktop_bar(mock_auto_hiding_desktop_bar_); | 187 panel_manager->set_auto_hiding_desktop_bar(mock_auto_hiding_desktop_bar_); |
| 188 // Do not use the testing work area if it is empty since we're going to | 188 // Do not use the testing work area if it is empty since we're going to |
| 189 // use the actual work area in some testing scenarios. | 189 // use the actual work area in some testing scenarios. |
| 190 if (!testing_work_area_.IsEmpty()) | 190 if (!testing_work_area_.IsEmpty()) |
| 191 panel_manager->SetWorkAreaForTesting(testing_work_area_); | 191 panel_manager->SetWorkAreaForTesting(testing_work_area_); |
| 192 panel_manager->enable_auto_sizing(false); | 192 panel_manager->enable_auto_sizing(false); |
| 193 | 193 |
| 194 PanelManager::shorten_time_intervals_for_testing(); |
| 195 |
| 194 // This is needed so the subsequently created panels can be activated. | 196 // This is needed so the subsequently created panels can be activated. |
| 195 // On a Mac, it transforms background-only test process into foreground one. | 197 // On a Mac, it transforms background-only test process into foreground one. |
| 196 EXPECT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); | 198 EXPECT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); |
| 197 } | 199 } |
| 198 | 200 |
| 199 void BasePanelBrowserTest::WaitForPanelAdded(Panel* panel) { | 201 void BasePanelBrowserTest::WaitForPanelAdded(Panel* panel) { |
| 200 if (ExistsPanel(panel)) | 202 if (ExistsPanel(panel)) |
| 201 return; | 203 return; |
| 202 ui_test_utils::WindowedNotificationObserver signal( | 204 ui_test_utils::WindowedNotificationObserver signal( |
| 203 chrome::NOTIFICATION_PANEL_ADDED, | 205 chrome::NOTIFICATION_PANEL_ADDED, |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 std::string error; | 374 std::string error; |
| 373 scoped_refptr<Extension> extension = Extension::Create( | 375 scoped_refptr<Extension> extension = Extension::Create( |
| 374 full_path, location, *input_value, | 376 full_path, location, *input_value, |
| 375 Extension::STRICT_ERROR_CHECKS, &error); | 377 Extension::STRICT_ERROR_CHECKS, &error); |
| 376 EXPECT_TRUE(extension.get()); | 378 EXPECT_TRUE(extension.get()); |
| 377 EXPECT_STREQ("", error.c_str()); | 379 EXPECT_STREQ("", error.c_str()); |
| 378 browser()->GetProfile()->GetExtensionService()-> | 380 browser()->GetProfile()->GetExtensionService()-> |
| 379 OnExtensionInstalled(extension.get(), false, -1); | 381 OnExtensionInstalled(extension.get(), false, -1); |
| 380 return extension; | 382 return extension; |
| 381 } | 383 } |
| OLD | NEW |