| 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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 observer_->OnAutoHidingDesktopBarThicknessChanged(); | 150 observer_->OnAutoHidingDesktopBarThicknessChanged(); |
| 151 } | 151 } |
| 152 | 152 |
| 153 bool ExistsPanel(Panel* panel) { | 153 bool ExistsPanel(Panel* panel) { |
| 154 const PanelManager::Panels& panels = PanelManager::GetInstance()->panels(); | 154 const PanelManager::Panels& panels = PanelManager::GetInstance()->panels(); |
| 155 return find(panels.begin(), panels.end(), panel) != panels.end(); | 155 return find(panels.begin(), panels.end(), panel) != panels.end(); |
| 156 } | 156 } |
| 157 | 157 |
| 158 } // namespace | 158 } // namespace |
| 159 | 159 |
| 160 const FilePath::CharType* BasePanelBrowserTest::kTestDir = |
| 161 FILE_PATH_LITERAL("panels"); |
| 162 |
| 160 BasePanelBrowserTest::BasePanelBrowserTest() | 163 BasePanelBrowserTest::BasePanelBrowserTest() |
| 161 : InProcessBrowserTest(), | 164 : InProcessBrowserTest(), |
| 162 testing_work_area_(0, 0, kTestingWorkAreaWidth, | 165 testing_work_area_(0, 0, kTestingWorkAreaWidth, |
| 163 kTestingWorkAreaHeight) { | 166 kTestingWorkAreaHeight) { |
| 164 #if defined(OS_MACOSX) | 167 #if defined(OS_MACOSX) |
| 165 FindBarBridge::disable_animations_during_testing_ = true; | 168 FindBarBridge::disable_animations_during_testing_ = true; |
| 166 #endif | 169 #endif |
| 167 } | 170 } |
| 168 | 171 |
| 169 BasePanelBrowserTest::~BasePanelBrowserTest() { | 172 BasePanelBrowserTest::~BasePanelBrowserTest() { |
| 170 } | 173 } |
| 171 | 174 |
| 172 void BasePanelBrowserTest::SetUpCommandLine(CommandLine* command_line) { | 175 void BasePanelBrowserTest::SetUpCommandLine(CommandLine* command_line) { |
| 173 EnableDOMAutomation(); | 176 EnableDOMAutomation(); |
| 174 | |
| 175 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir_); | |
| 176 test_data_dir_ = test_data_dir_.AppendASCII("panels"); | |
| 177 } | 177 } |
| 178 | 178 |
| 179 void BasePanelBrowserTest::SetUpOnMainThread() { | 179 void BasePanelBrowserTest::SetUpOnMainThread() { |
| 180 InProcessBrowserTest::SetUpOnMainThread(); | 180 InProcessBrowserTest::SetUpOnMainThread(); |
| 181 | 181 |
| 182 // Setup the work area and desktop bar so that we have consistent testing | 182 // Setup the work area and desktop bar so that we have consistent testing |
| 183 // environment for all panel related tests. | 183 // environment for all panel related tests. |
| 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); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 std::string error; | 356 std::string error; |
| 357 scoped_refptr<Extension> extension = Extension::Create( | 357 scoped_refptr<Extension> extension = Extension::Create( |
| 358 full_path, location, *input_value, | 358 full_path, location, *input_value, |
| 359 Extension::STRICT_ERROR_CHECKS, &error); | 359 Extension::STRICT_ERROR_CHECKS, &error); |
| 360 EXPECT_TRUE(extension.get()); | 360 EXPECT_TRUE(extension.get()); |
| 361 EXPECT_STREQ("", error.c_str()); | 361 EXPECT_STREQ("", error.c_str()); |
| 362 browser()->GetProfile()->GetExtensionService()-> | 362 browser()->GetProfile()->GetExtensionService()-> |
| 363 OnExtensionInstalled(extension.get(), false, -1); | 363 OnExtensionInstalled(extension.get(), false, -1); |
| 364 return extension; | 364 return extension; |
| 365 } | 365 } |
| OLD | NEW |