| Index: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py
|
| diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py
|
| index b739d1dc809046dc84a7a795d540023b9e047d67..2fdf11717b1a1bb7a1a99f0dc501d1dd6928997d 100644
|
| --- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py
|
| +++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py
|
| @@ -36,6 +36,7 @@ import difflib
|
| import errno
|
| import functools
|
| import json
|
| +import hashlib
|
| import logging
|
| import optparse
|
| import re
|
| @@ -739,8 +740,32 @@ class Port(object):
|
|
|
| @memoized
|
| def _wpt_manifest(self):
|
| - path = self._filesystem.join(self.layout_tests_dir(), 'external', 'wpt', 'MANIFEST.json')
|
| - return json.loads(self._filesystem.read_text_file(path))
|
| + manifest_path = self._filesystem.join(self.layout_tests_dir(), 'external', 'wpt', 'MANIFEST.json')
|
| +
|
| + original_hash = self._get_manifest_hash(manifest_path)
|
| + self._generate_manifest()
|
| + updated_hash = self._get_manifest_hash(manifest_path)
|
| +
|
| + if original_hash != updated_hash:
|
| + _log.warning('MANIFEST.json has been updated to reflect changes in external/wpt!')
|
| +
|
| + return json.loads(self._filesystem.read_text_file(manifest_path))
|
| +
|
| + def _get_manifest_hash(self, manifest_path):
|
| + hash_context = hashlib.md5()
|
| +
|
| + manifest_buffer = self._filesystem.read_binary_file(manifest_path)
|
| + assert manifest_buffer
|
| +
|
| + hash_context.update(manifest_buffer)
|
| + return hash_context.hexdigest()
|
| +
|
| + def _generate_manifest(self):
|
| + wpt_path = self._webkit_finder.path_from_webkit_base('LayoutTests', 'external', 'wpt')
|
| + manifest_path = self._webkit_finder.path_from_webkit_base(
|
| + 'Tools', 'Scripts', 'webkitpy', 'thirdparty', 'wpt', 'wpt', 'manifest')
|
| + _log.info('Generating MANIFEST.json')
|
| + self._executive.run_command([manifest_path, '--work', '--tests-root', wpt_path])
|
|
|
| def _manifest_items_for_path(self, path_in_wpt):
|
| """Returns a manifest item for the given WPT path, or None if not found.
|
|
|