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 // The subclass might override testing_work_area_ to make it empty so that |
178 // we will not provide our own testing work area. This is used in testing | |
179 // the interaction with desktop notification which does not have testing | |
180 // working area hook up. | |
181 if (!testing_work_area_.IsEmpty()) | |
jennb
2011/11/09 21:44:34
This comment makes me worry that tests are affecti
| |
182 panel_manager->SetWorkAreaForTesting(testing_work_area_); | |
178 panel_manager->enable_auto_sizing(false); | 183 panel_manager->enable_auto_sizing(false); |
179 panel_manager->remove_delays_for_testing(); | 184 panel_manager->remove_delays_for_testing(); |
180 // This is needed so the subsequently created panels can be activated. | 185 // This is needed so the subsequently created panels can be activated. |
181 // On a Mac, it transforms background-only test process into foreground one. | 186 // On a Mac, it transforms background-only test process into foreground one. |
182 EXPECT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); | 187 EXPECT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); |
183 } | 188 } |
184 | 189 |
185 void BasePanelBrowserTest::WaitForPanelActiveState( | 190 void BasePanelBrowserTest::WaitForPanelActiveState( |
186 Panel* panel, ActiveState expected_state) { | 191 Panel* panel, ActiveState expected_state) { |
187 DCHECK(expected_state == SHOW_AS_ACTIVE || | 192 DCHECK(expected_state == SHOW_AS_ACTIVE || |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
325 std::string error; | 330 std::string error; |
326 scoped_refptr<Extension> extension = Extension::Create( | 331 scoped_refptr<Extension> extension = Extension::Create( |
327 full_path, location, *input_value, | 332 full_path, location, *input_value, |
328 Extension::STRICT_ERROR_CHECKS, &error); | 333 Extension::STRICT_ERROR_CHECKS, &error); |
329 EXPECT_TRUE(extension.get()); | 334 EXPECT_TRUE(extension.get()); |
330 EXPECT_STREQ("", error.c_str()); | 335 EXPECT_STREQ("", error.c_str()); |
331 browser()->GetProfile()->GetExtensionService()-> | 336 browser()->GetProfile()->GetExtensionService()-> |
332 OnExtensionInstalled(extension.get(), false, -1); | 337 OnExtensionInstalled(extension.get(), false, -1); |
333 return extension; | 338 return extension; |
334 } | 339 } |
OLD | NEW |