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

Side by Side Diff: chrome_frame/test/chrome_frame_test_utils.cc

Issue 9460019: Reduce flakiness in chrome_frame_tests.exe by having each run in a clean environment. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed compile break Created 8 years, 10 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
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_frame/test/chrome_frame_test_utils.h" 5 #include "chrome_frame/test/chrome_frame_test_utils.h"
6 6
7 #include <atlapp.h> 7 #include <atlapp.h>
8 #include <atlmisc.h> 8 #include <atlmisc.h>
9 #include <iepmapi.h> 9 #include <iepmapi.h>
10 #include <sddl.h> 10 #include <sddl.h>
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 } else { 170 } else {
171 CommandLine cmdline((FilePath(path))); 171 CommandLine cmdline((FilePath(path)));
172 cmdline.AppendArgNative(argument); 172 cmdline.AppendArgNative(argument);
173 if (!base::LaunchProcess(cmdline, base::LaunchOptions(), &process)) { 173 if (!base::LaunchProcess(cmdline, base::LaunchOptions(), &process)) {
174 LOG(ERROR) << "LaunchProcess failed: " << ::GetLastError(); 174 LOG(ERROR) << "LaunchProcess failed: " << ::GetLastError();
175 } 175 }
176 } 176 }
177 return process; 177 return process;
178 } 178 }
179 179
180 base::ProcessHandle LaunchChrome(const std::wstring& url) { 180 base::ProcessHandle LaunchChrome(const std::wstring& url,
181 const FilePath& user_data_dir) {
181 FilePath path; 182 FilePath path;
182 PathService::Get(base::DIR_MODULE, &path); 183 PathService::Get(base::DIR_MODULE, &path);
183 path = path.AppendASCII(kChromeImageName); 184 path = path.AppendASCII(kChromeImageName);
184 185
185 CommandLine cmd(path); 186 CommandLine cmd(path);
186 cmd.AppendSwitch(switches::kNoFirstRun); 187 cmd.AppendSwitch(switches::kNoFirstRun);
188 if (!user_data_dir.empty())
189 cmd.AppendSwitchPath(switches::kUserDataDir, user_data_dir);
187 cmd.AppendArgNative(url); 190 cmd.AppendArgNative(url);
188 191
189 base::ProcessHandle process = NULL; 192 base::ProcessHandle process = NULL;
190 base::LaunchProcess(cmd, base::LaunchOptions(), &process); 193 base::LaunchProcess(cmd, base::LaunchOptions(), &process);
191 return process; 194 return process;
192 } 195 }
193 196
194 base::ProcessHandle LaunchIEOnVista(const std::wstring& url) { 197 base::ProcessHandle LaunchIEOnVista(const std::wstring& url) {
195 typedef HRESULT (WINAPI* IELaunchURLPtr)( 198 typedef HRESULT (WINAPI* IELaunchURLPtr)(
196 const wchar_t* url, 199 const wchar_t* url,
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 wchar_t local_app_data_path[MAX_PATH + 1] = {0}; 667 wchar_t local_app_data_path[MAX_PATH + 1] = {0};
665 SHGetFolderPath(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, 668 SHGetFolderPath(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT,
666 local_app_data_path); 669 local_app_data_path);
667 670
668 std::wstring session_history_path = local_app_data_path; 671 std::wstring session_history_path = local_app_data_path;
669 session_history_path += L"\\Microsoft\\Internet Explorer\\Recovery"; 672 session_history_path += L"\\Microsoft\\Internet Explorer\\Recovery";
670 file_util::Delete(session_history_path, true); 673 file_util::Delete(session_history_path, true);
671 } 674 }
672 675
673 } // namespace chrome_frame_test 676 } // namespace chrome_frame_test
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698