Home | Trees | Indices | Help |
---|
|
1 # Elisa - Home multimedia server 2 # Copyright (C) 2006-2008 Fluendo Embedded S.L. (www.fluendo.com). 3 # All rights reserved. 4 # 5 # This file is available under one of two license agreements. 6 # 7 # This file is licensed under the GPL version 3. 8 # See "LICENSE.GPL" in the root of this distribution including a special 9 # exception to use Elisa with Fluendo's plugins. 10 # 11 # The GPL part of Elisa is also available under a commercial licensing 12 # agreement from Fluendo. 13 # See "LICENSE.Elisa" in the root directory of this distribution package 14 # for details on that license. 15 16 from elisa.core.tests.elisa_test_case import ElisaTestCase 17 from elisa.base_components import input_provider 18 from elisa.core import input_manager, input_event 19 from elisa.core import plugin, plugin_registry, config 20 from elisa.core import common 21 from twisted.internet import reactor 22 from elisa.core.tests.test_input_provider import MousePollInputProvider, \ 23 MousePushInputProvider 24269028 ElisaTestCase.setUp(self) 29 self._input_manager = input_manager.InputManager() 30 #self._input_manager.start() 31 self._called = {self.mouse_upped:False, 32 self.mouse_down: False}3335 if event.type == input_event.EventType.MOUSE_UP: 36 self.mouse_upped(event) 37 elif event.type == input_event.EventType.MOUSE_DOWN: 38 self.mouse_down(event)3941 self.assertEquals(event.type, input_event.EventType.MOUSE_UP) 42 self.assertEquals(event.value, input_event.EventValue.MOUSE_LEFT) 43 self._called[self.mouse_upped] = True4446 self.assertEquals(event.type, input_event.EventType.MOUSE_DOWN) 47 self.assertEquals(event.value, input_event.EventValue.MOUSE_LEFT) 48 self._called[self.mouse_down] = True4951 #import pdb; pdb.set_trace() 52 self._called[self.mouse_upped] = False 53 self._called[self.mouse_down] = False 54 self._input_manager.subscribe(component.path, self.mouse_triggerred)55 5860 """ 61 """ 62 mouse_poll = MousePollInputProvider() 63 mouse_poll.path = 'mouse_poll_input_provider' 64 self._input_manager.register_component(mouse_poll) 65 66 self._connect(mouse_poll) 67 68 self._input_manager._poll_events() 69 self.assertEquals(self._called[self.mouse_upped], True) 70 self.assertEquals(self._called[self.mouse_down], True) 71 72 self._disconnect(mouse_poll) 73 self._input_manager.unregister_component(mouse_poll)7476 """ 77 """ 78 mouse_push = MousePushInputProvider() 79 mouse_push.path = 'mouse_push_input_provider' 80 self._input_manager.register_component(mouse_push) 81 82 self._connect(mouse_push) 83 84 mouse_push.trigger_some_events() 85 self.assertEquals(self._called[self.mouse_upped], True) 86 self.assertEquals(self._called[self.mouse_down], True) 87 88 self._disconnect(mouse_push) 89 self._input_manager.unregister_component(mouse_push)
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0beta1 on Wed Jan 16 19:10:12 2008 | http://epydoc.sourceforge.net |