Sha256: b3dc46e509ddff677c95e01116b3d07ea3800567d8668a25c8223ee9fbe89a08

Contents?: true

Size: 1.04 KB

Versions: 40

Compression:

Stored size: 1.04 KB

Contents

asynctest('atomic/core/ConvertTest', [
	'ephox/tinymce',
	'tinymce/inlite/file/Conversions',
	'ephox.agar.api.Step',
	'ephox.agar.api.Pipeline',
	'ephox.agar.api.Assertions'
], function (tinymce, Conversions, Step, Pipeline, Assertions) {
	var success = arguments[arguments.length - 2];
	var failure = arguments[arguments.length - 1];

	var base64ToBlob = function (base64, type) {
		var buff = atob(base64);
		var bytes = new Uint8Array(buff.length);

		for (var i = 0; i < bytes.length; i++) {
			bytes[i] = buff.charCodeAt(i);
		}

		return new Blob([bytes], {type: type});
	};

	var sBlobToBase64 = function () {
		return Step.async(function (next) {
			var base64 = 'R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
			var blob = base64ToBlob(base64, 'image/gif');

			Conversions.blobToBase64(blob).then(function (convertedBase64) {
				Assertions.assertEq('Not the correct base64', base64, convertedBase64);
				next();
			});
		});
	};

	Pipeline.async({}, [
		sBlobToBase64()
	], function () {
		success();
	}, function () {
		failure();
	});
});

Version data entries

40 entries across 40 versions & 2 rubygems

Version Path
wbase-0.3.20 lib/vendor/admin/tinymce/themes/inlite/src/test/js/browser/file/ConversionsTest.js
wbase-0.3.19 lib/vendor/admin/tinymce/themes/inlite/src/test/js/browser/file/ConversionsTest.js
wbase-0.3.18 lib/vendor/admin/tinymce/themes/inlite/src/test/js/browser/file/ConversionsTest.js
wbase-0.3.17 lib/vendor/admin/tinymce/themes/inlite/src/test/js/browser/file/ConversionsTest.js
wbase-0.3.16 lib/vendor/admin/tinymce/themes/inlite/src/test/js/browser/file/ConversionsTest.js
wbase-0.3.15 lib/vendor/admin/tinymce/themes/inlite/src/test/js/browser/file/ConversionsTest.js
wbase-0.3.14 lib/vendor/admin/tinymce/themes/inlite/src/test/js/browser/file/ConversionsTest.js
wbase-0.3.13 lib/vendor/admin/tinymce/themes/inlite/src/test/js/browser/file/ConversionsTest.js
wbase-0.3.12 lib/vendor/admin/tinymce/themes/inlite/src/test/js/browser/file/ConversionsTest.js
wbase-0.3.11 lib/vendor/admin/tinymce/themes/inlite/src/test/js/browser/file/ConversionsTest.js
wbase-0.3.10 lib/vendor/admin/tinymce/themes/inlite/src/test/js/browser/file/ConversionsTest.js
wbase-0.3.9 lib/vendor/admin/tinymce/themes/inlite/src/test/js/browser/file/ConversionsTest.js
wbase-0.3.8 lib/vendor/admin/tinymce/themes/inlite/src/test/js/browser/file/ConversionsTest.js
wbase-0.3.7 lib/vendor/admin/tinymce/themes/inlite/src/test/js/browser/file/ConversionsTest.js
wbase-0.3.6 lib/vendor/admin/tinymce/themes/inlite/src/test/js/browser/file/ConversionsTest.js
wbase-0.3.5 lib/vendor/admin/tinymce/themes/inlite/src/test/js/browser/file/ConversionsTest.js
wbase-0.3.4 lib/vendor/admin/tinymce/themes/inlite/src/test/js/browser/file/ConversionsTest.js
wbase-0.3.3 lib/vendor/admin/tinymce/themes/inlite/src/test/js/browser/file/ConversionsTest.js
wbase-0.3.2 lib/vendor/admin/tinymce/themes/inlite/src/test/js/browser/file/ConversionsTest.js
wbase-0.3.1 lib/vendor/admin/tinymce/themes/inlite/src/test/js/browser/file/ConversionsTest.js