summaryrefslogtreecommitdiff
path: root/chromium/tools/polymer
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/tools/polymer
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/tools/polymer')
-rw-r--r--chromium/tools/polymer/polymer.py11
-rwxr-xr-xchromium/tools/polymer/polymer_test.py74
2 files changed, 55 insertions, 30 deletions
diff --git a/chromium/tools/polymer/polymer.py b/chromium/tools/polymer/polymer.py
index eb5bc2037d5..e7567239658 100644
--- a/chromium/tools/polymer/polymer.py
+++ b/chromium/tools/polymer/polymer.py
@@ -82,11 +82,14 @@ _chrome_redirects = {
'chrome://resources/polymer/v1_0/': POLYMER_V1_DIR,
'chrome://resources/html/': 'ui/webui/resources/html/',
'chrome://resources/cr_elements/': 'ui/webui/resources/cr_elements/',
+ '//resources/polymer/v1_0/': POLYMER_V1_DIR,
+ '//resources/html/': 'ui/webui/resources/html/',
+ '//resources/cr_elements/': 'ui/webui/resources/cr_elements/',
}
_chrome_reverse_redirects = {
- POLYMER_V3_DIR: 'chrome://resources/polymer/v3_0/',
- 'ui/webui/resources/': 'chrome://resources/',
+ POLYMER_V3_DIR: '//resources/polymer/v3_0/',
+ 'ui/webui/resources/': '//resources/',
}
@@ -104,8 +107,8 @@ class Dependency:
self.html_file = src
self.html_path = dst
- self.input_format = (
- 'chrome' if self.html_path.startswith('chrome://') else 'relative')
+ self.input_format = ('chrome' if self.html_path.startswith('chrome://')
+ or self.html_path.startswith('//') else 'relative')
self.output_format = self.input_format
self.html_path_normalized = self._to_html_normalized()
diff --git a/chromium/tools/polymer/polymer_test.py b/chromium/tools/polymer/polymer_test.py
index 5822bbaa74b..f48d5943847 100755
--- a/chromium/tools/polymer/polymer_test.py
+++ b/chromium/tools/polymer/polymer_test.py
@@ -154,32 +154,54 @@ class PolymerModulizerTest(unittest.TestCase):
self.assertEquals(expected_js, actual_js)
cases = [
- # Relative paths cases.
- # Case where relative path to polymer.html is used.
- ['../../html/polymer.html',
- 'import {Polymer, html} from \'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js\';'
- ],
- # Case where relative path to file in the same folder is used.
- ['foo.html', 'import \'./foo.m.js\';'],
- # Case where relative path to file in the same subtree is used.
- ['path/to/subfolder/foo.html', 'import \'./path/to/subfolder/foo.m.js\';'],
- # Case where relative path to file in ui/webui/resources/html/ is used.
- ['../../html/foo.html', 'import {Foo} from \'../../js/foo.m.js\';'],
-
- # chrome:// paths cases.
- # Case where absolute path to a Polymer UI element is used.
- ['chrome://resources/polymer/v1_0/path/to/folder/foo.html',
- 'import \'chrome://resources/polymer/v3_0/path/to/folder/foo.js\';'
- ],
- # Case where chrome:// path to polymer.html is used.
- ['chrome://resources/html/polymer.html',
- 'import {Polymer, html} from \'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js\';'
- ],
- # Case where chrome://resources/html/ path to something other than
- # polymer.html is used.
- ['chrome://resources/html/bar.html',
- 'import \'chrome://resources/js/bar.m.js\';'
- ],
+ # Relative paths cases.
+ # Case where relative path to polymer.html is used.
+ [
+ '../../html/polymer.html',
+ 'import {Polymer, html} from \'//resources/polymer/v3_0/polymer/polymer_bundled.min.js\';'
+ ],
+ # Case where relative path to file in the same folder is used.
+ ['foo.html', 'import \'./foo.m.js\';'],
+ # Case where relative path to file in the same subtree is used.
+ [
+ 'path/to/subfolder/foo.html',
+ 'import \'./path/to/subfolder/foo.m.js\';'
+ ],
+ # Case where relative path to file in ui/webui/resources/html/ is used.
+ ['../../html/foo.html', 'import {Foo} from \'../../js/foo.m.js\';'],
+
+ # chrome:// paths cases.
+ # Case where absolute path to a Polymer UI element is used.
+ [
+ 'chrome://resources/polymer/v1_0/path/to/folder/foo.html',
+ 'import \'//resources/polymer/v3_0/path/to/folder/foo.js\';'
+ ],
+ # Case where chrome:// path to polymer.html is used.
+ [
+ 'chrome://resources/html/polymer.html',
+ 'import {Polymer, html} from \'//resources/polymer/v3_0/polymer/polymer_bundled.min.js\';'
+ ],
+ # Case where chrome://resources/html/ path to something other than
+ # polymer.html is used.
+ [
+ 'chrome://resources/html/bar.html',
+ 'import \'//resources/js/bar.m.js\';'
+ ],
+
+ # Scheme-relative paths cases.
+ # Case where absolute path to a Polymer UI element is used.
+ [
+ '//resources/polymer/v1_0/path/to/folder/foo.html',
+ 'import \'//resources/polymer/v3_0/path/to/folder/foo.js\';'
+ ],
+ # Case where path to polymer.html is used.
+ [
+ '//resources/html/polymer.html',
+ 'import {Polymer, html} from \'//resources/polymer/v3_0/polymer/polymer_bundled.min.js\';'
+ ],
+ # Case where //resources/html/ path to something other than
+ # polymer.html is used.
+ ['//resources/html/bar.html', 'import \'//resources/js/bar.m.js\';'],
]
for [html, js_expected] in cases: