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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater.py

Issue 2247923002: Refactoring: Extract a method _copy_resources_to_wpt in deps_updater.py. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Edited comment to remove unnecessary words. Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 dd0eef76a3a324c7993ef85f4356327ecb1f4d6c..d47d0b3b0a3632b8fd69748709e8fc7a4161cd81 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:
@@ -121,6 +109,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 resources in our repository that we use 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.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698