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

Side by Side Diff: chrome/test/data/media/eme_player_js/file_io_test_player.js

Issue 308553002: Integrate browser tests with new EME player. (Closed) Base URL: http://git.chromium.org/chromium/src.git@eme_player
Patch Set: Add support for FileIO and LoadSession test cases Created 6 years, 6 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 2014 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 // File IO test player is used to test File IO CDM functionality.
6 function FileIOTestPlayer() {
7 }
8
9 FileIOTestPlayer.prototype.init = function(video) {
10 InitPrefixedEMEPlayer(this, video);
11 };
12
13 FileIOTestPlayer.prototype.onWebkitKeyMessage = function(message) {
14 // The test result is either '0' or '1' appended to the header.
15 if (Utils.hasPrefix(message.message, FILE_IO_TEST_RESULT_HEADER)) {
16 if (message.message.length != FILE_IO_TEST_RESULT_HEADER.length + 1) {
17 Utils.failTest('Unexpected FileIOTest CDM message' + message.message);
18 return;
19 }
20 var result_index = FILE_IO_TEST_RESULT_HEADER.length;
21 var success = String.fromCharCode(message.message[result_index]) == 1;
22 Utils.timeLog('CDM file IO test: ' + (success ? 'Success' : 'Fail'));
23 if (success)
24 Utils.setResultInTitle(FILE_IO_TEST_SUCCESS);
25 else
26 Utils.failTest('File IO CDM message fail status.');
27 }
28 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698