PHP Classes

File: public/js/tinymce/src/core/src/test/js/browser/util/JsonRequestTest.js

Recommend this page to a friend!
  Classes of Abed Nego Ragil Putra   GoLavaCMS   public/js/tinymce/src/core/src/test/js/browser/util/JsonRequestTest.js   Download  
File: public/js/tinymce/src/core/src/test/js/browser/util/JsonRequestTest.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,706 bytes
 

Contents

Class file image Download
asynctest( 'browser.tinymce.core.util.JsonRequestTest', [ 'ephox.agar.api.Pipeline', 'ephox.mcagar.api.LegacyUnit', 'tinymce.core.util.I18n', 'tinymce.core.util.JSONRequest' ], function (Pipeline, LegacyUnit, I18n, JSONRequest) { var success = arguments[arguments.length - 2]; var failure = arguments[arguments.length - 1]; var suite = LegacyUnit.createSuite(); suite.asyncTest("Successful request - send method", function (editor, done) { new JSONRequest({}).send({ type: 'GET', url: '/custom/json_rpc_ok', success: function (data) { LegacyUnit.equal(data, 'Hello JSON-RPC'); done(); } }); }); suite.asyncTest("Successful request - sendRPC static method", function (editor, done) { JSONRequest.sendRPC({ type: 'GET', url: '/custom/json_rpc_ok', success: function (data) { LegacyUnit.equal(data, 'Hello JSON-RPC'); done(); } }); }); suite.asyncTest("Error request - send method", function (editor, done) { new JSONRequest({}).send({ type: 'GET', url: '/custom/json_rpc_fail', error: function (error) { LegacyUnit.equal(error.code, 42); done(); } }); }); suite.asyncTest("Error request - sendRPC static method", function (editor, done) { JSONRequest.sendRPC({ type: 'GET', url: '/custom/json_rpc_fail', error: function (error) { LegacyUnit.equal(error.code, 42); done(); } }); }); Pipeline.async({}, suite.toSteps({}), function () { success(); }, failure); } );