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

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

Issue 2300753004: MD Settings menu should be visible (Closed)
Patch Set: cleanup Created 4 years, 3 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 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /** @fileoverview Suite of tests for the Settings layout. */
6
7 GEN_INCLUDE(['settings_page_browsertest.js']);
8
9 /**
10 * @constructor
11 * @extends {SettingsPageBrowserTest}
12 */
13 function SettingsUIBrowserTest() {}
14
15 SettingsUIBrowserTest.prototype = {
16 __proto__: SettingsPageBrowserTest.prototype,
17 };
18
19 // Times out on debug builders and may time out on memory bots because
20 // the Settings page can take several seconds to load in a Release build
21 // and several times that in a Debug build. See https://crbug.com/558434.
22 GEN('#if defined(MEMORY_SANITIZER) || !defined(NDEBUG)');
23 GEN('#define MAYBE_All DISABLED_All');
24 GEN('#else');
25 GEN('#define MAYBE_All All');
26 GEN('#endif');
27
28 TEST_F('SettingsUIBrowserTest', 'MAYBE_All', function() {
29 suite('settings-ui', function() {
30 var toolbar;
31 var ui;
32
33 suiteSetup(function() {
34 var settings = assert(document.querySelector('cr-settings'));
35 ui = assert(settings.$$('settings-ui'));
36 });
37
38 test('basic', function() {
39 toolbar = assert(ui.$$('cr-toolbar'));
40 assertTrue(toolbar.showMenu);
41 });
42
43 test('app drawer', function(done) {
44 assertEquals(null, ui.$$('settings-menu'));
45 var drawer = assert(ui.$$('app-drawer'));
46 assertFalse(drawer.opened);
47
48 // Slide the drawer partway open. (These events are copied from Polymer's
49 // app-drawer tests.)
50 drawer.fire('track', { state: 'start' });
Dan Beam 2016/09/01 01:33:13 \s} -> }
Dan Beam 2016/09/01 01:33:13 {\s -> {
michaelpg 2016/09/01 02:20:26 Dones.
michaelpg 2016/09/01 02:20:26 Dones.
51 drawer.fire('track', { state: 'track', dx: 10, ddx: 10 });
52 drawer.fire('track', { state: 'end', dx: 10, ddx: 0 });
53
54 // Menu is rendered asynchronously, but the drawer stays closed.
55 Polymer.dom.flush();
56 assertFalse(drawer.opened);
57 assertTrue(!!ui.$$('settings-menu'));
58
59 // Slide most of the way open.
60 drawer.fire('track', { state: 'start' });
61 drawer.fire('track', { state: 'track', dx: 200, ddx: 200 });
62 drawer.fire('track', { state: 'end', dx: 200, ddx: 0 });
63
64 // Drawer is shown.
65 Polymer.dom.flush();
66 assertTrue(drawer.opened);
67
68 // Click away from the drawer.
69 MockInteractions.tap(drawer.$.scrim);
70 Polymer.Base.async(function() {
71 // Drawer is closed, but menu is still stamped so its contents remain
72 // visible as the drawer slides out.
73 assertFalse(drawer.opened);
74 assertTrue(!!ui.$$('settings-menu'));
75 done();
76 });
77 });
78 });
79
80 mocha.run();
81 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698