4
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
5
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
6
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
7
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
8
Code distributed by Google as part of the polymer project is also
9
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
15
<title>iron-overlay-backdrop tests</title>
17
<meta charset="utf-8">
18
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
19
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
21
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
23
<script src="../../web-component-tester/browser.js"></script>
24
<link rel="import" href="../../iron-test-helpers/iron-test-helpers.html">
25
<link rel="import" href="test-overlay.html">
41
<style is="custom-style">
42
iron-overlay-backdrop {
43
/* For quicker tests */
44
--iron-overlay-backdrop: {
54
<div class="sizer"></div>
56
<test-fixture id="backdrop">
58
<test-overlay with-backdrop>
65
function runAfterOpen(overlay, callback) {
66
overlay.addEventListener('iron-overlay-opened', callback);
70
suite('overlay with backdrop', function() {
74
overlay = fixture('backdrop');
77
test('backdrop size matches parent size', function(done) {
78
runAfterOpen(overlay, function() {
79
Polymer.Base.async(function() {
80
var backdrop = overlay.backdropElement;
81
var parent = backdrop.parentElement;
82
assert.strictEqual(backdrop.offsetWidth, parent.clientWidth, 'backdrop width matches parent width');
83
assert.strictEqual(backdrop.offsetHeight, parent.clientHeight, 'backdrop height matches parent height');