summaryrefslogtreecommitdiffstats
path: root/testing/mozbase/mozrunner/tests/test_start.py
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /testing/mozbase/mozrunner/tests/test_start.py
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/mozbase/mozrunner/tests/test_start.py')
-rw-r--r--testing/mozbase/mozrunner/tests/test_start.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/testing/mozbase/mozrunner/tests/test_start.py b/testing/mozbase/mozrunner/tests/test_start.py
new file mode 100644
index 000000000..396584e00
--- /dev/null
+++ b/testing/mozbase/mozrunner/tests/test_start.py
@@ -0,0 +1,45 @@
+#!/usr/bin/env python
+
+from time import sleep
+
+import mozrunnertest
+
+
+class MozrunnerStartTestCase(mozrunnertest.MozrunnerTestCase):
+
+ def test_start_process(self):
+ """Start the process and test properties"""
+ self.assertIsNone(self.runner.process_handler)
+
+ self.runner.start()
+
+ self.assertTrue(self.runner.is_running())
+ self.assertIsNotNone(self.runner.process_handler)
+
+ def test_start_process_called_twice(self):
+ """Start the process twice and test that first process is gone"""
+ self.runner.start()
+ # Bug 925480
+ # Make a copy until mozprocess can kill a specific process
+ process_handler = self.runner.process_handler
+
+ self.runner.start()
+
+ try:
+ self.assertNotIn(process_handler.wait(1), [None, 0])
+ finally:
+ process_handler.kill()
+
+ def test_start_with_timeout(self):
+ """Start the process and set a timeout"""
+ self.runner.start(timeout=2)
+ sleep(5)
+
+ self.assertFalse(self.runner.is_running())
+
+ def test_start_with_outputTimeout(self):
+ """Start the process and set a timeout"""
+ self.runner.start(outputTimeout=2)
+ sleep(15)
+
+ self.assertFalse(self.runner.is_running())