Index: chrome/test/functional/test_clean_exit.py |
diff --git a/chrome/test/functional/test_clean_exit.py b/chrome/test/functional/test_clean_exit.py |
new file mode 100755 |
index 0000000000000000000000000000000000000000..470305758ca5ddf8b16ceae58385161e87a4a962 |
--- /dev/null |
+++ b/chrome/test/functional/test_clean_exit.py |
@@ -0,0 +1,39 @@ |
+#!/usr/bin/env python |
+# Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+ |
+import os |
+import tempfile |
+import unittest |
+ |
+import pyauto_functional |
+import pyauto |
+ |
+ |
+class SimpleTest(pyauto.PyUITest): |
+ |
+ def ExtraChromeFlags(self): |
+ """Ensures Chrome is launched with custom flags. |
+ |
+ Returns: |
+ A list of extra flags to pass to Chrome when it is launched. |
+ """ |
+ # Extra flag needed by scroll performance tests. |
+ fd, self._strace_log = tempfile.mkstemp() |
+ os.close(fd) |
+ 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.
|
+ '--renderer-cmd-prefix=/usr/bin/strace -o %s' % self._strace_log] |
+ |
+ |
+ def testCleanExit(self): |
+ """Ensures the renderer process cleanly exits.""" |
+ 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.
|
+ crash_url = 'about:inducebrowsercrashforrealz' |
+ self.NavigateToURL(crash_url) |
+ 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.
|
+ 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.
|
+ |
+ |
+if __name__ == '__main__': |
+ pyauto_functional.Main() |