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

Unified Diff: polymer_0.5.0/bower_components/core-collapse/test/basic.html

Issue 786953007: npm_modules: Fork bower_components into Polymer 0.4.0 and 0.5.0 versions (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 5 years, 12 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: polymer_0.5.0/bower_components/core-collapse/test/basic.html
diff --git a/bower_components/core-tests/tests/core-collapse.html b/polymer_0.5.0/bower_components/core-collapse/test/basic.html
similarity index 52%
copy from bower_components/core-tests/tests/core-collapse.html
copy to polymer_0.5.0/bower_components/core-collapse/test/basic.html
index 5cc3bbebe506d77853a63096a1499e7fb20ff535..b1642e980c005b19a6aef955f98288bd0ac2519a 100644
--- a/bower_components/core-tests/tests/core-collapse.html
+++ b/polymer_0.5.0/bower_components/core-collapse/test/basic.html
@@ -9,59 +9,76 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
-->
<html>
<head>
- <title>core-collapse</title>
-
- <script src="../../platform/platform.js"></script>
- <link rel="import" href="../../polymer-test-tools/tools.html">
- <script src="../../polymer-test-tools/htmltest.js"></script>
+ <meta charset="UTF-8">
+ <title>core-collapse-basic</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>
+
+ <link rel="import" href="../core-collapse.html">
-
- <link rel="import" href="../../core-collapse/core-collapse.html">
</head>
-<body unresolved>
+<body>
- <button onclick="document.querySelector('#collapse').toggle()">toggle collapse</button>
-
<core-collapse id="collapse" duration="0.1" opened>
<div>
Forma temperiemque cornua sidera dissociata cornua recessit innabilis ligavit: solidumque coeptis nullus caelum sponte phoebe di regat mentisque tanta austro capacius amphitrite sui quin postquam semina fossae liquidum umor galeae coeptis caligine liberioris quin liquidum matutinis invasit posset: flexi glomeravit radiis certis invasit oppida postquam onerosior inclusum dominari opifex terris pace finxit quam aquae nunc sine altae auroram quam habentem homo totidemque scythiam in pondus ensis tegit caecoque poena lapidosos humanas coeperunt poena aetas totidem nec natura aethera locavit caelumque distinxit animalibus phoebe cingebant moderantum porrexerat terrae possedit sua sole diu summaque obliquis melioris orbem
</div>
</core-collapse>
-
+
<script>
- var delay = 200;
- document.addEventListener('polymer-ready', function() {
+
+ function getCollapseComputedStyle() {
var c = document.querySelector('#collapse');
- // verify take attribute for opened is correct
- assert.equal(c.opened, true);
- setTimeout(function() {
- // get the height for the opened state
- var h = getCollapseComputedStyle().height;
- // verify the height is not 0px
- assert.notEqual(getCollapseComputedStyle().height, '0px');
- // close it
- c.opened = false;
- Platform.flush();
+ return getComputedStyle(c);
+ }
+
+ var collapse = document.querySelector('#collapse');
+
+ var delay = 200;
+ var collapseHeight;
+
+ suite('basic', function() {
+
+ test('verify attribute', function() {
+ assert.equal(collapse.opened, true);
+ });
+
+ test('verify height', function(done) {
+ Polymer.flush();
+ setTimeout(function() {
+ collapseHeight = getCollapseComputedStyle().height;
+ // verify height
+ assert.notEqual(collapseHeight, '0px');
+ done();
+ }, delay);
+ });
+
+ test('test opened: false', function(done) {
+ collapse.opened = false;
+ Polymer.flush();
+ setTimeout(function() {
+ var h = getCollapseComputedStyle().height;
+ // verify height is 0px
+ assert.equal(h, '0px');
+ done();
+ }, delay);
+ });
+
+ test('test opened: true', function(done) {
+ collapse.opened = true;
+ Polymer.flush();
setTimeout(function() {
- // verify is closed
- assert.notEqual(getCollapseComputedStyle().height, h);
- // open it
- c.opened = true;
- Platform.flush();
- setTimeout(function() {
- // verify is opened
- assert.equal(getCollapseComputedStyle().height, h);
- done();
- }, delay);
+ var h = getCollapseComputedStyle().height;
+ // verify height
+ assert.equal(h, collapseHeight);
+ done();
}, delay);
- }, delay);
+ });
+
});
-
- function getCollapseComputedStyle() {
- var b = document.querySelector('#collapse');
- return getComputedStyle(b);
- }
-
+
</script>
</body>
« no previous file with comments | « polymer_0.5.0/bower_components/core-collapse/index.html ('k') | polymer_0.5.0/bower_components/core-collapse/test/index.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698