Skip to content

Commit

Permalink
[TIMOB-25619] Add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Mathews committed Feb 27, 2018
1 parent 481b73c commit 3d9afac
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions tests/Resources/ti.media.addontest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Appcelerator Titanium Mobile
* Copyright (c) 2011-Present by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/
/* eslint-env mocha */
/* global Ti */
/* eslint no-unused-expressions: "off" */
'use strict';

describe('Titanium.Media', function () {
this.timeout(10000);

it.android('previewImage of non-file blob', function (finish) {
var view = Ti.UI.createView({ backgroundColor: 'green' });

view.toImage(function (blob) {
if (!blob) {
finish(new Error('failed to preview blob'));
}
Ti.API.info('toImage: attempting to preview blob...');

Ti.Media.previewImage({
success: function (e) {
Ti.API.info('previewImage: success!');
finish();
},
error: function (e) {
Ti.API.info('previewImage: failed!');
finish(e);
},
image: blob
});
});
});
});

0 comments on commit 3d9afac

Please sign in to comment.