Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Side by Side Diff: chrome/browser/ui/panels/base_panel_browser_test.cc

Issue 8505047: Fix panels being removed from PanelManager prematurely. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change test from using notification to timeout. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/panels/base_panel_browser_test.h ('k') | chrome/browser/ui/panels/panel.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "base/message_loop.h" 12 #include "base/message_loop.h"
13 #include "base/path_service.h"
13 #include "chrome/browser/extensions/extension_service.h" 14 #include "chrome/browser/extensions/extension_service.h"
14 #include "chrome/browser/profiles/profile.h" 15 #include "chrome/browser/profiles/profile.h"
15 #include "chrome/browser/ui/browser.h" 16 #include "chrome/browser/ui/browser.h"
16 #include "chrome/browser/ui/panels/native_panel.h" 17 #include "chrome/browser/ui/panels/native_panel.h"
17 #include "chrome/browser/ui/panels/panel_manager.h" 18 #include "chrome/browser/ui/panels/panel_manager.h"
18 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 19 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
20 #include "chrome/common/chrome_paths.h"
19 #include "chrome/common/chrome_switches.h" 21 #include "chrome/common/chrome_switches.h"
20 #include "chrome/test/base/ui_test_utils.h" 22 #include "chrome/test/base/ui_test_utils.h"
21 #include "content/browser/tab_contents/test_tab_contents.h" 23 #include "content/browser/tab_contents/test_tab_contents.h"
22 #include "content/public/browser/notification_service.h" 24 #include "content/public/browser/notification_service.h"
23 #include "content/public/common/url_constants.h" 25 #include "content/public/common/url_constants.h"
24 26
25 #if defined(OS_MACOSX) 27 #if defined(OS_MACOSX)
26 #include "base/mac/scoped_nsautorelease_pool.h" 28 #include "base/mac/scoped_nsautorelease_pool.h"
27 #include "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h" 29 #include "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h"
28 #endif 30 #endif
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 #if defined(OS_MACOSX) 164 #if defined(OS_MACOSX)
163 FindBarBridge::disable_animations_during_testing_ = true; 165 FindBarBridge::disable_animations_during_testing_ = true;
164 #endif 166 #endif
165 } 167 }
166 168
167 BasePanelBrowserTest::~BasePanelBrowserTest() { 169 BasePanelBrowserTest::~BasePanelBrowserTest() {
168 } 170 }
169 171
170 void BasePanelBrowserTest::SetUpCommandLine(CommandLine* command_line) { 172 void BasePanelBrowserTest::SetUpCommandLine(CommandLine* command_line) {
171 EnableDOMAutomation(); 173 EnableDOMAutomation();
174
175 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir_);
176 test_data_dir_ = test_data_dir_.AppendASCII("panels");
172 } 177 }
173 178
174 void BasePanelBrowserTest::SetUpOnMainThread() { 179 void BasePanelBrowserTest::SetUpOnMainThread() {
175 InProcessBrowserTest::SetUpOnMainThread(); 180 InProcessBrowserTest::SetUpOnMainThread();
176 181
177 // 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
178 // environment for all panel related tests. 183 // environment for all panel related tests.
179 PanelManager* panel_manager = PanelManager::GetInstance(); 184 PanelManager* panel_manager = PanelManager::GetInstance();
180 mock_auto_hiding_desktop_bar_ = new MockAutoHidingDesktopBarImpl( 185 mock_auto_hiding_desktop_bar_ = new MockAutoHidingDesktopBarImpl(
181 panel_manager); 186 panel_manager);
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 std::string error; 356 std::string error;
352 scoped_refptr<Extension> extension = Extension::Create( 357 scoped_refptr<Extension> extension = Extension::Create(
353 full_path, location, *input_value, 358 full_path, location, *input_value,
354 Extension::STRICT_ERROR_CHECKS, &error); 359 Extension::STRICT_ERROR_CHECKS, &error);
355 EXPECT_TRUE(extension.get()); 360 EXPECT_TRUE(extension.get());
356 EXPECT_STREQ("", error.c_str()); 361 EXPECT_STREQ("", error.c_str());
357 browser()->GetProfile()->GetExtensionService()-> 362 browser()->GetProfile()->GetExtensionService()->
358 OnExtensionInstalled(extension.get(), false, -1); 363 OnExtensionInstalled(extension.get(), false, -1);
359 return extension; 364 return extension;
360 } 365 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/panels/base_panel_browser_test.h ('k') | chrome/browser/ui/panels/panel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698