Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Unified Diff: third_party/polymer/v0_8/components/paper-card/test/paper-card.html

Issue 1082403004: Import Polymer 0.8 and several key elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rerun reproduce.sh Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/polymer/v0_8/components/paper-card/test/paper-card.html
diff --git a/third_party/polymer/v0_8/components/paper-card/test/paper-card.html b/third_party/polymer/v0_8/components/paper-card/test/paper-card.html
new file mode 100644
index 0000000000000000000000000000000000000000..3e6234b5a359549f535f4991644402c67141f600
--- /dev/null
+++ b/third_party/polymer/v0_8/components/paper-card/test/paper-card.html
@@ -0,0 +1,91 @@
+<!doctype html>
+<!--
+Copyright (c) 2015 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
+-->
+<html>
+<head>
+ <meta charset="UTF-8">
+ <title>paper-card basic tests</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
+
+ <script src="../../webcomponentsjs/webcomponents.js"></script>
+ <script src="../../web-component-tester/browser.js"></script>
+ <script src="../../test-fixture/test-fixture-mocha.js"></script>
+
+ <link href="../../test-fixture/test-fixture.html" rel="import">
+ <link href="../../layout/layout.html" rel="import">
+ <link href="../paper-card.html" rel="import">
+
+</head>
+<body>
+ <test-fixture id="TrivialCard">
+ <template>
+ <paper-card elevation="1"></paper-card>
+ </template>
+ </test-fixture>
+
+ <test-fixture id="ProgressiveElevations">
+ <template>
+ <paper-card elevation="1"></paper-card>
+ <paper-card elevation="2"></paper-card>
+ <paper-card elevation="3"></paper-card>
+ <paper-card elevation="4"></paper-card>
+ <paper-card elevation="5"></paper-card>
+ </template>
+ </test-fixture>
+
+ <script>
+ suite('<paper-card>', function() {
+ suite('with a non-zero elevation attribute', function() {
+ var style;
+ var card;
+
+ setup(function() {
+ card = fixture('TrivialCard');
+ style = window.getComputedStyle(card);
+ });
+
+ test('has a shadow', function() {
+ expect(style.boxShadow).to.be.ok;
+ expect(style.boxShadow).to.not.be.eql('none');
+ });
+
+ test('loses shadow with elevation value 0', function() {
+ card.elevation = 0;
+ expect(style.boxShadow).to.be.eql('none');
+ });
+ });
+
+ suite('progressively increasing values of elevation', function() {
+ var cards;
+
+ setup(function() {
+ cards = fixture('ProgressiveElevations');
+ });
+
+ test('yield progressively "deeper" cards', function() {
+ var lastStyle;
+ var style;
+
+ expect(cards.length).to.be.eql(5);
+
+ cards.forEach(function (card) {
+ style = window.getComputedStyle(card);
+
+ expect(style.boxShadow).to.be.ok;
+ expect(style.boxShadow).to.not.be.eql('none');
+ expect(style.boxShadow).to.not.be.eql(lastStyle && lastStyle.boxShadow);
+
+ lastStyle = style;
+ });
+ });
+ });
+ });
+ </script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698