summaryrefslogtreecommitdiffstats
path: root/ui/webui
diff options
context:
space:
mode:
authormichaelpg <michaelpg@chromium.org>2016-03-14 12:21:42 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-14 19:23:17 +0000
commit7441ba884861e8483074a51a9a16b3f632526aa0 (patch)
tree495c7034cb8298e8f8d2d93f7b2eda02e8eee070 /ui/webui
parent2082ffeac7b24255684c99255c3c734edc52e1c0 (diff)
downloadchromium_src-7441ba884861e8483074a51a9a16b3f632526aa0.zip
chromium_src-7441ba884861e8483074a51a9a16b3f632526aa0.tar.gz
chromium_src-7441ba884861e8483074a51a9a16b3f632526aa0.tar.bz2
Use polymer_config.html instead of polymer.html
Polymer must be configured before loading. Several files imported polymer.html and not polymer_config.html. When these files are opened in a browser test, either: * polymer_config.html is never imported, so the test is run under shady DOM, or * the file indirectly imports polymer_config.html via its dependencies, causing the configuration to happen after Polymer is already loaded (an error) Using polymer_config.html in place of polymer.html will eliminate this problem, meaning one less error to debug when writing tests. Since every custom Polymer element should import polymer_config.html, we can just place the actual Polymer import in there. This CL applies this to MD Downloads, MD Settings, and cr_elements. Review URL: https://codereview.chromium.org/1767913002 Cr-Commit-Position: refs/heads/master@{#381036}
Diffstat (limited to 'ui/webui')
-rw-r--r--ui/webui/resources/cr_elements/cr_events/cr_events.html2
-rw-r--r--ui/webui/resources/cr_elements/cr_expand_button/cr_expand_button.html2
-rw-r--r--ui/webui/resources/cr_elements/cr_search_field/cr_search_field.html2
-rw-r--r--ui/webui/resources/cr_elements/cr_shared_menu/cr_shared_menu.html6
-rw-r--r--ui/webui/resources/cr_elements/demo_element.html2
-rw-r--r--ui/webui/resources/cr_elements/network/cr_network_icon.html2
-rw-r--r--ui/webui/resources/cr_elements/network/cr_network_list.html2
-rw-r--r--ui/webui/resources/cr_elements/network/cr_network_list_item.html2
-rw-r--r--ui/webui/resources/cr_elements/network/cr_network_select.html2
-rw-r--r--ui/webui/resources/cr_elements/policy/cr_policy_network_indicator.html2
-rw-r--r--ui/webui/resources/cr_elements/policy/cr_policy_pref_indicator.html2
-rw-r--r--ui/webui/resources/html/polymer.html2
-rw-r--r--ui/webui/resources/html/polymer_config.html2
-rw-r--r--ui/webui/resources/js/polymer_config.js8
-rw-r--r--ui/webui/resources/webui_resources.grd2
15 files changed, 24 insertions, 16 deletions
diff --git a/ui/webui/resources/cr_elements/cr_events/cr_events.html b/ui/webui/resources/cr_elements/cr_events/cr_events.html
index fc17728..f726fe3 100644
--- a/ui/webui/resources/cr_elements/cr_events/cr_events.html
+++ b/ui/webui/resources/cr_elements/cr_events/cr_events.html
@@ -1,4 +1,4 @@
-<link rel="import" href="chrome://resources/polymer/v1_0/polymer/polymer.html">
+<link rel="import" href="chrome://resources/html/polymer.html">
<dom-module id="cr-events">
<script src="cr_events.js"></script>
diff --git a/ui/webui/resources/cr_elements/cr_expand_button/cr_expand_button.html b/ui/webui/resources/cr_elements/cr_expand_button/cr_expand_button.html
index 26b36702..edcdd59 100644
--- a/ui/webui/resources/cr_elements/cr_expand_button/cr_expand_button.html
+++ b/ui/webui/resources/cr_elements/cr_expand_button/cr_expand_button.html
@@ -1,4 +1,4 @@
-<link rel="import" href="chrome://resources/polymer/v1_0/polymer/polymer.html">
+<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icons/iron-icons.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html">
diff --git a/ui/webui/resources/cr_elements/cr_search_field/cr_search_field.html b/ui/webui/resources/cr_elements/cr_search_field/cr_search_field.html
index f8d203c..8524c94 100644
--- a/ui/webui/resources/cr_elements/cr_search_field/cr_search_field.html
+++ b/ui/webui/resources/cr_elements/cr_search_field/cr_search_field.html
@@ -1,5 +1,5 @@
<link rel="import" href="chrome://resources/html/assert.html">
-<link rel="import" href="chrome://resources/polymer/v1_0/polymer/polymer.html">
+<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icons/iron-icons.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-input/iron-input.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html">
diff --git a/ui/webui/resources/cr_elements/cr_shared_menu/cr_shared_menu.html b/ui/webui/resources/cr_elements/cr_shared_menu/cr_shared_menu.html
index fc122f4..e2354a4 100644
--- a/ui/webui/resources/cr_elements/cr_shared_menu/cr_shared_menu.html
+++ b/ui/webui/resources/cr_elements/cr_shared_menu/cr_shared_menu.html
@@ -1,10 +1,10 @@
-<link rel="import" href="chrome://resources/polymer/v1_0/polymer/polymer.html">
-<link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/shadow.html">
-<link rel="import" href="chrome://resources/polymer/v1_0/paper-menu/paper-menu.html">
+<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/html/assert.html">
<link rel="import" href="chrome://resources/html/cr.html">
<link rel="import" href="chrome://resources/html/cr/ui/position_util.html">
<link rel="import" href="chrome://resources/html/util.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/shadow.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/paper-menu/paper-menu.html">
<dom-module id="cr-shared-menu">
<template>
diff --git a/ui/webui/resources/cr_elements/demo_element.html b/ui/webui/resources/cr_elements/demo_element.html
index 440d82e..220741c 100644
--- a/ui/webui/resources/cr_elements/demo_element.html
+++ b/ui/webui/resources/cr_elements/demo_element.html
@@ -1,4 +1,4 @@
-<link rel="import" href="chrome://resources/polymer/v1_0/polymer/polymer.html">
+<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/classes/iron-flex-layout.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-checkbox/paper-checkbox.html">
diff --git a/ui/webui/resources/cr_elements/network/cr_network_icon.html b/ui/webui/resources/cr_elements/network/cr_network_icon.html
index ca8fd04..cb82c74 100644
--- a/ui/webui/resources/cr_elements/network/cr_network_icon.html
+++ b/ui/webui/resources/cr_elements/network/cr_network_icon.html
@@ -1,4 +1,4 @@
-<link rel="import" href="chrome://resources/polymer/v1_0/polymer/polymer.html">
+<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/network/cr_onc_types.html">
<dom-module id="cr-network-icon">
diff --git a/ui/webui/resources/cr_elements/network/cr_network_list.html b/ui/webui/resources/cr_elements/network/cr_network_list.html
index 7f28786..2b8f82c 100644
--- a/ui/webui/resources/cr_elements/network/cr_network_list.html
+++ b/ui/webui/resources/cr_elements/network/cr_network_list.html
@@ -1,4 +1,4 @@
-<link rel="import" href="chrome://resources/polymer/v1_0/polymer/polymer.html">
+<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-collapse/iron-collapse.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/classes/iron-flex-layout.html">
<link rel="import" href="chrome://resources/cr_elements/network/cr_network_list_item.html">
diff --git a/ui/webui/resources/cr_elements/network/cr_network_list_item.html b/ui/webui/resources/cr_elements/network/cr_network_list_item.html
index 6be1c16..3fe72aa 100644
--- a/ui/webui/resources/cr_elements/network/cr_network_list_item.html
+++ b/ui/webui/resources/cr_elements/network/cr_network_list_item.html
@@ -1,4 +1,4 @@
-<link rel="import" href="chrome://resources/polymer/v1_0/polymer/polymer.html">
+<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/classes/iron-flex-layout.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icons/iron-icons.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button.html">
diff --git a/ui/webui/resources/cr_elements/network/cr_network_select.html b/ui/webui/resources/cr_elements/network/cr_network_select.html
index bc703bc..b085806 100644
--- a/ui/webui/resources/cr_elements/network/cr_network_select.html
+++ b/ui/webui/resources/cr_elements/network/cr_network_select.html
@@ -1,4 +1,4 @@
-<link rel="import" href="chrome://resources/polymer/v1_0/polymer/polymer.html">
+<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/classes/iron-flex-layout.html">
<link rel="import" href="chrome://resources/cr_elements/cr_expand_button/cr_expand_button.html">
<link rel="import" href="chrome://resources/cr_elements/network/cr_network_list.html">
diff --git a/ui/webui/resources/cr_elements/policy/cr_policy_network_indicator.html b/ui/webui/resources/cr_elements/policy/cr_policy_network_indicator.html
index 3777865..3c86d99 100644
--- a/ui/webui/resources/cr_elements/policy/cr_policy_network_indicator.html
+++ b/ui/webui/resources/cr_elements/policy/cr_policy_network_indicator.html
@@ -1,4 +1,4 @@
-<link rel="import" href="chrome://resources/polymer/v1_0/polymer/polymer.html">
+<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icons/iron-icons.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icons/social-icons.html">
diff --git a/ui/webui/resources/cr_elements/policy/cr_policy_pref_indicator.html b/ui/webui/resources/cr_elements/policy/cr_policy_pref_indicator.html
index 49edb14..9fa274a 100644
--- a/ui/webui/resources/cr_elements/policy/cr_policy_pref_indicator.html
+++ b/ui/webui/resources/cr_elements/policy/cr_policy_pref_indicator.html
@@ -1,4 +1,4 @@
-<link rel="import" href="chrome://resources/polymer/v1_0/polymer/polymer.html">
+<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icons/iron-icons.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icons/social-icons.html">
diff --git a/ui/webui/resources/html/polymer.html b/ui/webui/resources/html/polymer.html
new file mode 100644
index 0000000..4b9e041
--- /dev/null
+++ b/ui/webui/resources/html/polymer.html
@@ -0,0 +1,2 @@
+<script src="chrome://resources/js/polymer_config.js"></script>
+<link rel="import" href="chrome://resources/polymer/v1_0/polymer/polymer.html">
diff --git a/ui/webui/resources/html/polymer_config.html b/ui/webui/resources/html/polymer_config.html
index d805abd..3a0c9e1 100644
--- a/ui/webui/resources/html/polymer_config.html
+++ b/ui/webui/resources/html/polymer_config.html
@@ -1 +1,3 @@
+<!-- TODO(michaelpg): Deprecate in favor of ./polymer.html. -->
<script src="chrome://resources/js/polymer_config.js"></script>
+<link rel="import" href="chrome://resources/polymer/v1_0/polymer/polymer.html">
diff --git a/ui/webui/resources/js/polymer_config.js b/ui/webui/resources/js/polymer_config.js
index 6b432d9..a60d510 100644
--- a/ui/webui/resources/js/polymer_config.js
+++ b/ui/webui/resources/js/polymer_config.js
@@ -2,7 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-if (typeof Polymer == 'undefined')
+if (typeof Polymer == 'undefined') {
Polymer = {dom: 'shadow'};
-else
- console.error('Polymer is already defined.');
+} else {
+ // TODO(michaelpg): Change back to error once polymer_config.html is removed.
+ console.warn('Polymer is already defined.');
+}
diff --git a/ui/webui/resources/webui_resources.grd b/ui/webui/resources/webui_resources.grd
index 4b8930c..83c3405 100644
--- a/ui/webui/resources/webui_resources.grd
+++ b/ui/webui/resources/webui_resources.grd
@@ -303,6 +303,8 @@ without changes to the corresponding grd file. -->
file="html/i18n_template.html" type="chrome_html" />
<structure name="IDR_WEBUI_HTML_LOAD_TIME_DATA"
file="html/load_time_data.html" type="chrome_html" />
+ <structure name="IDR_WEBUI_HTML_POLYMER"
+ file="html/polymer.html" type="chrome_html" />
<structure name="IDR_WEBUI_HTML_POLYMER_CONFIG"
file="html/polymer_config.html" type="chrome_html" />
<structure name="IDR_WEBUI_HTML_I18N_BEHAVIOR"