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

Unified Diff: chrome/test/mini_installer/launch_chrome.py

Issue 24126005: Use CreateProcess instead of subprocess.Popen to launch Chrome in the mini_installer test framework. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Address gab's comment. Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/mini_installer/launch_chrome.py
diff --git a/chrome/test/mini_installer/launch_chrome.py b/chrome/test/mini_installer/launch_chrome.py
index 311a06b37aa7021afe8431c2c5fa519793a055c6..0b800ebd65fe9c52de4c0402a5040c8d92d09082 100644
--- a/chrome/test/mini_installer/launch_chrome.py
+++ b/chrome/test/mini_installer/launch_chrome.py
@@ -8,9 +8,9 @@ This script launches Chrome and waits until its window shows up.
"""
import optparse
-import subprocess
import sys
import time
+import win32process
import chrome_helper
@@ -42,8 +42,12 @@ def main():
parser.error('Incorrect number of arguments.')
chrome_path = args[0]
- process = subprocess.Popen(chrome_path)
- if not WaitForWindow(process.pid, 'Chrome_WidgetWin_'):
+ # Use CreateProcess rather than subprocess.Popen to avoid side effects such as
+ # handle interitance.
+ _, _, process_id, _ = win32process.CreateProcess(None, chrome_path, None,
+ None, 0, 0, None, None,
+ win32process.STARTUPINFO())
+ if not WaitForWindow(process_id, 'Chrome_WidgetWin_'):
raise Exception('Could not launch Chrome.')
return 0
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698