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

Side by Side Diff: chrome/common/extensions/docs/server2/render_servlet_test.py

Issue 491653002: Docserver: Use GitilesFileSystem instead of SubversionFileSystem (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 unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2013 The Chromium Authors. All rights reserved. 2 # Copyright 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import unittest 6 import unittest
7 7
8 from extensions_paths import EXAMPLES, PUBLIC_TEMPLATES, STATIC_DOCS 8 from extensions_paths import EXAMPLES, PUBLIC_TEMPLATES, STATIC_DOCS
9 from local_file_system import LocalFileSystem 9 from local_file_system import LocalFileSystem
10 from render_servlet import RenderServlet 10 from render_servlet import RenderServlet
(...skipping 11 matching lines...) Expand all
22 def _Render(self, path, headers=None, host=None): 22 def _Render(self, path, headers=None, host=None):
23 return RenderServlet(Request.ForTest(path, headers=headers, host=host), 23 return RenderServlet(Request.ForTest(path, headers=headers, host=host),
24 _RenderServletDelegate()).Get() 24 _RenderServletDelegate()).Get()
25 25
26 def testExtensionAppRedirect(self): 26 def testExtensionAppRedirect(self):
27 self.assertEqual( 27 self.assertEqual(
28 Response.Redirect('/apps/storage', permanent=False), 28 Response.Redirect('/apps/storage', permanent=False),
29 self._Render('storage')) 29 self._Render('storage'))
30 30
31 def testChannelRedirect(self): 31 def testChannelRedirect(self):
32 for channel in ('stable', 'beta', 'dev', 'trunk'): 32 for channel in ('stable', 'beta', 'dev', 'master'):
33 self.assertEqual( 33 self.assertEqual(
34 Response.Redirect('/extensions/storage', permanent=True), 34 Response.Redirect('/extensions/storage', permanent=True),
35 self._Render('%s/extensions/storage' % channel)) 35 self._Render('%s/extensions/storage' % channel))
36 36
37 def testOldHostsRedirect(self): 37 def testOldHostsRedirect(self):
38 self.assertEqual( 38 self.assertEqual(
39 Response.Redirect('https://developer.chrome.com/extensions', 39 Response.Redirect('https://developer.chrome.com/extensions',
40 permanent=False), 40 permanent=False),
41 self._Render('/chrome/extensions', host='http://code.google.com')) 41 self._Render('/chrome/extensions', host='http://code.google.com'))
42 self.assertEqual( 42 self.assertEqual(
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 self.assertEqual(content_type, response.headers.get('Content-Type')) 146 self.assertEqual(content_type, response.headers.get('Content-Type'))
147 self.assertEqual(etag, response.headers.get('ETag')) 147 self.assertEqual(etag, response.headers.get('ETag'))
148 148
149 # Test with a static path and a dynamic path. 149 # Test with a static path and a dynamic path.
150 test_path('static/css/out/site.css', 'text/css; charset=utf-8') 150 test_path('static/css/out/site.css', 'text/css; charset=utf-8')
151 test_path('extensions/storage', 'text/html; charset=utf-8') 151 test_path('extensions/storage', 'text/html; charset=utf-8')
152 152
153 153
154 if __name__ == '__main__': 154 if __name__ == '__main__':
155 unittest.main() 155 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698