OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 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 argparse | 6 import argparse |
7 import hashlib | 7 import hashlib |
8 import os | 8 import os |
9 import subprocess | 9 import subprocess |
10 import sys | 10 import sys |
11 import tempfile | 11 import tempfile |
12 | 12 |
13 SNAPSHOT_TEST_DIR = os.path.dirname(os.path.abspath(__file__)) | 13 SNAPSHOT_TEST_DIR = os.path.dirname(os.path.abspath(__file__)) |
14 SRC_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname( | 14 SRC_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname( |
15 SNAPSHOT_TEST_DIR)))) | 15 SNAPSHOT_TEST_DIR)))) |
16 DART_DIR = os.path.join(SRC_ROOT, 'dart') | 16 DART_DIR = os.path.join(SRC_ROOT, 'mojo', 'public', 'third_party', 'dart') |
17 | 17 |
18 VM_SNAPSHOT_FILES=[ | 18 VM_SNAPSHOT_FILES=[ |
19 # Header files. | 19 # Header files. |
20 'datastream.h', | 20 'datastream.h', |
21 'object.h', | 21 'object.h', |
22 'raw_object.h', | 22 'raw_object.h', |
23 'snapshot.h', | 23 'snapshot.h', |
24 'snapshot_ids.h', | 24 'snapshot_ids.h', |
25 'symbols.h', | 25 'symbols.h', |
26 # Source files. | 26 # Source files. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 snapshot_file.seek(20) | 74 snapshot_file.seek(20) |
75 actual_hash = snapshot_file.read(32) | 75 actual_hash = snapshot_file.read(32) |
76 if not actual_hash == expected_hash: | 76 if not actual_hash == expected_hash: |
77 print ('wrong hash: actual = %s, expected = %s' | 77 print ('wrong hash: actual = %s, expected = %s' |
78 % (actual_hash, expected_hash)) | 78 % (actual_hash, expected_hash)) |
79 return 1 | 79 return 1 |
80 return 0 | 80 return 0 |
81 | 81 |
82 if __name__ == '__main__': | 82 if __name__ == '__main__': |
83 sys.exit(main()) | 83 sys.exit(main()) |
OLD | NEW |