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

Side by Side Diff: tools/binary_size/libsupersize/integration_test.py

Issue 2859383003: FREEZE.unindexed (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « tools/binary_size/libsupersize/describe.py ('k') | tools/binary_size/libsupersize/models.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2017 The Chromium Authors. All rights reserved. 2 # Copyright 2017 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 contextlib 6 import contextlib
7 import copy 7 import copy
8 import difflib 8 import difflib
9 import glob 9 import glob
10 import itertools 10 import itertools
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 return self._DoArchiveTest(debug_measures=True) 150 return self._DoArchiveTest(debug_measures=True)
151 151
152 @_CompareWithGolden() 152 @_CompareWithGolden()
153 def test_Console(self): 153 def test_Console(self):
154 with tempfile.NamedTemporaryFile(suffix='.size') as size_file, \ 154 with tempfile.NamedTemporaryFile(suffix='.size') as size_file, \
155 tempfile.NamedTemporaryFile(suffix='.txt') as output_file: 155 tempfile.NamedTemporaryFile(suffix='.txt') as output_file:
156 file_format.SaveSizeInfo(self._CloneSizeInfo(), size_file.name) 156 file_format.SaveSizeInfo(self._CloneSizeInfo(), size_file.name)
157 query = [ 157 query = [
158 'ShowExamples()', 158 'ShowExamples()',
159 'ExpandRegex("_foo_")', 159 'ExpandRegex("_foo_")',
160 'CategorizeGenerated()',
161 'CategorizeByChromeComponent()',
160 'Print(size_info, to_file=%r)' % output_file.name, 162 'Print(size_info, to_file=%r)' % output_file.name,
161 ] 163 ]
162 ret = _RunApp('console', [size_file.name, '--query', '; '.join(query)]) 164 ret = _RunApp('console', [size_file.name, '--query', '; '.join(query)])
163 with open(output_file.name) as f: 165 with open(output_file.name) as f:
164 ret.extend(l.rstrip() for l in f) 166 ret.extend(l.rstrip() for l in f)
165 return ret 167 return ret
166 168
167 @_CompareWithGolden() 169 @_CompareWithGolden()
168 def test_Diff_NullDiff(self): 170 def test_Diff_NullDiff(self):
169 with tempfile.NamedTemporaryFile(suffix='.size') as temp_file: 171 with tempfile.NamedTemporaryFile(suffix='.size') as temp_file:
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 global update_goldens 297 global update_goldens
296 update_goldens = True 298 update_goldens = True
297 for f in glob.glob(os.path.join(_TEST_DATA_DIR, '*.golden')): 299 for f in glob.glob(os.path.join(_TEST_DATA_DIR, '*.golden')):
298 os.unlink(f) 300 os.unlink(f)
299 301
300 unittest.main(argv=argv, verbosity=2) 302 unittest.main(argv=argv, verbosity=2)
301 303
302 304
303 if __name__ == '__main__': 305 if __name__ == '__main__':
304 main() 306 main()
OLDNEW
« no previous file with comments | « tools/binary_size/libsupersize/describe.py ('k') | tools/binary_size/libsupersize/models.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698