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

Unified Diff: tools/chrome_remote_control/chrome_remote_control/util.py

Issue 11361165: [chrome_remote_control] Rename chrome_remote_control to telemetry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: tools/chrome_remote_control/chrome_remote_control/util.py
diff --git a/tools/chrome_remote_control/chrome_remote_control/util.py b/tools/chrome_remote_control/chrome_remote_control/util.py
deleted file mode 100644
index f74e4dbe259e2d5c38258b49a5414f2bbec64389..0000000000000000000000000000000000000000
--- a/tools/chrome_remote_control/chrome_remote_control/util.py
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-import inspect
-import time
-
-class TimeoutException(Exception):
- pass
-
-def WaitFor(condition,
- timeout, poll_interval=0.1,
- pass_time_left_to_func=False):
- assert isinstance(condition, type(lambda: None)) # is function
- start_time = time.time()
- while True:
- if pass_time_left_to_func:
- res = condition((start_time + timeout) - time.time())
- else:
- res = condition()
- if res:
- break
- if time.time() - start_time > timeout:
- if condition.__name__ == '<lambda>':
- try:
- condition_string = inspect.getsource(condition).strip()
- except IOError:
- condition_string = condition.__name__
- else:
- condition_string = condition.__name__
- raise TimeoutException('Timed out while waiting %ds for %s.' %
- (timeout, condition_string))
- time.sleep(poll_interval)

Powered by Google App Engine
This is Rietveld 408576698