Commit 2c84ff5d authored by dpapad's avatar dpapad Committed by Chromium LUCI CQ

WebUI: Delete obsolete ShadowDOM v0 logic from polymer_browser_test_base.js

Bug: None
Change-Id: Ib7791d9a5a46f07d733c8926973cc45a797c2f33
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2587567
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Auto-Submit: dpapad <dpapad@chromium.org>
Reviewed-by: default avatarRebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#836893}
parent d088bdc7
...@@ -43,43 +43,6 @@ PolymerTest.prototype = { ...@@ -43,43 +43,6 @@ PolymerTest.prototype = {
'//third_party/polymer/v1_0/components-chromium/iron-test-helpers/' + '//third_party/polymer/v1_0/components-chromium/iron-test-helpers/' +
'mock-interactions.js', 'mock-interactions.js',
], ],
/** @override */
setUp: function() {
testing.Test.prototype.setUp.call(this);
// List of imported URLs for debugging purposes.
PolymerTest.importUrls_ = [];
PolymerTest.scriptUrls_ = [];
// Importing a URL like "chrome://settings/foo" redirects to the base
// ("chrome://settings") page, which due to how browsePreload works can
// result in duplicate imports. Wrap document.registerElement so failures
// caused by re-registering Polymer elements are caught; otherwise Chrome
// simply throws "Script error" which is unhelpful.
var originalRegisterElement = document.registerElement;
document.registerElement = function() {
try {
return originalRegisterElement.apply(document, arguments);
} catch (e) {
var msg =
'If the call to document.registerElement failed because a type ' +
'is already registered, perhaps you have loaded a script twice. ' +
'Incorrect resource URLs can redirect to base WebUI pages; make ' +
'sure the following URLs are correct and unique:\n';
for (var i = 0; i < PolymerTest.importUrls_.length; i++) {
msg += ' ' + PolymerTest.importUrls_[i] + '\n';
}
for (var i = 0; i < PolymerTest.scriptUrls_.length; i++) {
msg += ' ' + PolymerTest.scriptUrls_[i] + '\n';
}
console.error(msg);
// Mocha will handle the error.
throw e;
}
};
},
}; };
/** /**
...@@ -88,7 +51,6 @@ PolymerTest.prototype = { ...@@ -88,7 +51,6 @@ PolymerTest.prototype = {
* @return {!Promise} A promise that is resolved/rejected on success/failure. * @return {!Promise} A promise that is resolved/rejected on success/failure.
*/ */
PolymerTest.importHtml = function(src) { PolymerTest.importHtml = function(src) {
PolymerTest.importUrls_.push(src);
var link = document.createElement('link'); var link = document.createElement('link');
link.rel = 'import'; link.rel = 'import';
var promise = new Promise(function(resolve, reject) { var promise = new Promise(function(resolve, reject) {
...@@ -100,23 +62,6 @@ PolymerTest.importHtml = function(src) { ...@@ -100,23 +62,6 @@ PolymerTest.importHtml = function(src) {
return promise; return promise;
}; };
/**
* Loads the script file.
* @param {string} src The URL to load.
* @return {!Promise} A promise that is resolved/rejected on success/failure.
*/
PolymerTest.loadScript = function(src) {
PolymerTest.scriptUrls_.push(src);
var script = document.createElement('script');
var promise = new Promise(function(resolve, reject) {
script.onload = resolve;
script.onerror = reject;
});
script.src = src;
document.head.appendChild(script);
return promise;
};
/** /**
* Removes all content from the body. In a vulcanized build, this retains the * Removes all content from the body. In a vulcanized build, this retains the
* inlined tags so stylesheets and dom-modules are not discarded. * inlined tags so stylesheets and dom-modules are not discarded.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment