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

Side by Side Diff: chrome/test/data/webui/settings/settings_ui_browsertest.js

Issue 2465433002: Create implementation of the side panel using a dialog. (Closed)
Patch Set: Feedback Created 4 years, 1 month 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** @fileoverview Suite of tests for the Settings layout. */ 5 /** @fileoverview Suite of tests for the Settings layout. */
6 6
7 GEN_INCLUDE(['settings_page_browsertest.js']); 7 GEN_INCLUDE(['settings_page_browsertest.js']);
8 8
9 /** 9 /**
10 * @constructor 10 * @constructor
(...skipping 29 matching lines...) Expand all
40 Polymer.dom.flush(); 40 Polymer.dom.flush();
41 }); 41 });
42 42
43 test('basic', function() { 43 test('basic', function() {
44 toolbar = assert(ui.$$('cr-toolbar')); 44 toolbar = assert(ui.$$('cr-toolbar'));
45 assertTrue(toolbar.showMenu); 45 assertTrue(toolbar.showMenu);
46 }); 46 });
47 47
48 test('app drawer', function(done) { 48 test('app drawer', function(done) {
49 assertEquals(null, ui.$$('settings-menu')); 49 assertEquals(null, ui.$$('settings-menu'));
50 var drawer = assert(ui.$$('app-drawer')); 50 var drawer = ui.$.drawer;
51 assertFalse(drawer.opened); 51 assertFalse(drawer.opened);
52 52
53 // Slide the drawer partway open. (These events are copied from Polymer's 53 // Slide the drawer partway open. (These events are copied from Polymer's
54 // app-drawer tests.) 54 // app-drawer tests.)
55 drawer.fire('track', {state: 'start'}); 55 drawer.fire('track', {state: 'start'});
56 drawer.fire('track', {state: 'track', dx: 10, ddx: 10}); 56 drawer.fire('track', {state: 'track', dx: 10, ddx: 10});
57 drawer.fire('track', {state: 'end', dx: 10, ddx: 0}); 57 drawer.fire('track', {state: 'end', dx: 10, ddx: 0});
58 58
59 // Menu is rendered asynchronously, but the drawer stays closed. 59 // Menu is rendered asynchronously, but the drawer stays closed.
60 Polymer.dom.flush(); 60 Polymer.dom.flush();
61 assertFalse(drawer.opened); 61 assertFalse(drawer.opened);
62 assertTrue(!!ui.$$('settings-menu')); 62 assertTrue(!!ui.$$('settings-menu'));
63 63
64 // Slide most of the way open. 64 // Slide most of the way open.
65 drawer.fire('track', {state: 'start'}); 65 drawer.fire('track', {state: 'start'});
66 drawer.fire('track', {state: 'track', dx: 200, ddx: 200}); 66 drawer.fire('track', {state: 'track', dx: 200, ddx: 200});
67 drawer.fire('track', {state: 'end', dx: 200, ddx: 0}); 67 drawer.fire('track', {state: 'end', dx: 200, ddx: 0});
68 68
69 // Drawer is shown. 69 // Drawer is shown.
70 Polymer.dom.flush(); 70 Polymer.dom.flush();
71 assertTrue(drawer.opened); 71 assertTrue(drawer.opened);
72 72
73 // Click away from the drawer. 73 // Click away from the drawer.
74 MockInteractions.tap(drawer.$.scrim); 74 // MockInteractions don't expose a way to click at a specific location.
75 var midScreen = MockInteractions.middleOfNode(ui);
76 drawer.$.contentContainer.dispatchEvent(new MouseEvent('click', {
77 'bubbles': true,
78 'concelable': true,
79 'clientX': midScreen.x,
80 'clientY': midScreen.y,
81 }));
75 Polymer.Base.async(function() { 82 Polymer.Base.async(function() {
76 // Drawer is closed, but menu is still stamped so its contents remain 83 // Drawer is closed, but menu is still stamped so its contents remain
77 // visible as the drawer slides out. 84 // visible as the drawer slides out.
78 assertFalse(drawer.opened); 85 assertFalse(drawer.opened);
79 assertTrue(!!ui.$$('settings-menu')); 86 assertTrue(!!ui.$$('settings-menu'));
80 done(); 87 done();
81 }); 88 });
82 }); 89 });
83 90
84 test('advanced UIs stay in sync', function() { 91 test('advanced UIs stay in sync', function() {
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 assertEquals('foo ', urlParams.get('search')); 163 assertEquals('foo ', urlParams.get('search'));
157 164
158 searchField.setValue(' '); 165 searchField.setValue(' ');
159 urlParams = settings.getQueryParameters(); 166 urlParams = settings.getQueryParameters();
160 assertFalse(urlParams.has('search')); 167 assertFalse(urlParams.has('search'));
161 }); 168 });
162 }); 169 });
163 170
164 mocha.run(); 171 mocha.run();
165 }); 172 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698