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']: |