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

Side by Side Diff: ui/file_manager/integration_tests/audio_player/click_control_buttons.js

Issue 1526923002: AudioPlayer: Add UI tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 2015 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 'use strict';
6
7 /**
8 * @return {Promise} Promise to be fulfilled with on success.
9 */
10 testcase.clickControlButtons = function() {
yawano 2015/12/16 02:54:14 This test case has more than 20 steps. It seems to
fukino 2015/12/16 07:42:02 Thank you for the suggestion! Done.
11 var openAudio = launch('local', 'downloads',
12 [ENTRIES.beautiful, ENTRIES.newlyAdded]);
13 var appId;
14 return openAudio.then(function(args) {
15 appId = args[0];
16 }).then(function() {
17 // Audio player should start playing automatically.
18 return remoteCallAudioPlayer.waitForElement(
19 appId, 'audio-player[playing]');
20 }).then(function() {
21 // While playing, the play/pause button should have 'Pause' label.
22 return remoteCallAudioPlayer.waitForElement(
23 appId, ['#play[aria-label=\'Pause\']']);
yawano 2015/12/16 02:54:14 nit: How about to use double quotes here? Our HTML
fukino 2015/12/16 07:42:02 Chromium coding style overrides the rule...: "Use
24 }).then(function() {
25 // Clicking the pause button should change the playback state to pause.
26 return remoteCallAudioPlayer.callRemoteTestUtil(
27 'fakeMouseClick', appId, ['#play']);
28 }).then(function() {
29 return remoteCallAudioPlayer.waitForElement(
30 appId, 'audio-player:not([playing])');
31 }).then(function() {
32 // ... and the play/pause button should have 'Play' label.
33 return remoteCallAudioPlayer.waitForElement(
34 appId, ['#play[aria-label=\'Play\']']);
35 }).then(function() {
36 // The default volume level should be 50.
37 return remoteCallAudioPlayer.waitForElement(
38 appId, ['control-panel[volume=\'50\']']);
39 }).then(function() {
40 // Clicking volume button should mute the player.
41 return remoteCallAudioPlayer.callRemoteTestUtil(
42 'fakeMouseClick', appId, ['#volumeButton']);
43 }).then(function() {
44 return Promise.all([
45 remoteCallAudioPlayer.waitForElement(
46 appId, ['control-panel[volume=\'0\']']),
47 remoteCallAudioPlayer.waitForElement(
48 appId, ['#volumeButton[aria-label=\'Unmute\']'])
49 ]);
50 }).then(function() {
51 // Clicking volume button again should restore volume.
52 return remoteCallAudioPlayer.callRemoteTestUtil(
53 'fakeMouseClick', appId, ['#volumeButton']);
54 }).then(function() {
55 return Promise.all([
56 remoteCallAudioPlayer.waitForElement(
57 appId, ['control-panel[volume=\'50\']']),
58 remoteCallAudioPlayer.waitForElement(
59 appId, ['#volumeButton[aria-label=\'Mute\']'])
60 ]);
61 }).then(function() {
62 // The first track should be active.
63 return remoteCallAudioPlayer.waitForElement(
64 appId, ['.track[index=\'0\'][active]']);
65 }).then(function() {
66 // Clicking next button should activate the second track and start playing.
67 return remoteCallAudioPlayer.callRemoteTestUtil(
68 'fakeMouseClick', appId, ['#next']);
69 }).then(function() {
70 return Promise.all([
71 remoteCallAudioPlayer.waitForElement(
72 appId, ['.track[index=\'1\'][active]']),
73 remoteCallAudioPlayer.waitForElement(
74 appId, 'audio-player[playing]')
75 ]);
76 }).then(function() {
77 // Pause to prepare for remaining steps.
78 return remoteCallAudioPlayer.callRemoteTestUtil(
79 'fakeMouseClick', appId, ['#play']);
80 }).then(function() {
81 return remoteCallAudioPlayer.waitForElement(
82 appId, 'audio-player:not([playing])');
83 }).then(function() {
84 // Clicking playlist button should expand track list.
85 return remoteCallAudioPlayer.callRemoteTestUtil(
86 'fakeMouseClick', appId, ['#playList']);
87 }).then(function() {
88 return remoteCallAudioPlayer.waitForElement(
89 appId, 'track-list[expanded]');
90 }).then(function() {
91 // Clicking the first track should make it active, but shouldn't start
92 // playing.
93 return remoteCallAudioPlayer.callRemoteTestUtil(
94 'fakeMouseClick', appId, ['.track[index=\'0\']']);
95 }).then(function() {
96 return remoteCallAudioPlayer.waitForElement(
97 appId, '.track[index=\'0\'][active]');
98 }).then(function() {
99 return remoteCallAudioPlayer.waitForElement(
100 appId, 'audio-player:not([playing])');
101 }).then(function() {
102 // Clicking the play icon on the second should make it active, and start
103 // playing.
104 return remoteCallAudioPlayer.callRemoteTestUtil(
105 'fakeMouseClick', appId, ['.track[index=\'1\'] .icon']);
106 }).then(function() {
107 return remoteCallAudioPlayer.waitForElement(
108 appId, '.track[index=\'1\'][active]');
109
yawano 2015/12/16 02:54:14 nit: unnecessary blank line.
fukino 2015/12/16 07:42:01 Done.
110 }).then(function() {
111 return remoteCallAudioPlayer.waitForElement(
112 appId, 'audio-player[playing]');
113 });
114 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698