From dc8ca078921b520581445e2f9d6b138759d592b2 Mon Sep 17 00:00:00 2001 From: worry127722 Date: Mon, 16 Jun 2014 13:55:01 +0800 Subject: [PATCH] [test] --- _test/plugins/enterkey.js | 8 ++++---- _test/plugins/font.js | 16 ++++++++-------- _test/plugins/selectall.js | 2 +- _test/plugins/source.js | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/_test/plugins/enterkey.js b/_test/plugins/enterkey.js index eb58f1be..ab9902be 100644 --- a/_test/plugins/enterkey.js +++ b/_test/plugins/enterkey.js @@ -9,15 +9,15 @@ test( 'chrome删除div', function () { editor.body.innerHTML = '

一级标题


'; range.setStart( body.firstChild.firstChild, 4 ).collapse( 1 ).select(); ua.keydown(editor.body,{'keyCode':13}); + ua.keyup(editor.body,{'keyCode':13}); range.selectNode(body.lastChild).select(); var index = editor.undoManger.index; var br = ua.browser.ie ? '' : '
'; - ua.keyup(editor.body,{'keyCode':13}); - equal(editor.undoManger.list.length,2,'保存现场'); + equal(editor.undoManger.list.length,1,'保存现场'); setTimeout( function () { equal( body.childNodes.length, 2, '2个子节点' ); - equal(body.lastChild.tagName.toLowerCase(),'p','div转成p'); - equal(ua.getChildHTML(body),'

一级标题


','检查内容'); + equal(body.lastChild.tagName.toLowerCase(),'div','div转成p'); + equal(ua.getChildHTML(body),'

一级标题


','检查内容'); start(); }, 60 ); stop(); diff --git a/_test/plugins/font.js b/_test/plugins/font.js index d171e8c5..a560abf5 100644 --- a/_test/plugins/font.js +++ b/_test/plugins/font.js @@ -357,21 +357,21 @@ test('预先设置字体颜色,再输入文本,查看文本颜色', function }); } }); -test('font不转span', function () { +test('font转span', function () { var editor = te.obj[0]; editor.focus(); editor.setContent('hellohello'); var html = 'hellohello'; - var html = 'hellohello'; - ua.checkHTMLSameStyle(html, editor.document, editor.body.firstChild, '不转换font标签'); + var html = 'hellohello'; + ua.checkHTMLSameStyle(html, editor.document, editor.body.firstChild, 'font转span'); editor.setContent('hello'); //html = 'hello'; - html = 'hello'; - ua.checkHTMLSameStyle(html, editor.document, editor.body.firstChild, '不转换font标签'); + html = 'hello'; + ua.checkHTMLSameStyle(html, editor.document, editor.body.firstChild, 'font转span'); }); -test('font标签不发生转换', function () { +test('font标签转换为span', function () { var editor = te.obj[0]; editor.setContent('x'); // if(ua.browser.chrome){ @@ -385,9 +385,9 @@ test('font标签不发生转换', function () { var html1 = '

x

'; ua.checkSameHtml(editor.getContent(editor.body),html1,'确认一下确实是正确的'); editor.setContent('x'); - html = 'x'; + html = 'x'; //equal(editor.body.firstChild.innerHTML.toLowerCase(),html,'font不转换标签');//ff和chrome下都是正确的,ie下报错,但是错误的提示中,可以看到期待的和实际得到的也是一样的 不知道为何报错 - ua.checkSameHtml(editor.body.firstChild.innerHTML.toLowerCase(),html,'font不转换标签'); + ua.checkSameHtml(editor.body.firstChild.innerHTML.toLowerCase(),html,'font标签转换为span'); }); diff --git a/_test/plugins/selectall.js b/_test/plugins/selectall.js index e1f6a609..e616f55c 100644 --- a/_test/plugins/selectall.js +++ b/_test/plugins/selectall.js @@ -52,7 +52,7 @@ test( 'ctrl+a', function() { ua.keydown(editor.body,{'keyCode':65,'ctrlKey':true}); setTimeout( function() { var range = editor.selection.getRange(); - if ( ua.browser.gecko ) + if ( ua.browser.gecko||ua.browser.chrome ) ua.checkResult( range, body, body, 0, 2, false, '查看全选后的range' ); else ua.checkResult( range, body.firstChild.firstChild, body.lastChild.firstChild, 0, 6, false, '查看全选后的range' ); diff --git a/_test/plugins/source.js b/_test/plugins/source.js index 3c8816d6..3a7ebbd4 100644 --- a/_test/plugins/source.js +++ b/_test/plugins/source.js @@ -34,7 +34,7 @@ test('设定range,切源码再切回来',function(){//trace 3647 editor.execCommand('source'); setTimeout(function () { editor.execCommand('source'); - if (ua.browser.gecko) {//todo range 判断 + if (ua.browser.gecko||ua.browser.chrome) {//todo range 判断 ua.checkResult(editor.selection.getRange(), editor.body, editor.body, 0, 1, false, '选区不变'); } else { ua.checkResult(editor.selection.getRange(), editor.body.firstChild.firstChild, editor.body.firstChild.firstChild, 0, 12, false, '选区不变');