Commit 08d8c3d2 authored by David Bertoni's avatar David Bertoni Committed by Commit Bot

Fixed a test breakage since rendering may return a 302 instead of a 200. Fixed...

Fixed a test breakage since rendering may return a 302 instead of a 200. Fixed some incorrect closing header tags.

Bug: 821544
Change-Id: I60b4f710a8e7b183550e3f72d7e75dfb964b83bf
Reviewed-on: https://chromium-review.googlesource.com/963082Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Commit-Queue: David Bertoni <dbertoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543838}
parent 1f76c848
......@@ -166,12 +166,15 @@ class IntegrationTest(unittest.TestCase):
path = path_without_ext
def check_result(response):
self.assertEqual(200, response.status,
'Got %s when rendering %s' % (response.status, path))
# TODO(dbertoni@chromium.org): Explore following redirects and/or
# keeping an explicit list of files that expect 200 vs. 302.
self.assertTrue(response.status == 200 or response.status == 302,
'Got %s when rendering %s' % (response.status, path))
# This is reaaaaally rough since usually these will be tiny templates
# that render large files. At least it'll catch zero-length responses.
self.assertTrue(len(response.content) >= len(content),
self.assertTrue(len(response.content) >= len(content) or
response.status == 302,
'Rendered content length was %s vs template content length %s '
'when rendering %s' % (len(response.content), len(content), path))
......@@ -247,8 +250,9 @@ class IntegrationTest(unittest.TestCase):
start_time = time.time()
try:
response = LocalRenderer.Render(_ToPosixPath(filename))
self.assertEqual(200, response.status)
self.assertTrue(response.content != '')
self.assertTrue(response.status == 200 or response.status == 302,
'Got %s when rendering %s' % (response.status, path))
self.assertTrue(response.content != '' or response.status == 302)
finally:
print('Took %s seconds' % (time.time() - start_time))
......
......@@ -82,7 +82,7 @@
Keep the <code>.pem</code> file in a secret and secure place;
it will be needed to <a href="#update">update</a> the extension.
</p>
<h3 id="update">Update a .crx package</h2>
<h3 id="update">Update a .crx package</h3>
<p>
Update an extension's <code>.crx</code> file
......@@ -136,7 +136,7 @@
chrome.exe --pack-extension=C:\myext --pack-extension-key=C:\myext.pem
</pre>
<h2 id="hosting">Hosting</h1>
<h2 id="hosting">Hosting</h2>
<p>
A server that hosts <code>.crx</code> files
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment