Skip to content

Commit 8bc2adf

Browse files
committed
Private timeout handler
- Improved test
1 parent 2b3dc1a commit 8bc2adf

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

docs/com.dtmilano.android.adb.adbclient.AdbClient-class.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,10 @@ <h1 class="epydoc">Class AdbClient</h1><p class="nomargin-top"><span class="code
137137
</td><td class="summary">
138138
<table width="100%" cellpadding="0" cellspacing="0" border="0">
139139
<tr>
140-
<td><span class="summary-sig"><a name="timeoutHandler"></a><span class="summary-sig-name">timeoutHandler</span>(<span class="summary-sig-arg">self</span>,
140+
<td><span class="summary-sig"><a name="__timeoutHandler"></a><span class="summary-sig-name">__timeoutHandler</span>(<span class="summary-sig-arg">self</span>,
141141
<span class="summary-sig-arg">timerId</span>)</span></td>
142142
<td align="right" valign="top">
143-
<span class="codelink"><a href="com.dtmilano.android.adb.adbclient-pysrc.html#AdbClient.timeoutHandler">source&nbsp;code</a></span>
143+
<span class="codelink"><a href="com.dtmilano.android.adb.adbclient-pysrc.html#AdbClient.__timeoutHandler">source&nbsp;code</a></span>
144144

145145
</td>
146146
</tr>

docs/identifier-index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1930,7 +1930,7 @@ <h1 class="epydoc">Identifier Index</h1>
19301930
<span class="index-where">(in&nbsp;<a href="com.dtmilano.android.viewclient.EditText-class.html">EditText</a>)</span></td>
19311931
</tr>
19321932
<tr>
1933-
<td width="33%" class="link-index"><a href="com.dtmilano.android.adb.adbclient.AdbClient-class.html#timeoutHandler">timeoutHandler()</a><br />
1933+
<td width="33%" class="link-index"><a href="com.dtmilano.android.adb.adbclient.AdbClient-class.html#__timeoutHandler">__timeoutHandler()</a><br />
19341934
<span class="index-where">(in&nbsp;<a href="com.dtmilano.android.adb.adbclient.AdbClient-class.html">AdbClient</a>)</span></td>
19351935
<td width="33%" class="link-index"><a href="com.dtmilano.android.culebron.Operation-class.html#TOUCH_POINT">TOUCH_POINT</a><br />
19361936
<span class="index-where">(in&nbsp;<a href="com.dtmilano.android.culebron.Operation-class.html">Operation</a>)</span></td>

src/com/dtmilano/android/adb/adbclient.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def __init__(self, serialno=None, hostname=HOSTNAME, port=PORT, settransport=Tru
198198
self.build[VERSION_SDK_PROPERTY] = int(self.__getProp(VERSION_SDK_PROPERTY))
199199
self.initDisplayProperties()
200200

201-
def timeoutHandler(self, timerId, description=None):
201+
def __timeoutHandler(self, timerId, description=None):
202202
if DEBUG:
203203
print >> sys.stderr, "\nTIMEOUT HANDLER", timerId, ':', description
204204
self.timers[timerId] = "EXPIRED"
@@ -213,7 +213,7 @@ def setTimer(self, timeout, description=None):
213213
:return: the timerId
214214
"""
215215
self.timerId += 1
216-
timer = Timer(timeout, self.timeoutHandler, (self.timerId, description))
216+
timer = Timer(timeout, self.__timeoutHandler, (self.timerId, description))
217217
timer.start()
218218
self.timers[self.timerId] = timer
219219
return self.timerId

tests/com/dtmilano/android/viewclient_with_real_devices_connected.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,11 @@ def setUpClass(cls):
4040
- emulator-5554
4141
- emulator-5556
4242
'''
43-
print >> sys.stderr, "path = ", sys.path
4443
if ViewClientTest.CONNECT_EMULATORS:
45-
sys.argv = ['testViewClient_localPort_remotePort', ViewClientTest.serialno1]
44+
sys.argv = ['testViewClient_localPort_remotePort', cls.serialno1]
4645
cls.device1, cls.serialno1 = ViewClient.connectToDeviceOrExit(timeout=30)
4746

48-
sys.argv = ['testViewClient_localPort_remotePort', ViewClientTest.serialno2]
47+
sys.argv = ['testViewClient_localPort_remotePort', cls.serialno2]
4948
cls.device2, cls.serialno2 = ViewClient.connectToDeviceOrExit(timeout=30)
5049

5150
def setUp(self):
@@ -101,6 +100,7 @@ def testViewClient_oneDevice_TwoViewClients(self):
101100

102101
def testViewClient_device_disconnected(self):
103102
# Script gets stuck on ViewClient(device, serial) #243
103+
# This cannot run on emulator because we have to disconnect the USB or network
104104
d, s = ViewClient.connectToDeviceOrExit()
105105
self.assertIsNotNone(d)
106106
self.assertIsNotNone(s)

0 commit comments

Comments
 (0)