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

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

Issue 485013003: Video Player: Add a test to open a single video file (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed the comments Created 6 years, 4 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/video_player/open_video_files.js
diff --git a/chrome/test/data/extensions/api_test/file_manager_browsertest/video_player/open_video_files.js b/chrome/test/data/extensions/api_test/file_manager_browsertest/video_player/open_video_files.js
new file mode 100644
index 0000000000000000000000000000000000000000..817b597a47ba0842019c4ffa91fd0e65e82c8693
--- /dev/null
+++ b/chrome/test/data/extensions/api_test/file_manager_browsertest/video_player/open_video_files.js
@@ -0,0 +1,46 @@
+// 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';
+
+/**
+ * Opens video player with a single video.
+ * @param {string} volumeName Test volume name passed to the addEntries
+ * function. Either 'drive' or 'local'.
+ * @param {VolumeManagerCommon.VolumeType} volumeType Volume type.
+ * @return {Promise} Promise to be fulfilled with the video player element.
+ */
+function openSingleVideo(volumeName, volumeType) {
+ var entries = [ENTRIES.world];
+ return launch(volumeName, volumeType, entries).then(function(videoPlayer) {
+ chrome.test.assertTrue(videoPlayer.hasAttribute('first-video'));
+ chrome.test.assertTrue(videoPlayer.hasAttribute('last-video'));
+ chrome.test.assertFalse(videoPlayer.hasAttribute('multiple'));
+ chrome.test.assertFalse(videoPlayer.hasAttribute('disabled'));
+ return videoPlayer;
+ });
+}
+
+/**
+ * The openSingleImage test for Downloads.
+ * @return {Promise} Promise to be fulfilled with on success.
+ */
+function openSingleVideoOnDownloads() {
+ var test = openSingleVideo('local', VolumeManagerCommon.VolumeType.DOWNLOADS);
+ return test.then(function(videoPlayer) {
+ chrome.test.assertFalse(videoPlayer.hasAttribute('cast-available'));
+ });
+}
+
+/**
+ * The openSingleImage test for Drive.
+ * @return {Promise} Promise to be fulfilled with on success.
+ */
+function openSingleVideoOnDrive() {
+ var test = openSingleVideo('drive', VolumeManagerCommon.VolumeType.DRIVE);
+ return test.then(function(videoPlayer) {
+ // TODO(yoshiki): flip this after launching the feature.
+ chrome.test.assertFalse(videoPlayer.hasAttribute('cast-available'));
+ });
+}

Powered by Google App Engine
This is Rietveld 408576698