Wordpress/tests/qunit/editor/tinymce/util/Quirks_ie8.html

83 lines
2.3 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>Internet Explorer 8 Quirks</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 src="../../js/jsrobot/robot.js"></script>
<script>
var editor;
QUnit.config.reorder = false;
QUnit.config.autostart = false;
module("Quirks Tests", {
autostart: false
});
if (tinymce.isIE) {
asyncTest('Remove hr between p with backspace', 1, function() {
setTimeout(function() {
editor.setContent('<p>one</p><hr /><p>two</p>');
setSelection('p:last', 0);
editor.focus();
robot.type(8, false, function() {
var expected = '<p>one</p><p>two</p>';
var actual = cleanHtml(editor.getContent({ format: 'raw' }));
equal(actual, expected);
start();
}, editor.getBody());
}, 100);
});
asyncTest('Heading text alignment', 1, function() {
editor.setContent('<h1 id="x" style="text-align: center;">x</h1>');
setSelection('#x', 1);
editor.focus();
robot.type(0xA, false, function() {
var expected = '<h1 id="x" style="text-align: center;">x</h1>\n<p>&nbsp;</p>';
var actual = editor.getContent();
equal(actual, expected);
start();
}, editor.getBody());
});
} else {
test('ignored', function() {
ok(true, "Tests ignored since the browser isn't IE8.");
});
}
var initTinyFunction = function() {
tinymce.init({
mode : "exact",
elements : "elm1",
init_instance_callback : function(ed) {
editor = ed;
}
});
}
</script>
</head>
<body>
<h1 id="qunit-header">Internet Explorer 8 Quirks</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">
<textarea id="elm1" name="elm1"></textarea>
<div>
<a href="javascript:alert(tinymce.EditorManager.get('elm1').getContent({format : 'raw'}));">[getRawContents]</a>
<a href="javascript:alert(tinymce.EditorManager.get('elm1').getContent());">[getContents]</a>
</div>
</div>
<script>
initWhenTinyAndRobotAreReady(initTinyFunction);
</script>
</body>
</html>