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

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

Issue 15984003: Add tests for the video player in Files.app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 7 years, 7 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
« no previous file with comments | « chrome/browser/resources/file_manager/js/test_util.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/file_manager_browsertest/test_cases.js
diff --git a/chrome/test/data/extensions/api_test/file_manager_browsertest/test_cases.js b/chrome/test/data/extensions/api_test/file_manager_browsertest/test_cases.js
index ef150544aa016d73b1b603ce00464a14ab186baa..203281bfdcf27e91933ded778593b008cb826a77 100644
--- a/chrome/test/data/extensions/api_test/file_manager_browsertest/test_cases.js
+++ b/chrome/test/data/extensions/api_test/file_manager_browsertest/test_cases.js
@@ -317,6 +317,70 @@ testcase.intermediate.audioOpen = function(path) {
};
/**
+ * Tests if the video player shows up for the selected movie and that it is
+ * loaded successfully.
+ *
+ * @param {string} path Directory path to be tested.
+ */
+testcase.intermediate.videoOpen = function(path) {
+ var appId;
+ var videoAppId;
+ var steps = [
+ function() {
+ setupAndWaitUntilReady(path, steps.shift());
+ },
+ function(inAppId) {
+ appId = inAppId;
+ // Select the song.
+ callRemoteTestUtil(
+ 'selectFile', appId, ['world.ogv'], steps.shift());
+ },
+ function(result) {
+ chrome.test.assertTrue(result);
+ // Click on the label to enter the video player.
+ callRemoteTestUtil(
+ 'fakeMouseClick',
+ appId,
+ ['#file-list li.table-row[selected] .filename-label span'],
+ steps.shift());
+ },
+ function(result) {
+ chrome.test.assertTrue(result);
+ // Wait for the video player.
+ callRemoteTestUtil('waitForWindow',
+ null,
+ ['video_player.html'],
+ steps.shift());
+ },
+ function(inAppId) {
+ videoAppId = inAppId;
+ // Wait for the video tag and verify the source.
+ callRemoteTestUtil('waitForElement',
+ videoAppId,
+ ['video[src]'],
+ steps.shift());
+ },
+ function(element) {
+ chrome.test.assertEq(
+ 'filesystem:chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj/' +
+ 'external' + path + '/world.ogv',
+ element.attributes.src);
+ // Wait for the window's inner dimensions. Should be changed to the video
+ // size once the metadata is loaded.
+ callRemoteTestUtil('waitForWindowGeometry',
+ videoAppId,
+ [320, 192],
+ steps.shift());
+ },
+ function(element) {
+ chrome.test.succeed();
+ }
+ ];
+ steps = steps.map(function(f) { return chrome.test.callbackPass(f); });
+ steps.shift()();
+};
+
+/**
* Tests copying a file to the same directory and waits until the file lists
* changes.
*
@@ -436,6 +500,10 @@ testcase.audioOpenDownloads = function() {
testcase.intermediate.audioOpen('/Downloads');
};
+testcase.videoOpenDownloads = function() {
+ testcase.intermediate.videoOpen('/Downloads');
+};
+
testcase.keyboardCopyDownloads = function() {
testcase.intermediate.keyboardCopy('/Downloads');
};
@@ -456,6 +524,10 @@ testcase.audioOpenDrive = function() {
testcase.intermediate.audioOpen('/drive/root');
};
+testcase.videoOpenDrive = function() {
+ testcase.intermediate.videoOpen('/drive/root');
+};
+
testcase.keyboardCopyDrive = function() {
testcase.intermediate.keyboardCopy('/drive/root');
};
« no previous file with comments | « chrome/browser/resources/file_manager/js/test_util.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698