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

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

Issue 10823105: Extensions Docs Server: Preview server and more integration tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/integration_test.py
diff --git a/chrome/common/extensions/docs/server2/integration_test.py b/chrome/common/extensions/docs/server2/integration_test.py
index 5508d63c202e2d3d595ccd0a50da35a2ed6dc471..4ccf97594e7f5474f9c806e4530d84111b593998 100755
--- a/chrome/common/extensions/docs/server2/integration_test.py
+++ b/chrome/common/extensions/docs/server2/integration_test.py
@@ -7,13 +7,15 @@ import os
from StringIO import StringIO
import unittest
+import appengine_memcache as memcache
+import handler
from handler import Handler
KNOWN_FAILURES = [
'webstore.html',
]
-class _MockResponse:
+class _MockResponse(object):
def __init__(self):
self.status = 200
self.out = StringIO()
@@ -21,7 +23,7 @@ class _MockResponse:
def set_status(self, status):
self.status = status
-class _MockRequest:
+class _MockRequest(object):
def __init__(self, path):
self.headers = {}
self.path = path
@@ -44,5 +46,19 @@ class IntegrationTest(unittest.TestCase):
self.assertEqual(404, bad_response.status)
self.assertTrue(bad_response.out.getvalue())
+ def testWarmupRequest(self):
+ for branch in ['dev', 'trunk', 'beta', 'stable']:
+ handler.BRANCH_UTILITY_MEMCACHE.Set(
+ branch + '.' + handler.OMAHA_PROXY_URL,
+ 'local',
+ memcache.MEMCACHE_BRANCH_UTILITY)
+ request = _MockRequest('_ah/warmup')
+ response = _MockResponse()
+ Handler(request, response, local_path='../..').get()
+ self.assertEqual(200, response.status)
+ # Test that the pages were rendered by checking the size of the output.
+ # In python 2.6 there is no 'assertGreater' method.
+ self.assertTrue(len(response.out.getvalue()) > 500000)
+
if __name__ == '__main__':
unittest.main()

Powered by Google App Engine
This is Rietveld 408576698