The mobile-spec failure test is explicitly checking for the error handler to have been called with an error object:, or at least an object that has a 'code' property that is a number.
fail = jasmine.createSpy().andCallFake(function (result) { expect(result).toBeDefined(); expect(result.code).toBe(MediaError.MEDIA_ERR_ABORTED); }); The docs say NOTHING of what is passed to the error handler. Android is doing this ugliness ... this.handler.sendJavascript("cordova.require('cordova/plugin/Media').onStatus('" + this.id + "', { \"code\":" + arg1 + "});"); iOS includes a non-standard error message Regardless, I will fix WP7, so it does not break the other platforms, and file issues for the inconsistencies. On Tue, Sep 11, 2012 at 1:12 PM, Jesse <purplecabb...@gmail.com> wrote: > I can modify WP7, that is okay ... just looking into the test/docs > briefly first. > > On Tue, Sep 11, 2012 at 12:43 PM, Simon MacDonald > <simon.macdon...@gmail.com> wrote: >> Hey all, >> >> This change: >> >> https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-js.git;a=commitdiff;h=4214ffe2c319608cd1065caed5e6e4ddd4720fd9 >> >> has modified the way the error callback is invoked. It used to be: >> >> media.errorCallback(value) >> >> and it is now: >> >> media.errorCallback({'code':value}) >> >> So now when the error callback is run on Android or iOS you get a value of >> {'code': {'code': 1}}. This is causing a mobile spec test failure in Media. >> >> I could go ahead and make the change in the JavaScript to make it: >> >> media.errorCallback(value) >> >> but that'll screw up Windows Phone. Is there any way that WP can return a >> JSON error object or do Becky and I need to go in and change the >> Android/iOS repos? >> >> Thanks... >> >> Simon Mac Donald >> http://hi.im/simonmacdonald > > > > -- > @purplecabbage > risingj.com -- @purplecabbage risingj.com