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

Side by Side Diff: mojo/python/tests/runloop_unittest.py

Issue 552783004: mojo: Add a runloop utility in python (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 unified diff | Download patch
OLDNEW
(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)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698