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

Side by Side Diff: chrome/test/functional/test_clean_exit.py

Issue 217403002: Remove kChildCleanExit since it's not used anymore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 8 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/functional/perf.py ('k') | content/browser/browser_child_process_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 import logging
7 import os
8 import signal
9 import subprocess
10 import tempfile
11 import unittest
12
13 import pyauto_functional
14 import pyauto
15 import test_utils
16
17
18 class SimpleTest(pyauto.PyUITest):
19
20 def ExtraChromeFlags(self):
21 """Ensures Chrome is launched with custom flags.
22
23 Returns:
24 A list of extra flags to pass to Chrome when it is launched.
25 """
26 fd, self._strace_log = tempfile.mkstemp()
27 os.close(fd)
28 extra_flags = ['--no-sandbox', '--child-clean-exit',
29 '--renderer-cmd-prefix=/usr/bin/strace -o %s' %
30 self._strace_log]
31 logging.debug('Strace file is: %s' % self._strace_log)
32 return pyauto.PyUITest.ExtraChromeFlags(self) + extra_flags
33
34
35 def testCleanExit(self):
36 """Ensures the renderer process cleanly exits."""
37 url = self.GetHttpURLForDataPath('title2.html')
38 self.NavigateToURL(url)
39 os.kill(self.GetBrowserInfo()['browser_pid'], signal.SIGINT)
40 self.WaitUntil(lambda: self._IsFileOpen(self._strace_log))
41 strace_contents = open(self._strace_log).read()
42 self.assertTrue('exit_group' in strace_contents)
43 os.remove(self._strace_log)
44
45 def _IsFileOpen(self, filename):
46 p = subprocess.Popen(['lsof', filename])
47 return p.communicate()[0] == ''
48
49
50 if __name__ == '__main__':
51 pyauto_functional.Main()
OLDNEW
« no previous file with comments | « chrome/test/functional/perf.py ('k') | content/browser/browser_child_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698