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

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

Issue 15087006: Docserver: there is only one. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: epic rebase Created 7 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 ea7f305a1e6c81634e4b7df5bdc86b7fc2aeed04..4721c3b6da336b275e055d1375d017a48c9156f1 100755
--- a/chrome/common/extensions/docs/server2/integration_test.py
+++ b/chrome/common/extensions/docs/server2/integration_test.py
@@ -12,10 +12,12 @@ from itertools import groupby
from operator import itemgetter
import optparse
import os
+import posixpath
import sys
import time
import unittest
+from branch_utility import BranchUtility
from link_error_detector import LinkErrorDetector
from local_file_system import LocalFileSystem
from local_renderer import LocalRenderer
@@ -124,7 +126,23 @@ class IntegrationTest(unittest.TestCase):
# that render large files. At least it'll catch zero-length responses.
self.assertTrue(len(response.content) >= len(content),
'Content was "%s" when rendering %s' % (response.content, path))
+
check_result(Handler(Request.ForTest(path)).Get())
+
+ # Make sure that leaving out the .html will temporarily redirect to the
+ # path with the .html.
+ if path != '/404.html':
+ redirect_result = Handler(
+ Request.ForTest(posixpath.splitext(path)[0])).Get()
+ self.assertEqual((path, False), redirect_result.GetRedirect())
+
+ # Make sure including a channel will permanently redirect to the same
+ # path without a channel.
+ for channel in BranchUtility.GetAllChannelNames():
+ redirect_result = Handler(
+ Request.ForTest('%s/%s' % (channel, path))).Get()
+ self.assertEqual((path, True), redirect_result.GetRedirect())
+
# Samples are internationalized, test some locales.
if path.endswith('/samples.html'):
for lang in ['en-US', 'es', 'ar']:

Powered by Google App Engine
This is Rietveld 408576698