Commit ecb6e0bb authored by Luciano Pacheco's avatar Luciano Pacheco Committed by Commit Bot

Fix Polymer config for Video Player

In Video Player polymer_config.js was writing to console.error:
polymer_config.js:15 Polymer is already defined.

This was caused by <paper-slider.html> being included before any of
WebUI or Files app Polymer element had a chance to initialize with the
right config (polymer.html), which in turn was causing Polymer elements
to render without shadowRoot.

Change <files_icon_button> to include before <paper-slider> so it loads
the right config/polymer.html.

Test: --gtest_filter='VideoPlayerBrowserTest.CheckInitialElements' also manually checked for no error message and play button has shadowRoot.
Bug: 875525
Change-Id: I9888992cce762cd6eae8c31a8042119506fd5590
Reviewed-on: https://chromium-review.googlesource.com/1248342
Commit-Queue: Luciano Pacheco <lucmult@chromium.org>
Reviewed-by: default avatarTrent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594620}
parent ccee0cff
...@@ -32,6 +32,7 @@ function extractElementInfo(element, contentWindow, opt_styleNames) { ...@@ -32,6 +32,7 @@ function extractElementInfo(element, contentWindow, opt_styleNames) {
// The hidden attribute is not in the element.attributes even if // The hidden attribute is not in the element.attributes even if
// element.hasAttribute('hidden') is true. // element.hasAttribute('hidden') is true.
hidden: !!element.hidden, hidden: !!element.hidden,
hasShadowRoot: !!element.shadowRoot
}; };
const styleNames = opt_styleNames || []; const styleNames = opt_styleNames || [];
......
...@@ -16,8 +16,13 @@ testcase.checkInitialElements = function() { ...@@ -16,8 +16,13 @@ testcase.checkInitialElements = function() {
return Promise.all([ return Promise.all([
remoteCallVideoPlayer.waitForElement(appId, 'html[i18n-processed]'), remoteCallVideoPlayer.waitForElement(appId, 'html[i18n-processed]'),
remoteCallVideoPlayer.waitForElement(appId, 'div#video-player'), remoteCallVideoPlayer.waitForElement(appId, 'div#video-player'),
remoteCallVideoPlayer.waitForElement( remoteCallVideoPlayer.waitForElement(appId, '#video-container > video'),
appId, '#video-container > video'), remoteCallVideoPlayer.waitForElement(appId, 'files-icon-button.play')
.then(function(element) {
// files-icon-button is a Polymer element and should have a
// shadowRoot.
chrome.test.assertTrue(element.hasShadowRoot);
}),
]); ]);
}); });
}; };
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
<link rel="stylesheet" type="text/css" href="css/arrow_box.css"> <link rel="stylesheet" type="text/css" href="css/arrow_box.css">
<link rel="stylesheet" type="text/css" href="css/cast_menu.css"> <link rel="stylesheet" type="text/css" href="css/cast_menu.css">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-slider/paper-slider.html">
<link rel="import" href="chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj/foreground/elements/files_icon_button.html"> <link rel="import" href="chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj/foreground/elements/files_icon_button.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-slider/paper-slider.html">
<style is="custom-style"> <style is="custom-style">
files-icon-button { files-icon-button {
......
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