Commit f7b15503 authored by Sam Maier's avatar Sam Maier Committed by Commit Bot

grit: Removing option for compress = true

The plan was to migrate everything over to this, but it didn't happen.
Since there are no users of this, it's better to not support this anymore.
See https://chromium-review.googlesource.com/c/chromium/src/+/1803394/2
for an example of confusion with using compress = true.

Change-Id: Ib6d666c2a937c3e024ca5fde6b59eddbd560a13c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1825919
Auto-Submit: Sam Maier <smaier@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#700055}
parent c2ccc75c
......@@ -44,8 +44,8 @@ class Node(object):
def __init__(self):
self.children = [] # A list of child elements
self.mixed_content = [] # A list of u'' and/or child elements (this
# duplicates 'children' but
# is needed to preserve markup-type content).
# duplicates 'children' but
# is needed to preserve markup-type content).
self.name = u'' # The name of this element
self.attrs = {} # The set of attributes (keys to values)
self.parent = None # Our parent unless we are the root element.
......@@ -614,7 +614,7 @@ class Node(object):
The data in gzipped or brotli compressed format. If the format is
unspecified then this returns the data uncompressed.
'''
if self.attrs.get('compress') in ('gzip', 'true'):
if self.attrs.get('compress') == 'gzip':
# We only use rsyncable compression on Linux.
# We exclude ChromeOS since ChromeOS bots are Linux based but do not have
# the --rsyncable option built in for gzip. See crbug.com/617950.
......
......@@ -115,25 +115,6 @@ class StructureUnittest(unittest.TestCase):
os.path.join(test_data_root, 'test_text.txt'), util.BINARY),
decompressed_data)
def testCompressTrue(self):
test_data_root = util.PathFromRoot('grit/testdata')
root = util.ParseGrdForUnittest(
'''
<structures>
<structure name="TEST_TXT" file="test_text.txt"
compress="true" type="chrome_html" />
</structures>''',
base_dir=test_data_root)
node, = root.GetChildrenOfType(structure.StructureNode)
node.RunPreSubstitutionGatherer()
compressed = node.GetDataPackValue(lang='en', encoding=1)
decompressed_data = zlib.decompress(compressed, 16 + zlib.MAX_WBITS)
self.assertEqual(
util.ReadFile(
os.path.join(test_data_root, 'test_text.txt'), util.BINARY),
decompressed_data)
def testCompressBrotli(self):
test_data_root = util.PathFromRoot('grit/testdata')
root = util.ParseGrdForUnittest(
......
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