| 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/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 167 |
| 168 void BasePanelBrowserTest::SetUpOnMainThread() { | 168 void BasePanelBrowserTest::SetUpOnMainThread() { |
| 169 InProcessBrowserTest::SetUpOnMainThread(); | 169 InProcessBrowserTest::SetUpOnMainThread(); |
| 170 | 170 |
| 171 // Setup the work area and desktop bar so that we have consistent testing | 171 // Setup the work area and desktop bar so that we have consistent testing |
| 172 // environment for all panel related tests. | 172 // environment for all panel related tests. |
| 173 PanelManager* panel_manager = PanelManager::GetInstance(); | 173 PanelManager* panel_manager = PanelManager::GetInstance(); |
| 174 mock_auto_hiding_desktop_bar_ = new MockAutoHidingDesktopBarImpl( | 174 mock_auto_hiding_desktop_bar_ = new MockAutoHidingDesktopBarImpl( |
| 175 panel_manager); | 175 panel_manager); |
| 176 panel_manager->set_auto_hiding_desktop_bar(mock_auto_hiding_desktop_bar_); | 176 panel_manager->set_auto_hiding_desktop_bar(mock_auto_hiding_desktop_bar_); |
| 177 panel_manager->SetWorkAreaForTesting(testing_work_area_); | 177 // Do not use the testing work area if it is empty since we're going to |
| 178 // use the actual work area in some testing scenarios. |
| 179 if (!testing_work_area_.IsEmpty()) |
| 180 panel_manager->SetWorkAreaForTesting(testing_work_area_); |
| 178 panel_manager->enable_auto_sizing(false); | 181 panel_manager->enable_auto_sizing(false); |
| 179 panel_manager->remove_delays_for_testing(); | 182 panel_manager->remove_delays_for_testing(); |
| 180 // This is needed so the subsequently created panels can be activated. | 183 // This is needed so the subsequently created panels can be activated. |
| 181 // On a Mac, it transforms background-only test process into foreground one. | 184 // On a Mac, it transforms background-only test process into foreground one. |
| 182 EXPECT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); | 185 EXPECT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); |
| 183 } | 186 } |
| 184 | 187 |
| 185 void BasePanelBrowserTest::WaitForPanelActiveState( | 188 void BasePanelBrowserTest::WaitForPanelActiveState( |
| 186 Panel* panel, ActiveState expected_state) { | 189 Panel* panel, ActiveState expected_state) { |
| 187 DCHECK(expected_state == SHOW_AS_ACTIVE || | 190 DCHECK(expected_state == SHOW_AS_ACTIVE || |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 std::string error; | 328 std::string error; |
| 326 scoped_refptr<Extension> extension = Extension::Create( | 329 scoped_refptr<Extension> extension = Extension::Create( |
| 327 full_path, location, *input_value, | 330 full_path, location, *input_value, |
| 328 Extension::STRICT_ERROR_CHECKS, &error); | 331 Extension::STRICT_ERROR_CHECKS, &error); |
| 329 EXPECT_TRUE(extension.get()); | 332 EXPECT_TRUE(extension.get()); |
| 330 EXPECT_STREQ("", error.c_str()); | 333 EXPECT_STREQ("", error.c_str()); |
| 331 browser()->GetProfile()->GetExtensionService()-> | 334 browser()->GetProfile()->GetExtensionService()-> |
| 332 OnExtensionInstalled(extension.get(), false, -1); | 335 OnExtensionInstalled(extension.get(), false, -1); |
| 333 return extension; | 336 return extension; |
| 334 } | 337 } |
| OLD | NEW |