Delete chrome.mediaGalleriesPrivate because the functionality unique to it has since...
[chromium-blink-merge.git] / third_party / polymer / components / paper-dialog / test / basic.html
blobcb997d97d138f02381c20238c8300ea5737fa0fe
1 <!doctype html>
2 <!--
3 Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
4 This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 Code distributed by Google as part of the polymer project is also
8 subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 -->
10 <html>
11 <head>
12 <meta charset="UTF-8">
13 <title>core-input basic tests</title>
14 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
16 <script src="../../webcomponentsjs/webcomponents.js"></script>
17 <script src="../../web-component-tester/browser.js"></script>
19 <link href="../paper-dialog.html" rel="import">
21 </head>
22 <body>
24 <paper-dialog id="dialog1">
25 <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
26 </paper-dialog>
28 <script>
30 var d1 = document.getElementById('dialog1');
32 function assertCentered(node) {
33 var rect = node.getBoundingClientRect();
34 assert.equal(Math.floor(rect.top), Math.floor((window.innerHeight - rect.height) / 2), 'node is not centered vertically');
35 assert.equal(Math.floor(rect.left), Math.floor((window.innerWidth - rect.width) / 2), 'node is not centered horizontally');
38 test('dialog with dynamic content re-centers', function(done) {
39 d1.opened = true;
41 setTimeout(function() {
42 assertCentered(d1);
44 // d1.opened = false;
45 // d1.innerHTML = '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>' +
46 // '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>' +
47 // '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>' +
48 // '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>';
51 // flush(function() {
52 // d1.opened = true;
54 // setTimeout(function() {
55 // assertCentered(d1);
56 // done();
57 // }, 50);
58 // });
60 done();
62 }, 50);
64 });
66 </script>
68 </body>
69 </html>