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

Side by Side Diff: third_party/twisted_8_1/twisted/internet/test/test_gtk2reactor.py

Issue 12261012: Remove third_party/twisted_8_1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 # Copyright (c) 2008 Twisted Matrix Laboratories.
2 # See LICENSE for details.
3
4 """
5 Tests for L{twisted.internet.gtk2reactor}.
6 """
7
8 from twisted.trial.unittest import TestCase
9
10
11 class Gtk2ReactorTests(TestCase):
12 """
13 Tests for L{twisted.internet.gtk2reactor.Gtk2Reactor}.
14 """
15 def test_stopWhenRunning(self):
16 """
17 When C{reactor.stop} is scheduled with C{callWhenRunning},
18 C{reactor.run} will return immediately, and without processing any
19 timed events.
20 """
21 # This test *should* be part of a general reactor test suite that runs
22 # tests cases against all reactor implementations.
23 missed = []
24 def calledTooLate():
25 missed.append(True)
26 reactor.crash()
27 reactor = Gtk2Reactor(useGtk=False)
28 reactor.callWhenRunning(reactor.stop)
29 reactor.callLater(0, calledTooLate)
30 reactor.run(installSignalHandlers=False)
31 # XXX This explicit calls to clean up the waker should become obsolete
32 # when bug #3063 is fixed. -radix, 2008-02-29. Fortunately it should
33 # probably cause an error when bug #3063 is fixed, so it should be
34 # removed in the same branch that fixes it.
35 reactor.removeReader(reactor.waker)
36 reactor.waker.connectionLost(None)
37 if missed == [True]:
38 self.fail("callWhenRunning reactor.stop did not take effect")
39
40 try:
41 from twisted.internet.gtk2reactor import Gtk2Reactor
42 except ImportError:
43 Gtk2ReactorTests.skip = "gtk2reactor is unavailable"
OLDNEW
« no previous file with comments | « third_party/twisted_8_1/twisted/internet/test/__init__.py ('k') | third_party/twisted_8_1/twisted/internet/test/test_iocp.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698