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

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

Issue 10828042: Extensions Docs Server: Integration testing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: refactor Created 8 years, 5 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
Index: chrome/common/extensions/docs/server2/appengine_url_fetcher.py
diff --git a/chrome/common/extensions/docs/server2/appengine_url_fetcher.py b/chrome/common/extensions/docs/server2/appengine_url_fetcher.py
index 7ccca1c1e73a9f64a0d394c2562af3a078697fd3..05025de4eb4d83b714d65d192f71483befeaaa5a 100644
--- a/chrome/common/extensions/docs/server2/appengine_url_fetcher.py
+++ b/chrome/common/extensions/docs/server2/appengine_url_fetcher.py
@@ -2,8 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-from google.appengine.api import urlfetch
-
from future import Future
class _AsyncFetchDelegate(object):
@@ -18,17 +16,18 @@ class AppEngineUrlFetcher(object):
"""A wrapper around the App Engine urlfetch module that allows for easy
async fetches.
"""
- def __init__(self, base_path):
+ def __init__(self, base_path, urlfetch):
self._base_path = base_path
+ self._urlfetch = urlfetch
not at google - send to devlin 2012/07/30 23:00:44 I think you can revert the changes to this file an
cduvall 2012/07/30 23:38:18 Done.
def Fetch(self, url):
"""Fetches a file synchronously.
"""
- return urlfetch.fetch(self._base_path + '/' + url)
+ return self._urlfetch.fetch(self._base_path + '/' + url)
def FetchAsync(self, url):
"""Fetches a file asynchronously, and returns a Future with the result.
"""
- rpc = urlfetch.create_rpc()
- urlfetch.make_fetch_call(rpc, self._base_path + '/' + url)
+ rpc = self._urlfetch.create_rpc()
+ self._urlfetch.make_fetch_call(rpc, self._base_path + '/' + url)
return Future(delegate=_AsyncFetchDelegate(rpc))

Powered by Google App Engine
This is Rietveld 408576698