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

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

Issue 675563002: Remove mojo/python and gyp targets (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
« no previous file with comments | « mojo/python/tests/promise_unittest.py ('k') | mojo/python/tests/system_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/python/tests/runloop_unittest.py
diff --git a/mojo/python/tests/runloop_unittest.py b/mojo/python/tests/runloop_unittest.py
deleted file mode 100644
index 5c1ca838882c5a0f67d0395d886025d8efe9347c..0000000000000000000000000000000000000000
--- a/mojo/python/tests/runloop_unittest.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# 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 mojo_unittest
-
-# pylint: disable=E0611
-from mojo import system
-
-
-def _Increment(array):
- def _Closure():
- array.append(0)
- return _Closure
-
-
-class RunLoopTest(mojo_unittest.MojoTestCase):
-
- def testRunLoop(self):
- array = []
- for _ in xrange(10):
- self.loop.PostDelayedTask(_Increment(array))
- self.loop.RunUntilIdle()
- self.assertEquals(len(array), 10)
-
- def testRunLoopWithException(self):
- def Throw():
- raise Exception("error")
- array = []
- self.loop.PostDelayedTask(Throw)
- self.loop.PostDelayedTask(_Increment(array))
- with self.assertRaisesRegexp(Exception, '^error$'):
- self.loop.Run()
- self.assertEquals(len(array), 0)
- self.loop.RunUntilIdle()
- self.assertEquals(len(array), 1)
-
- def testCurrent(self):
- self.assertEquals(system.RunLoop.Current(), self.loop)
- self.loop = None
- self.assertIsNone(system.RunLoop.Current())
« no previous file with comments | « mojo/python/tests/promise_unittest.py ('k') | mojo/python/tests/system_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698