PHP Classes

File: public/js/tinymce/src/themes/inlite/src/test/js/browser/file/ConversionsTest.js

Recommend this page to a friend!
  Classes of Abed Nego Ragil Putra   GoLavaCMS   public/js/tinymce/src/themes/inlite/src/test/js/browser/file/ConversionsTest.js   Download  
File: public/js/tinymce/src/themes/inlite/src/test/js/browser/file/ConversionsTest.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: GoLavaCMS
Publish content on Web pages with SEO support
Author: By
Last change:
Date: 6 years ago
Size: 1,268 bytes
 

Contents

Class file image Download
asynctest( 'atomic.core.ConvertTest', [ 'ephox.agar.api.Assertions', 'ephox.agar.api.Pipeline', 'ephox.agar.api.Step', 'ephox.sand.api.Uint8Array', 'ephox.sand.api.Window', 'tinymce.themes.inlite.file.Conversions' ], function (Assertions, Pipeline, Step, Uint8Array, Window, Conversions) { var success = arguments[arguments.length - 2]; var failure = arguments[arguments.length - 1]; var base64ToBlob = function (base64, type) { var buff = Window.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(); }); } );