aboutsummaryrefslogtreecommitdiff
path: root/catapult/third_party/polymer/components/shadycss/tests/settings.html
diff options
context:
space:
mode:
Diffstat (limited to 'catapult/third_party/polymer/components/shadycss/tests/settings.html')
-rw-r--r--catapult/third_party/polymer/components/shadycss/tests/settings.html61
1 files changed, 61 insertions, 0 deletions
diff --git a/catapult/third_party/polymer/components/shadycss/tests/settings.html b/catapult/third_party/polymer/components/shadycss/tests/settings.html
new file mode 100644
index 00000000..ccf773e6
--- /dev/null
+++ b/catapult/third_party/polymer/components/shadycss/tests/settings.html
@@ -0,0 +1,61 @@
+<!doctype html>
+<!--
+@license
+Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
+This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
+The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
+The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
+Code distributed by Google as part of the polymer project is also
+subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
+-->
+<script src="./test-flags.js"></script>
+<script src="../node_modules/wct-browser-legacy/browser.js"></script>
+<script src="../node_modules/@webcomponents/webcomponents-platform/webcomponents-platform.js"></script>
+<script src="../node_modules/es6-promise/dist/es6-promise.auto.min.js"></script>
+<script src="../node_modules/@webcomponents/shadydom/shadydom.min.js"></script>
+<script>
+ suite('Settings', () => {
+ window.ShadyCSS = { cssBuild: 'shady' }
+ let origCss;
+ let origShady;
+ let origCssBuild;
+ test(`settings remain correct no matter the order of components loaded ${JSON.stringify(window.WebComponents.flags)}`, (done) => {
+ let script = document.createElement('script');
+ script.src = '../custom-style-interface.min.js';
+ script.onerror = (err) => done(err);
+ script.onload = () => {
+ origCss = window.ShadyCSS.nativeCss;
+ origShady = window.ShadyCSS.nativeShadow;
+ origCssBuild = window.ShadyCSS.cssBuild;
+ assert.notEqual(origCss, undefined, 'nativeCss should be defined');
+ assert.notEqual(origShady, undefined, 'nativeShadow should be defined');
+ assert.equal(origCssBuild, 'shady', 'cssBuild should be defined');
+ let script = document.createElement('script');
+ script.src = '../apply-shim.min.js';
+ script.onerror = (err) => done(err);
+ script.onload = () => {
+ assert.equal(origCss, window.ShadyCSS.nativeCss);
+ assert.equal(origShady, window.ShadyCSS.nativeShadow);
+ assert.equal(origCssBuild, window.ShadyCSS.cssBuild);
+ let script = document.createElement('script');
+ script.src = '../scoping-shim.min.js';
+ script.onerrer = (err) => done(err);
+ script.onload = () => {
+ assert.equal(origCss, window.ShadyCSS.nativeCss);
+ assert.equal(origShady, window.ShadyCSS.nativeShadow);
+ assert.equal(origCssBuild, window.ShadyCSS.cssBuild);
+ done();
+ };
+ document.head.appendChild(script);
+ }
+ document.head.appendChild(script);
+ }
+ document.head.appendChild(script);
+ });
+ test('Native CSS Custom Properties disabled if ShadyDOM is in use', () => {
+ if (!window.ShadyDOM || !window.ShadyDOM.inUse) {
+ assert.isTrue(window.ShadyCSS.nativeCss, 'nativeCss should be enabled if not using ShadyDOM');
+ }
+ })
+ });
+</script> \ No newline at end of file