Wordpress/tests/qunit/editor/tinymce/util/XHR.html
Andrew Ozz ce2dcccf86 Incorporate the TinyMCE tests into our JS tests:
- Modified the original tests so TinyMCE can be loaded from /src/wp-includes/js/tinymce.
- Added "WP" option to the UI to select only tests relevant to our integration (excludes most of the default plugins tests).
- Added tests for obsolete HTML elements and attributes (html4 back-compat).
See #27014.

git-svn-id: https://develop.svn.wordpress.org/trunk@27155 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-10 01:11:25 +00:00

54 lines
1.3 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>tinymce.util.XHR tests</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-git.css" type="text/css" />
<script src="http://code.jquery.com/qunit/qunit-git.js"></script>
<script src="../../js/qunit/reporter.js"></script>
<script src="../../js/utils.js"></script>
<script src="../../js/tinymce_loader.js"></script>
<script>
module("tinymce.util.XHR");
QUnit.config.reorder = false;
asyncTest("Successful request", function() {
expect(3);
tinymce.util.XHR.send({
url : 'json_rpc_ok.js',
success: function(data, xhr, input) {
equal(tinymce.trim(data), '{"result": "Hello JSON-RPC", "error": null, "id": 1}');
ok(!!xhr.status);
equal(input.url, 'json_rpc_ok.js');
start();
}
});
});
asyncTest("Unsuccessful request", function() {
expect(3);
tinymce.util.XHR.send({
url : '404.js',
error: function(type, xhr, input) {
equal(type, 'GENERAL');
ok(!!xhr.status);
equal(input.url, '404.js');
start();
}
});
});
</script>
</head>
<body>
<h1 id="qunit-header">tinymce.util.XHR tests</h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<div id="content"></div>
</body>
</html>