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

Unified Diff: chrome/test/data/extensions/api_test/file_manager_browsertest/open_audio_files.js

Issue 214463002: Separate audio player tests from special file test of Files.app (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adressed the comment Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/file_manager_browsertest/open_audio_files.js
diff --git a/chrome/test/data/extensions/api_test/file_manager_browsertest/open_audio_files.js b/chrome/test/data/extensions/api_test/file_manager_browsertest/open_audio_files.js
new file mode 100644
index 0000000000000000000000000000000000000000..0f58f4eb8d55561d37332a8328c25c8add3f5a39
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/file_manager_browsertest/open_audio_files.js
@@ -0,0 +1,53 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+'use strict';
+
+/**
+ * Tests if the audio player shows up for the selected image and that the audio
+ * is loaded successfully.
+ *
+ * @param {string} path Directory path to be tested.
+ */
+function audioOpen(path) {
+ var appId;
+ var audioAppId;
+ StepsRunner.run([
+ function() {
+ setupAndWaitUntilReady(null, path, this.next);
+ },
+ // Select the song.
+ function(inAppId) {
+ appId = inAppId;
+ callRemoteTestUtil(
+ 'openFile', appId, ['Beautiful Song.ogg'], this.next);
+ },
+ // Wait for the audio player.
+ function(result) {
+ chrome.test.assertTrue(result);
+ waitForWindow('audio_player.html').then(this.next);
+ },
+ // Wait for the audio tag and verify the source.
+ function(inAppId) {
+ audioAppId = inAppId;
+ waitForElement(audioAppId, 'audio-player[playing]').then(this.next);
+ },
+ // Get the title tag.
+ function(element) {
+ chrome.test.assertEq(
+ 'filesystem:chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj/' +
+ 'external' + path + '/Beautiful%20Song.ogg',
+ element.attributes.currenttrackurl);
+ checkIfNoErrorsOccured(this.next);
+ }
+ ]);
+}
+
+testcase.audioOpenDownloads = function() {
+ audioOpen(RootPath.DOWNLOADS);
+};
+
+testcase.audioOpenDrive = function() {
+ audioOpen(RootPath.DRIVE);
+};

Powered by Google App Engine
This is Rietveld 408576698