Skip to content
Snippets Groups Projects
Commit 9e1c5bcc authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#3045] Start/stop python glib mainloop for test suite

parent b9f2ee4b
No related branches found
No related tags found
No related merge requests found
...@@ -136,9 +136,12 @@ class SflPhoneTests(): ...@@ -136,9 +136,12 @@ class SflPhoneTests():
self.sflphone.start() self.sflphone.start()
# SCENARIO 1 Test 4 # SCENARIO 1 Test 4
def test_ip2ip_recv_peer_hungup(self): def test_ip2ip_recv_peer_hungup(self):
"""Wait for calls, answer, peer hangup""" """Wait for calls, answer, peer hangup"""
# Add callback for this test # Add callback for this test
self.sflphone.onIncomingCall_cb = acceptOnIncomingCall self.sflphone.onIncomingCall_cb = acceptOnIncomingCall
......
...@@ -71,10 +71,14 @@ class SflPhoneCtrlSimple(Thread): ...@@ -71,10 +71,14 @@ class SflPhoneCtrlSimple(Thread):
self.loop = MainLoop() self.loop = MainLoop()
self.isStop = False
self.test = test self.test = test
self.onIncomingCall_cb = None self.onIncomingCall_cb = None
self.event = Event() self.event = Event()
gobject.threads_init()
def __del__(self): def __del__(self):
...@@ -83,6 +87,12 @@ class SflPhoneCtrlSimple(Thread): ...@@ -83,6 +87,12 @@ class SflPhoneCtrlSimple(Thread):
self.loop.quit() self.loop.quit()
def stopThread(self):
print "Stop PySFLphone"
self.isStop = True
def register(self): def register(self):
if self.registered: if self.registered:
return return
...@@ -614,9 +624,11 @@ class SflPhoneCtrlSimple(Thread): ...@@ -614,9 +624,11 @@ class SflPhoneCtrlSimple(Thread):
def run(self): def run(self):
"""Processing method for this thread""" """Processing method for this thread"""
gobject.threads_init()
# self.loop.run()
context = self.loop.get_context() context = self.loop.get_context()
while 1: while True:
context.iteration(True) context.iteration(True)
if self.isStop:
return
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment