OLD | NEW |
(Empty) | |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 import unittest |
| 6 |
| 7 # pylint: disable=F0401 |
| 8 import mojo.embedder |
| 9 from mojo import system |
| 10 |
| 11 class RunLoopTest(unittest.TestCase): |
| 12 |
| 13 def setUp(self): |
| 14 mojo.embedder.Init() |
| 15 |
| 16 def testRunLoop(self): |
| 17 loop = system.RunLoop() |
| 18 array = [] |
| 19 def Increment(): |
| 20 array.append(0) |
| 21 for _ in xrange(10): |
| 22 loop.PostDelayedTask(Increment) |
| 23 loop.RunUntilIdle() |
| 24 self.assertEquals(len(array), 10) |
OLD | NEW |