You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2016/01/30 00:48:15 UTC
[13/13] cordova-plugin-media git commit: Fixed incorrectly written
test
Fixed incorrectly written test
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/commit/5612109b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/tree/5612109b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/diff/5612109b
Branch: refs/heads/master
Commit: 5612109b925fb4432ff7ab387daa114bd239979c
Parents: 137e0ce
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Fri Jan 29 16:47:48 2016 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri Jan 29 16:47:48 2016 -0700
----------------------------------------------------------------------
tests/tests.js | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/5612109b/tests/tests.js
----------------------------------------------------------------------
diff --git a/tests/tests.js b/tests/tests.js
index 6a6bb45..559fca3 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -341,8 +341,10 @@ exports.defineAutoTests = function () {
var mediaFile = 'http://cordova.apache.org/downloads/BlueZedEx.mp3',
mediaState = Media.MEDIA_STOPPED,
successCallback,
+ context = this,
flag = true,
statusChange = function (statusCode) {
+ console.log("status code: " + statusCode);
if (statusCode == Media.MEDIA_RUNNING && flag) {
//flag variable used to ensure an extra security statement to ensure that the callback is processed only once,
//in case for some reason the statusChange callback is reached more than one time with the same status code.
@@ -355,15 +357,16 @@ exports.defineAutoTests = function () {
media1.stop();
media1.release();
done();
- }, failed.bind(null, done, 'media1.getCurrentPosition - Error getting media current position'));
+ }, failed.bind(null, done, 'media1.getCurrentPosition - Error getting media current position'),context);
}, 4000);
}
- },
- media1 = new Media(mediaFile, successCallback, failed.bind(null, done, 'media1 = new Media - Error creating Media object. Media file: ' + mediaFile), statusChange);
+ };
+
+ var media1 = new Media(mediaFile, successCallback, failed.bind(null, done, 'media1 = new Media - Error creating Media object. Media file: ' + mediaFile, context), statusChange);
//make audio playback two times faster
media1.setRate(2);
media1.play();
- });
+ }, ACTUAL_PLAYBACK_TEST_TIMEOUT);
});
};
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org