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

Side by Side Diff: chrome/test/base/in_process_browser_test.cc

Issue 21052007: aura: Clean up compositor initialization/destruction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanupcompositor: UseRealGLBindings for CompositingRWHVBrowserTests on win_rel Created 7 years, 4 months 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/ash/ash_init.cc ('k') | chrome/test/base/test_launcher_utils.h » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/test/base/in_process_browser_test.h" 5 #include "chrome/test/base/in_process_browser_test.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "chrome/test/base/ui_test_utils.h" 44 #include "chrome/test/base/ui_test_utils.h"
45 #include "content/public/browser/notification_service.h" 45 #include "content/public/browser/notification_service.h"
46 #include "content/public/browser/notification_types.h" 46 #include "content/public/browser/notification_types.h"
47 #include "content/public/test/browser_test_utils.h" 47 #include "content/public/test/browser_test_utils.h"
48 #include "content/public/test/test_browser_thread.h" 48 #include "content/public/test/test_browser_thread.h"
49 #include "content/public/test/test_launcher.h" 49 #include "content/public/test/test_launcher.h"
50 #include "content/public/test/test_navigation_observer.h" 50 #include "content/public/test/test_navigation_observer.h"
51 #include "net/dns/mock_host_resolver.h" 51 #include "net/dns/mock_host_resolver.h"
52 #include "net/test/embedded_test_server/embedded_test_server.h" 52 #include "net/test/embedded_test_server/embedded_test_server.h"
53 #include "net/test/spawned_test_server/spawned_test_server.h" 53 #include "net/test/spawned_test_server/spawned_test_server.h"
54 #include "ui/compositor/compositor_switches.h"
55 54
56 #if defined(OS_MACOSX) 55 #if defined(OS_MACOSX)
57 #include "base/mac/scoped_nsautorelease_pool.h" 56 #include "base/mac/scoped_nsautorelease_pool.h"
58 #endif 57 #endif
59 58
60 #if defined(OS_WIN) && defined(USE_AURA) 59 #if defined(OS_WIN) && defined(USE_AURA)
61 #include "base/win/scoped_com_initializer.h" 60 #include "base/win/scoped_com_initializer.h"
62 #include "base/win/windows_version.h" 61 #include "base/win/windows_version.h"
63 #include "ui/base/win/atl_module.h" 62 #include "ui/base/win/atl_module.h"
64 #include "ui/compositor/compositor_setup.h"
65 #include "win8/test/metro_registration_helper.h" 63 #include "win8/test/metro_registration_helper.h"
66 #include "win8/test/test_registrar_constants.h" 64 #include "win8/test/test_registrar_constants.h"
67 #endif 65 #endif
68 66
69 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) 67 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION)
70 #include "chrome/browser/captive_portal/captive_portal_service.h" 68 #include "chrome/browser/captive_portal/captive_portal_service.h"
71 #endif 69 #endif
72 70
73 namespace { 71 namespace {
74 72
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 chrome_browser_net::NetErrorTabHelper::TESTING_FORCE_DISABLED); 207 chrome_browser_net::NetErrorTabHelper::TESTING_FORCE_DISABLED);
210 208
211 google_util::SetMockLinkDoctorBaseURLForTesting(); 209 google_util::SetMockLinkDoctorBaseURLForTesting();
212 210
213 #if defined(OS_WIN) && defined(USE_AURA) 211 #if defined(OS_WIN) && defined(USE_AURA)
214 if (base::win::GetVersion() >= base::win::VERSION_WIN8 && 212 if (base::win::GetVersion() >= base::win::VERSION_WIN8 &&
215 CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) { 213 CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests)) {
216 com_initializer_.reset(new base::win::ScopedCOMInitializer()); 214 com_initializer_.reset(new base::win::ScopedCOMInitializer());
217 ui::win::CreateATLModuleIfNeeded(); 215 ui::win::CreateATLModuleIfNeeded();
218 ASSERT_TRUE(win8::MakeTestDefaultBrowserSynchronously()); 216 ASSERT_TRUE(win8::MakeTestDefaultBrowserSynchronously());
219
220 // Ash browser tests need the real compositor.
221 ui::DisableTestCompositor();
222 } 217 }
223 #endif 218 #endif
224 219
225 BrowserTestBase::SetUp(); 220 BrowserTestBase::SetUp();
226 } 221 }
227 222
228 void InProcessBrowserTest::PrepareTestCommandLine(CommandLine* command_line) { 223 void InProcessBrowserTest::PrepareTestCommandLine(CommandLine* command_line) {
229 // Propagate commandline settings from test_launcher_utils. 224 // Propagate commandline settings from test_launcher_utils.
230 test_launcher_utils::PrepareBrowserCommandLineForTests(command_line); 225 test_launcher_utils::PrepareBrowserCommandLineForTests(command_line);
231 226
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 #if !defined(OS_MACOSX) 362 #if !defined(OS_MACOSX)
368 CommandLine InProcessBrowserTest::GetCommandLineForRelaunch() { 363 CommandLine InProcessBrowserTest::GetCommandLineForRelaunch() {
369 CommandLine new_command_line(CommandLine::ForCurrentProcess()->GetProgram()); 364 CommandLine new_command_line(CommandLine::ForCurrentProcess()->GetProgram());
370 CommandLine::SwitchMap switches = 365 CommandLine::SwitchMap switches =
371 CommandLine::ForCurrentProcess()->GetSwitches(); 366 CommandLine::ForCurrentProcess()->GetSwitches();
372 switches.erase(switches::kUserDataDir); 367 switches.erase(switches::kUserDataDir);
373 switches.erase(content::kSingleProcessTestsFlag); 368 switches.erase(content::kSingleProcessTestsFlag);
374 switches.erase(switches::kSingleProcess); 369 switches.erase(switches::kSingleProcess);
375 new_command_line.AppendSwitch(content::kLaunchAsBrowser); 370 new_command_line.AppendSwitch(content::kLaunchAsBrowser);
376 371
377 #if defined(USE_AURA)
378 // Copy what UITestBase::SetLaunchSwitches() does, and also what
379 // ChromeTestSuite does if the process had went into the test path. Otherwise
380 // tests will fail on bots.
381 if (!CommandLine::ForCurrentProcess()->HasSwitch(
382 switches::kDisableTestCompositor)) {
383 new_command_line.AppendSwitch(switches::kTestCompositor);
384 }
385 #endif
386
387 base::FilePath user_data_dir; 372 base::FilePath user_data_dir;
388 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); 373 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir);
389 new_command_line.AppendSwitchPath(switches::kUserDataDir, user_data_dir); 374 new_command_line.AppendSwitchPath(switches::kUserDataDir, user_data_dir);
390 375
391 for (CommandLine::SwitchMap::const_iterator iter = switches.begin(); 376 for (CommandLine::SwitchMap::const_iterator iter = switches.begin();
392 iter != switches.end(); ++iter) { 377 iter != switches.end(); ++iter) {
393 new_command_line.AppendSwitchNative((*iter).first, (*iter).second); 378 new_command_line.AppendSwitchNative((*iter).first, (*iter).second);
394 } 379 }
395 return new_command_line; 380 return new_command_line;
396 } 381 }
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 // On the Mac, this eventually reaches 466 // On the Mac, this eventually reaches
482 // -[BrowserWindowController windowWillClose:], which will post a deferred 467 // -[BrowserWindowController windowWillClose:], which will post a deferred
483 // -autorelease on itself to ultimately destroy the Browser object. The line 468 // -autorelease on itself to ultimately destroy the Browser object. The line
484 // below is necessary to pump these pending messages to ensure all Browsers 469 // below is necessary to pump these pending messages to ensure all Browsers
485 // get deleted. 470 // get deleted.
486 content::RunAllPendingInMessageLoop(); 471 content::RunAllPendingInMessageLoop();
487 delete autorelease_pool_; 472 delete autorelease_pool_;
488 autorelease_pool_ = NULL; 473 autorelease_pool_ = NULL;
489 #endif 474 #endif
490 } 475 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/ash_init.cc ('k') | chrome/test/base/test_launcher_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698