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

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

Issue 7628006: GTTF: Use a fresh TestingBrowserProcess for each test, part #6 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 9 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/test/base/chrome_test_suite.cc ('k') | chrome/test/base/testing_browser_process.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/test/base/in_process_browser_test.h" 5 #include "chrome/test/base/in_process_browser_test.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/mac/scoped_nsautorelease_pool.h" 10 #include "base/mac/scoped_nsautorelease_pool.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 } 87 }
88 88
89 InProcessBrowserTest::~InProcessBrowserTest() { 89 InProcessBrowserTest::~InProcessBrowserTest() {
90 } 90 }
91 91
92 void InProcessBrowserTest::SetUp() { 92 void InProcessBrowserTest::SetUp() {
93 // Create a temporary user data directory if required. 93 // Create a temporary user data directory if required.
94 ASSERT_TRUE(CreateUserDataDirectory()) 94 ASSERT_TRUE(CreateUserDataDirectory())
95 << "Could not create user data directory."; 95 << "Could not create user data directory.";
96 96
97 #if defined(OS_WIN) 97 #if defined(OS_WIN) || defined(OS_LINUX)
98 // This is not really Windows-specific, the transition is just being done 98 // This is not really Windows-specific, the transition is just being done
99 // in stages, and Windows is first. See below for more info. 99 // in stages, and Windows is first. See below for more info.
100 DCHECK(!g_browser_process); 100 DCHECK(!g_browser_process);
101 #else 101 #else
102 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. 102 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062.
103 // The unit test suite creates a testingbrowser, but we want the real thing. 103 // The unit test suite creates a testingbrowser, but we want the real thing.
104 // Delete the current one. We'll install the testing one in TearDown. 104 // Delete the current one. We'll install the testing one in TearDown.
105 delete g_browser_process; 105 delete g_browser_process;
106 g_browser_process = NULL; 106 g_browser_process = NULL;
107 #endif 107 #endif
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 } else { 218 } else {
219 LOG(ERROR) << "Could not create temporary user data directory \"" 219 LOG(ERROR) << "Could not create temporary user data directory \""
220 << temp_user_data_dir_.path().value() << "\"."; 220 << temp_user_data_dir_.path().value() << "\".";
221 return false; 221 return false;
222 } 222 }
223 } 223 }
224 return test_launcher_utils::OverrideUserDataDir(user_data_dir); 224 return test_launcher_utils::OverrideUserDataDir(user_data_dir);
225 } 225 }
226 226
227 void InProcessBrowserTest::TearDown() { 227 void InProcessBrowserTest::TearDown() {
228 #if defined(OS_WIN) 228 #if defined(OS_WIN) || defined(OS_LINUX)
229 // This is not really Windows-specific, the transition is just being done 229 // This is not really Windows-specific, the transition is just being done
230 // in stages, and Windows is first. See below for more info. 230 // in stages, and Windows is first. See below for more info.
231 DCHECK(!g_browser_process); 231 DCHECK(!g_browser_process);
232 #else 232 #else
233 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062. 233 // TODO(phajdan.jr): Temporary, for http://crbug.com/61062.
234 // Reinstall testing browser process. 234 // Reinstall testing browser process.
235 delete g_browser_process; 235 delete g_browser_process;
236 g_browser_process = new TestingBrowserProcess(); 236 g_browser_process = new TestingBrowserProcess();
237 #endif 237 #endif
238 238
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 return; 359 return;
360 360
361 // Invoke CloseAllBrowsersAndMayExit on a running message loop. 361 // Invoke CloseAllBrowsersAndMayExit on a running message loop.
362 // CloseAllBrowsersAndMayExit exits the message loop after everything has been 362 // CloseAllBrowsersAndMayExit exits the message loop after everything has been
363 // shut down properly. 363 // shut down properly.
364 MessageLoopForUI::current()->PostTask( 364 MessageLoopForUI::current()->PostTask(
365 FROM_HERE, 365 FROM_HERE,
366 NewRunnableFunction(&BrowserList::AttemptExit)); 366 NewRunnableFunction(&BrowserList::AttemptExit));
367 ui_test_utils::RunMessageLoop(); 367 ui_test_utils::RunMessageLoop();
368 } 368 }
OLDNEW
« no previous file with comments | « chrome/test/base/chrome_test_suite.cc ('k') | chrome/test/base/testing_browser_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698