-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Gary Mathews
committed
Feb 27, 2018
1 parent
481b73c
commit 3d9afac
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
}); | ||
}); | ||
}); | ||
}); |