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

Unified Diff: chrome/common/extensions/docs/server2/appengine_wrappers.py

Issue 600073002: Docserver: Run tasks in testing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months 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
« no previous file with comments | « no previous file | chrome/common/extensions/docs/server2/integration_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/docs/server2/appengine_wrappers.py
diff --git a/chrome/common/extensions/docs/server2/appengine_wrappers.py b/chrome/common/extensions/docs/server2/appengine_wrappers.py
index d3ac930ebc79c188fd1c05e36307d6b4bde9a61b..4c5543938dba027ced7659225c45013081a9419d 100644
--- a/chrome/common/extensions/docs/server2/appengine_wrappers.py
+++ b/chrome/common/extensions/docs/server2/appengine_wrappers.py
@@ -277,19 +277,36 @@ except ImportError:
class BlobReferenceProperty(object):
pass
- class FakeTaskQueue(object):
+ # Executes any queued tasks synchronously as they are queued.
+ _task_runner = None
+
+ def SetTaskRunnerForTest(task_runner):
+ global _task_runner
+ _task_runner = task_runner
+
+ class SynchronousTaskQueue(object):
class Task(object):
def __init__(self, url=None, params={}):
- pass
+ self.url_ = url
+ self.params_ = params
+
+ def GetUrl(self):
+ return self.url_
+
+ def GetCommit(self):
+ return self.params_.get('commit')
class Queue(object):
def __init__(self, name='default'):
pass
def add(self, task):
+ global _task_runner
+ if _task_runner:
+ _task_runner(task.GetUrl(), task.GetCommit())
return _RPC()
def purge(self):
return _RPC()
- taskqueue = FakeTaskQueue()
+ taskqueue = SynchronousTaskQueue()
« no previous file with comments | « no previous file | chrome/common/extensions/docs/server2/integration_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698