| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 # Copyright (c) 2012 Google Inc. All rights reserved. | 3 # Copyright (c) 2012 Google Inc. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 """ | 7 """ |
| 8 Verifies that app bundles are built correctly. | 8 Verifies that app bundles are built correctly. |
| 9 """ | 9 """ |
| 10 | 10 |
| 11 from __future__ import print_function |
| 12 |
| 11 import TestGyp | 13 import TestGyp |
| 12 import TestMac | 14 import TestMac |
| 13 | 15 |
| 14 import os | 16 import os |
| 15 import plistlib | 17 import plistlib |
| 16 import subprocess | 18 import subprocess |
| 17 import sys | 19 import sys |
| 18 | 20 |
| 19 | 21 |
| 20 if sys.platform in ('darwin', 'win32'): | 22 if sys.platform in ('darwin', 'win32'): |
| 21 print "This test is currently disabled: https://crbug.com/483696." | 23 print("This test is currently disabled: https://crbug.com/483696.") |
| 22 sys.exit(0) | 24 sys.exit(0) |
| 23 | 25 |
| 24 | 26 |
| 25 def CheckFileXMLPropertyList(file): | 27 def CheckFileXMLPropertyList(file): |
| 26 output = subprocess.check_output(['file', file]) | 28 output = subprocess.check_output(['file', file]) |
| 27 # The double space after XML is intentional. | 29 # The double space after XML is intentional. |
| 28 if not 'XML document text' in output: | 30 if not 'XML document text' in output: |
| 29 print 'File: Expected XML document text, got %s' % output | 31 print('File: Expected XML document text, got %s' % output) |
| 30 test.fail_test() | 32 test.fail_test() |
| 31 | 33 |
| 32 def ExpectEq(expected, actual): | 34 def ExpectEq(expected, actual): |
| 33 if expected != actual: | 35 if expected != actual: |
| 34 print >>sys.stderr, 'Expected "%s", got "%s"' % (expected, actual) | 36 print('Expected "%s", got "%s"' % (expected, actual), file=sys.stderr) |
| 35 test.fail_test() | 37 test.fail_test() |
| 36 | 38 |
| 37 def ls(path): | 39 def ls(path): |
| 38 '''Returns a list of all files in a directory, relative to the directory.''' | 40 '''Returns a list of all files in a directory, relative to the directory.''' |
| 39 result = [] | 41 result = [] |
| 40 for dirpath, _, files in os.walk(path): | 42 for dirpath, _, files in os.walk(path): |
| 41 for f in files: | 43 for f in files: |
| 42 result.append(os.path.join(dirpath, f)[len(path) + 1:]) | 44 result.append(os.path.join(dirpath, f)[len(path) + 1:]) |
| 43 return result | 45 return result |
| 44 | 46 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 set(['Contents/MacOS/Test App Gyp', | 113 set(['Contents/MacOS/Test App Gyp', |
| 112 'Contents/Info.plist', | 114 'Contents/Info.plist', |
| 113 'Contents/Resources/English.lproj/MainMenu.nib', | 115 'Contents/Resources/English.lproj/MainMenu.nib', |
| 114 'Contents/PkgInfo', | 116 'Contents/PkgInfo', |
| 115 ] + | 117 ] + |
| 116 [os.path.join('Contents/Resources/English.lproj', f) | 118 [os.path.join('Contents/Resources/English.lproj', f) |
| 117 for f in strings_files]): | 119 for f in strings_files]): |
| 118 test.fail_test() | 120 test.fail_test() |
| 119 | 121 |
| 120 test.pass_test() | 122 test.pass_test() |
| OLD | NEW |