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

Side by Side Diff: polymer_1.2.3/bower_components/paper-drawer-panel/test/small-devices.html

Issue 1581713003: [third_party] add polymer 1.2.3 (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: 1.2.3 Created 4 years, 11 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!doctype html>
2 <!--
3 @license
4 Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
5 This code may only be used under the BSD style license found at http://polymer.g ithub.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/CONTRI BUTORS.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/PATEN TS.txt
10 -->
11 <html>
12 <head>
13 <meta charset="UTF-8">
14 <title>paper-drawer-panel tests</title>
15 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum- scale=1.0">
16
17 <script src="../../webcomponentsjs/webcomponents-lite.js"></script>
18 <script src="../../web-component-tester/browser.js"></script>
19 <link rel="import" href="../paper-drawer-panel.html">
20 </head>
21 <style>
22 body {
23 margin: 0;
24 padding: 0;
25 }
26 .notransition,
27 .notransition * {
28 -webkit-transition: none !important;
29 -moz-transition: none !important;
30 -o-transition: none !important;
31 -ms-transition: none !important;
32 transition: none !important;
33 }
34 </style>
35 <body>
36
37 <test-fixture id="left-drawer">
38 <template>
39 <paper-drawer-panel class="notransition">
40 <div drawer></div>
41 <div main></div>
42 </paper-drawer-panel>
43 </template>
44 </test-fixture>
45
46 <test-fixture id="right-drawer">
47 <template>
48 <paper-drawer-panel right-drawer class="notransition">
49 <div drawer></div>
50 <div main></div>
51 </paper-drawer-panel>
52 </template>
53 </test-fixture>
54
55 <script>
56 suite('on small devices', function() {
57
58 test('drawer is hidden by default', function(done) {
59 var f, panel, drawer, main;
60 f = fixture('left-drawer');
61 drawer = f.$$('#drawer');
62 main = f.$$('#main');
63
64 f.set('forceNarrow', true);
65 f._forceNarrowChanged();
66
67 Polymer.Base.async(function() {
68 var drawerBoundingRect = drawer.getBoundingClientRect();
69 var mainStyle = window.getComputedStyle(main);
70 expect(f._isMainSelected()).to.be.equal(true);
71 expect(drawerBoundingRect.left).to.be.equal(-256);
72 expect(drawerBoundingRect.width).to.be.equal(256);
73 done();
74 });
75 });
76
77 test('right-drawer is hidden by default', function(done) {
78 var f, panel, drawer, main;
79 f = fixture('right-drawer');
80 drawer = f.$$('#drawer');
81 main = f.$$('#main');
82
83 f.set('forceNarrow', true);
84 f._forceNarrowChanged();
85
86 Polymer.Base.async(function() {
87 var drawerBoundingRect = drawer.getBoundingClientRect();
88 var mainStyle = window.getComputedStyle(main);
89 expect(drawerBoundingRect.right).to.be.equal(f.offsetWidth + 256);
90 expect(drawerBoundingRect.width).to.be.equal(256);
91 done();
92 });
93 });
94
95 test('drawer can be opened', function(done) {
96 var f, panel, drawer, main;
97 f = fixture('left-drawer');
98 drawer = f.$$('#drawer');
99 main = f.$$('#main');
100
101 f.set('forceNarrow', true);
102 f._forceNarrowChanged();
103 f.openDrawer();
104
105 Polymer.Base.async(function() {
106 var drawerBoundingRect = drawer.getBoundingClientRect();
107 var mainStyle = window.getComputedStyle(main);
108 expect(f.selected).to.be.equal('drawer');
109 expect(f._isMainSelected()).to.be.equal(false);
110 expect(drawerBoundingRect.left).to.be.equal(0);
111 expect(drawerBoundingRect.width).to.be.equal(256);
112 done();
113 });
114 });
115
116 test('right-drawer can be closed', function(done) {
117 var f, panel, drawer, main;
118 f = fixture('right-drawer');
119 drawer = f.$$('#drawer');
120 main = f.$$('#main');
121
122 f.set('forceNarrow', true);
123 f._forceNarrowChanged();
124 f.openDrawer();
125
126 Polymer.Base.async(function() {
127 var drawerBoundingRect = drawer.getBoundingClientRect();
128 var mainStyle = window.getComputedStyle(main);
129 expect(drawerBoundingRect.right).to.be.equal(f.offsetWidth);
130 expect(drawerBoundingRect.width).to.be.equal(256);
131 done();
132 });
133 });
134
135 });
136 </script>
137 </body>
138 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698