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

Side by Side Diff: chrome/test/pyautolib/timer_queue.py

Issue 8680018: Fix python scripts in src/chrome/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: copyright Created 9 years 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
1 #!/usr/bin/python
2
3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 3 # found in the LICENSE file.
6 4
7 import copy 5 import copy
8 import threading 6 import threading
9 import time 7 import time
10 8
11 class TimerQueue(threading.Thread): 9 class TimerQueue(threading.Thread):
12 """Executes timers at a given interval. 10 """Executes timers at a given interval.
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 self.timer_queue_lock.acquire() 76 self.timer_queue_lock.acquire()
79 for timer in self.timers: 77 for timer in self.timers:
80 if timer['next time'] <= now: 78 if timer['next time'] <= now:
81 # Use * to break the list into separate arguments 79 # Use * to break the list into separate arguments
82 timer['method'](*timer['args']) 80 timer['method'](*timer['args'])
83 timer['next time'] += timer['interval'] 81 timer['next time'] += timer['interval']
84 self.timer_queue_lock.release() 82 self.timer_queue_lock.release()
85 if self.terminate: 83 if self.terminate:
86 return 84 return
87 time.sleep(self.wait_time) 85 time.sleep(self.wait_time)
88
OLDNEW
« no previous file with comments | « chrome/test/pyautolib/remote_host.py ('k') | chrome/test/webdriver/test/chromedriver_factory.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698