Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Merge pull request #35 from jakemac53/test
Browse files Browse the repository at this point in the history
add test for opening and closing in quick succession
  • Loading branch information
Steve Orvell committed Nov 14, 2014
2 parents 2f0ae37 + 4999ba6 commit 86881fc
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
45 changes: 45 additions & 0 deletions tests/html/core-overlay-quick-close.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!doctype html>
<!--
Copyright (c) 2014 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>
<title>core-overlay</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<script src="../../../webcomponentsjs/webcomponents.js"></script>
<script src="../../../polymer-test-tools/chai/chai.js"></script>
<script src="../../../polymer-test-tools/htmltest.js"></script>
<link rel="import" href="../../../core-transition/core-transition-css.html">
<link rel="import" href="../../core-overlay.html">
</head>
<body unresolved>

<core-overlay>my overlay</core-overlay>

<script>
document.addEventListener('polymer-ready', function() {
var overlay = document.querySelector('core-overlay');

asyncSeries([
function(next) {
// First, open the overlay.
overlay.open();
setTimeout(function() {
// During the opening transition, close the overlay.
overlay.close();
// Wait for any exceptions to be thrown until the transition is done.
setTimeout(function() { next(); }, 300);
}, 100);
},
], done);
});

</script>

</body>
</html>
1 change: 1 addition & 0 deletions tests/js/htmltests.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ htmlSuite('core-overlay', function() {
htmlTest('html/core-overlay-positioning.html');
htmlTest('html/core-overlay-positioning-margin.html');
htmlTest('html/core-overlay-scroll.html');
htmlTest('html/core-overlay-quick-close.html');
});

0 comments on commit 86881fc

Please sign in to comment.