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

Unified Diff: mojo/python/tests/system_unittest.py

Issue 644773002: mojo: Add RunLoop::Current() and refactor unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
Index: mojo/python/tests/system_unittest.py
diff --git a/mojo/python/tests/system_unittest.py b/mojo/python/tests/system_unittest.py
index 2f0e36a3c19520366f8d0e22624ad08487ab3819..991dcba2cf0d64d05f7df128eb53f6e5d47e10a6 100644
--- a/mojo/python/tests/system_unittest.py
+++ b/mojo/python/tests/system_unittest.py
@@ -3,12 +3,11 @@
# found in the LICENSE file.
import random
-import sys
import time
-import unittest
+
+import mojo_unittest
# pylint: disable=F0401
-import mojo.embedder
from mojo import system
DATA_SIZE = 1024
@@ -19,13 +18,7 @@ def _GetRandomBuffer(size):
return bytearray(''.join(chr(random.randint(0, 255)) for i in xrange(size)))
-class BaseMojoTest(unittest.TestCase):
-
- def setUp(self):
- mojo.embedder.Init()
-
-
-class CoreTest(BaseMojoTest):
+class CoreTest(mojo_unittest.MojoTestCase):
def testResults(self):
self.assertEquals(system.RESULT_OK, 0)
@@ -300,11 +293,3 @@ class CoreTest(BaseMojoTest):
self.assertEquals(data, buf1.buffer)
self.assertEquals(data, buf2.buffer)
self.assertEquals(buf1.buffer, buf2.buffer)
-
-
-if __name__ == '__main__':
- suite = unittest.TestLoader().loadTestsFromTestCase(CoreTest)
- test_results = unittest.TextTestRunner(verbosity=0).run(suite)
- if not test_results.wasSuccessful():
- sys.exit(1)
- sys.exit(0)
« mojo/public/python/mojo/system.pyx ('K') | « mojo/python/tests/runloop_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698