Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 os | |
| 7 import tempfile | |
| 8 import unittest | |
| 9 | |
| 10 import pyauto_functional | |
| 11 import pyauto | |
| 12 | |
| 13 | |
| 14 class SimpleTest(pyauto.PyUITest): | |
| 15 | |
| 16 def ExtraChromeFlags(self): | |
| 17 """Ensures Chrome is launched with custom flags. | |
| 18 | |
| 19 Returns: | |
| 20 A list of extra flags to pass to Chrome when it is launched. | |
| 21 """ | |
| 22 # Extra flag needed by scroll performance tests. | |
| 23 fd, self._strace_log = tempfile.mkstemp() | |
| 24 os.close(fd) | |
| 25 return ['--no-sandbox', '--renderer-clean-exit', | |
|
Nirnimesh
2012/04/06 04:34:10
This method should only ever append to the parent'
asharif1
2012/04/06 18:45:58
Done.
| |
| 26 '--renderer-cmd-prefix=/usr/bin/strace -o %s' % self._strace_log] | |
| 27 | |
| 28 | |
| 29 def testCleanExit(self): | |
| 30 """Ensures the renderer process cleanly exits.""" | |
| 31 self.NavigateToURL('http://www.google.com') | |
|
Nirnimesh
2012/04/06 04:34:10
You don't need to navigate to a live URL. Just use
asharif1
2012/04/06 18:45:58
Done.
| |
| 32 crash_url = 'about:inducebrowsercrashforrealz' | |
| 33 self.NavigateToURL(crash_url) | |
| 34 strace_contents = open(self._strace_log).read() | |
|
Nirnimesh
2012/04/06 04:34:10
Delete self._strace_log after this?
asharif1
2012/04/06 18:45:58
Done.
| |
| 35 self.assertTrue("exit_group" in strace_contents) | |
|
Nirnimesh
2012/04/06 04:34:10
use ' instead of " for consistency
asharif1
2012/04/06 18:45:58
Done.
| |
| 36 | |
| 37 | |
| 38 if __name__ == '__main__': | |
| 39 pyauto_functional.Main() | |
| OLD | NEW |