~didrocks/+junk/face-detection-15.04

« back to all changes in this revision

Viewing changes to facedetection/www/bower_components/iron-overlay-behavior/test/iron-overlay-backdrop.html

  • Committer: Didier Roche
  • Date: 2016-05-10 23:09:11 UTC
  • Revision ID: didier.roche@canonical.com-20160510230911-c7xr490zrj3yrzxd
New version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!doctype html>
 
2
<!--
 
3
@license
 
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
 
10
-->
 
11
<html>
 
12
 
 
13
<head>
 
14
 
 
15
    <title>iron-overlay-backdrop tests</title>
 
16
 
 
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">
 
20
 
 
21
    <script src="../../webcomponentsjs/webcomponents-lite.js"></script>
 
22
 
 
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">
 
26
 
 
27
    <style>
 
28
        html,
 
29
        body {
 
30
            margin: 0;
 
31
            width: 100%;
 
32
            height: 100%;
 
33
            min-width: 0;
 
34
        }
 
35
        .sizer {
 
36
            width: 4000px;
 
37
            height: 5000px;
 
38
        }
 
39
    </style>
 
40
 
 
41
    <style is="custom-style">
 
42
        iron-overlay-backdrop {
 
43
        /* For quicker tests */
 
44
        --iron-overlay-backdrop: {
 
45
             transition: none;
 
46
         }
 
47
        }
 
48
    </style>
 
49
 
 
50
</head>
 
51
 
 
52
<body>
 
53
 
 
54
<div class="sizer"></div>
 
55
 
 
56
<test-fixture id="backdrop">
 
57
    <template>
 
58
        <test-overlay with-backdrop>
 
59
            Overlay with backdrop
 
60
        </test-overlay>
 
61
    </template>
 
62
</test-fixture>
 
63
 
 
64
<script>
 
65
    function runAfterOpen(overlay, callback) {
 
66
        overlay.addEventListener('iron-overlay-opened', callback);
 
67
        overlay.open();
 
68
    }
 
69
 
 
70
    suite('overlay with backdrop', function() {
 
71
        var overlay;
 
72
 
 
73
        setup(function() {
 
74
            overlay = fixture('backdrop');
 
75
        });
 
76
 
 
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');
 
84
                    done();
 
85
                }, 1);
 
86
            });
 
87
        });
 
88
 
 
89
    });
 
90
</script>
 
91
 
 
92
</body>
 
93
 
 
94
</html>