Index: mojo/python/tests/runloop_unittest.py |
diff --git a/mojo/python/tests/runloop_unittest.py b/mojo/python/tests/runloop_unittest.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1195c1b91706c926d41519ccf463ac00bad4c481 |
--- /dev/null |
+++ b/mojo/python/tests/runloop_unittest.py |
@@ -0,0 +1,24 @@ |
+# Copyright 2014 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 unittest |
+ |
+# pylint: disable=F0401 |
+import mojo.embedder |
+from mojo import system |
+ |
+class RunLoopTest(unittest.TestCase): |
+ |
+ def setUp(self): |
+ mojo.embedder.Init() |
+ |
+ def testRunLoop(self): |
+ loop = system.RunLoop() |
+ array = [] |
+ def Increment(): |
+ array.append(0) |
+ for _ in xrange(10): |
+ loop.PostDelayedTask(Increment) |
+ loop.RunUntilIdle() |
+ self.assertEquals(len(array), 10) |