Chromium Code Reviews| Index: third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater.py |
| diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater.py |
| index d14aef7ad17c4c5994e4a4c821b27c861a36a925..65afc005a055cfe93bed496dfb9dfd895ef04954 100644 |
| --- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater.py |
| +++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater.py |
| @@ -52,19 +52,7 @@ class DepsUpdater(object): |
| if self.target == 'wpt': |
| import_commitish = self.update(WPT_DEST_NAME, WPT_REPO_URL) |
| - |
| - for resource in ['testharnessreport.js', 'WebIDLParser.js']: |
| - source = self.path_from_webkit_base('LayoutTests', 'resources', resource) |
| - destination = self.path_from_webkit_base('LayoutTests', 'imported', WPT_DEST_NAME, 'resources', resource) |
| - self.copyfile(source, destination) |
| - self.run(['git', 'add', destination]) |
| - |
| - for resource in ['vendor-prefix.js']: |
| - source = self.path_from_webkit_base('LayoutTests', 'resources', resource) |
| - destination = self.path_from_webkit_base('LayoutTests', 'imported', WPT_DEST_NAME, 'common', resource) |
| - self.copyfile(source, destination) |
| - self.run(['git', 'add', destination]) |
| - |
| + self._copy_resources_to_wpt() |
| elif self.target == 'css': |
| import_commitish = self.update(CSS_DEST_NAME, WPT_REPO_URL) |
| else: |
| @@ -137,6 +125,23 @@ class DepsUpdater(object): |
| return True |
| + def _copy_resources_to_wpt(self): |
| + """Copies some files over to a newly-updated wpt directory. |
| + |
| + There are some resource files in our repository that we want to use |
|
Dirk Pranke
2016/08/17 00:02:43
One last nit: s/There are some resource/These are/
|
| + instead of the upstream versions. |
| + """ |
| + resources_to_copy = [ |
| + ('testharnessreport.js', 'resources'), |
| + ('WebIDLParser.js', 'resources'), |
| + ('vendor-prefix.js', 'common'), |
| + ] |
| + for filename, wpt_subdir in resources_to_copy: |
| + source = self.path_from_webkit_base('LayoutTests', 'resources', filename) |
| + destination = self.path_from_webkit_base('LayoutTests', 'imported', WPT_DEST_NAME, wpt_subdir, filename) |
| + self.copyfile(source, destination) |
| + self.run(['git', 'add', destination]) |
| + |
| def update(self, dest_dir_name, url): |
| """Updates an imported repository. |