Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_14980201
ueditor
提交
aed77ce2
U
ueditor
项目概览
qq_14980201
/
ueditor
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
ueditor
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
aed77ce2
编写于
10月 29, 2013
作者:
Y
yancend
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[test]用例调整
上级
6cde5d3b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
68 addition
and
33 deletion
+68
-33
_test/plugins/insertcode.js
_test/plugins/insertcode.js
+20
-16
_test/plugins/table.action.js
_test/plugins/table.action.js
+47
-16
_test/plugins/table.core.js
_test/plugins/table.core.js
+1
-1
未找到文件。
_test/plugins/insertcode.js
浏览文件 @
aed77ce2
...
...
@@ -37,7 +37,7 @@ test('trace 3343:插入代码中有空行', function () {
setTimeout
(
function
()
{
UE
.
delEditor
(
'
ue
'
);
start
()
},
1
00
);
},
2
00
);
},
20
);
},
20
);
});
...
...
@@ -52,17 +52,18 @@ test('trace 3355:不闭合选区插入代码', function () {
var
code
=
'
<div id="upload" style="display: none" ><img id="uploadBtn"></div>
'
;
editor
.
setContent
(
code
);
setTimeout
(
function
()
{
ua
.
keydown
(
editor
.
body
,
{
'
keyCode
'
:
65
,
'
ctrlKey
'
:
true
});
editor
.
execCommand
(
'
insertcode
'
,
'
html
'
);
var
br
=
ua
.
browser
.
ie
?
''
:
'
<br>
'
;
if
(
ua
.
browser
.
gecko
||
ua
.
browser
.
opera
||
ua
.
browser
.
ie
>
8
)
ua
.
checkSameHtml
(
editor
.
body
.
innerHTML
,
'
<pre class="brush:html;toolbar:false"><div id=
\
"upload
\
" style=
\
"display: none
\
" ><img id=
\
"uploadBtn
\
"></div></pre>
'
,
'
检查插入了html
'
);
else
ua
.
checkSameHtml
(
editor
.
body
.
innerHTML
,
'
<pre class="brush:html;toolbar:false"><div id=
\
"upload
\
" style=
\
"display: none
\
" ><img id=
\
"uploadBtn
\
"></div></pre><p>
'
+
br
+
'
</p>
'
,
'
检查插入了html
'
);
setTimeout
(
function
()
{
UE
.
delEditor
(
'
ue
'
);
start
()
},
100
);
ua
.
keydown
(
editor
.
body
,
{
'
keyCode
'
:
65
,
'
ctrlKey
'
:
true
});
editor
.
execCommand
(
'
insertcode
'
,
'
html
'
);
var
br
=
ua
.
browser
.
ie
?
''
:
'
<br>
'
;
if
(
ua
.
browser
.
gecko
||
ua
.
browser
.
opera
||
ua
.
browser
.
ie
>
8
)
ua
.
checkSameHtml
(
editor
.
body
.
innerHTML
,
'
<pre class="brush:html;toolbar:false"><div id=
\
"upload
\
" style=
\
"display: none
\
" ><img id=
\
"uploadBtn
\
"></div></pre>
'
,
'
检查插入了html
'
);
else
ua
.
checkSameHtml
(
editor
.
body
.
innerHTML
,
'
<pre class="brush:html;toolbar:false"><div id=
\
"upload
\
" style=
\
"display: none
\
" ><img id=
\
"uploadBtn
\
"></div></pre><p>
'
+
br
+
'
</p>
'
,
'
检查插入了html
'
);
setTimeout
(
function
()
{
UE
.
delEditor
(
'
ue
'
);
document
.
getElementById
(
'
ue
'
)
&&
te
.
dom
.
push
(
document
.
getElementById
(
'
ue
'
));
start
()
},
500
);
},
50
);
});
stop
();
...
...
@@ -91,8 +92,9 @@ test('trace 3395:插入代码为空时,清空编辑器', function () {
ua
.
checkSameHtml
(
editor
.
body
.
innerHTML
,
'
<p>
'
+
br
+
'
</p>
'
,
'
检查编辑器清空
'
);
setTimeout
(
function
()
{
UE
.
delEditor
(
'
ue
'
);
document
.
getElementById
(
'
ue
'
)
&&
te
.
dom
.
push
(
document
.
getElementById
(
'
ue
'
));
start
()
},
1
00
);
},
5
00
);
});
stop
();
});
...
...
@@ -117,7 +119,7 @@ test('trace 3396:多次切换源码,不会产生空行', function () {
setTimeout
(
function
()
{
editor
.
execCommand
(
'
source
'
);
var
end
=
(
ua
.
browser
.
ie
&&
ua
.
browser
.
ie
>
8
)?
''
:
'
<br>
'
;
br
=
(
ua
.
browser
.
ie
&&
ua
.
browser
.
ie
>
9
)?
'
\n
'
:
'
<br>
'
;
br
=
(
ua
.
browser
.
ie
&&
ua
.
browser
.
ie
>
8
)?
'
\n
'
:
'
<br>
'
;
var
Bbr
=
(
ua
.
browser
.
ie
&&
ua
.
browser
.
ie
<
9
)?
'
\n
'
:
''
;
ua
.
checkSameHtml
(
editor
.
body
.
firstChild
.
innerHTML
,
'
<body>
'
+
Bbr
+
br
+
'
</body>
'
+
end
,
'
切回源码无影响
'
);
// setTimeout(function() {//TODO bug修复后去掉注释
...
...
@@ -127,8 +129,9 @@ test('trace 3396:多次切换源码,不会产生空行', function () {
// ua.checkSameHtml(editor.body.firstChild.innerHTML,'<body><br></body><br>','切回源码无影响');
setTimeout
(
function
()
{
UE
.
delEditor
(
'
ue
'
);
document
.
getElementById
(
'
ue
'
)
&&
te
.
dom
.
push
(
document
.
getElementById
(
'
ue
'
));
start
()
},
1
00
);
},
5
00
);
// },20);
// },20);
},
20
);
...
...
@@ -235,8 +238,9 @@ test('test-beforeInsertHTML', function(){
setTimeout
(
function
()
{
UE
.
delEditor
(
'
ue
'
);
document
.
getElementById
(
'
ue
'
)
&&
te
.
dom
.
push
(
document
.
getElementById
(
'
ue
'
));
start
()
},
1
00
);
},
5
00
);
});
stop
();
});
_test/plugins/table.action.js
浏览文件 @
aed77ce2
...
...
@@ -206,6 +206,7 @@ test('从外面粘贴表格到表格-在caption中粘贴,只粘贴文本内容',
/*粘贴*/
stop
();
setTimeout
(
function
()
{
//todo ie9 使用 div[browser.ie ? 'innerText' : 'textContent'] 会多一个换行,用textContent没有
equal
(
html
.
html
,
'
hello1
'
,
'
在caption中粘贴,只粘贴文本内容
'
);
start
();
},
50
);
...
...
@@ -352,7 +353,7 @@ test('backspace事件:deleterow', function () {
equal
(
te
.
obj
[
0
].
selection
.
getRange
().
collapsed
,
true
,
'
检查光标
'
);
equal
(
te
.
obj
[
0
].
selection
.
getRange
().
startContainer
,
te
.
obj
[
0
].
body
.
getElementsByTagName
(
'
td
'
)[
0
],
'
检查光标
'
);
start
();
},
2
0
);
},
10
0
);
},
50
);
});
...
...
@@ -363,9 +364,10 @@ test('backspace事件:deletecol', function () {
range
.
setStart
(
editor
.
body
.
firstChild
,
0
).
collapse
(
true
).
select
();
editor
.
execCommand
(
'
inserttable
'
,
{
numCols
:
3
,
numRows
:
3
});
// expect(5);
editor
.
addListener
(
'
saveScene
'
,
function
()
{
ok
(
true
);
});
// editor.addListener('saveScene', function () {
// ok(true);
//
// });
var
trs
=
editor
.
body
.
firstChild
.
getElementsByTagName
(
'
tr
'
);
var
ut
=
editor
.
getUETable
(
editor
.
body
.
firstChild
);
var
cellsRange
=
ut
.
getCellsRange
(
trs
[
0
].
cells
[
0
],
trs
[
2
].
cells
[
0
]);
...
...
@@ -379,12 +381,40 @@ test('backspace事件:deletecol', function () {
equal
(
te
.
obj
[
0
].
selection
.
getRange
().
startContainer
,
te
.
obj
[
0
].
body
.
getElementsByTagName
(
'
td
'
)[
0
],
'
检查光标
'
);
start
();
},
20
);
});
test
(
'
backspace事件:delcells
'
,
function
()
{
//TODO
});
test
(
'
表格名称中backspace键
'
,
function
()
{
var
editor
=
te
.
obj
[
0
];
var
range
=
te
.
obj
[
1
];
editor
.
setContent
(
'
<p></p>
'
);
range
.
setStart
(
editor
.
body
.
firstChild
,
0
).
collapse
(
true
).
select
();
editor
.
execCommand
(
'
inserttable
'
,
{
numCols
:
3
,
numRows
:
3
});
var
trs
=
editor
.
body
.
firstChild
.
getElementsByTagName
(
'
tr
'
);
range
.
setStart
(
trs
[
0
].
cells
[
0
],
0
).
collapse
(
true
).
select
();
editor
.
execCommand
(
'
insertcaption
'
);
expect
(
8
);
editor
.
addListener
(
'
saveScene
'
,
function
()
{
ok
(
true
);
});
range
.
setStart
(
editor
.
body
.
getElementsByTagName
(
'
caption
'
)[
0
],
0
).
collapse
(
true
).
select
();
ua
.
keydown
(
editor
.
body
,
{
'
keyCode
'
:
8
});
stop
();
setTimeout
(
function
()
{
editor
=
te
.
obj
[
0
];
equal
(
editor
.
body
.
getElementsByTagName
(
'
caption
'
).
length
,
0
,
'
删除caption
'
);
equal
(
editor
.
body
.
getElementsByTagName
(
'
table
'
).
length
,
1
,
'
不会增加表格数量
'
);
equal
(
editor
.
body
.
getElementsByTagName
(
'
tr
'
).
length
,
3
,
'
不会增加表格行数量
'
);
equal
(
editor
.
body
.
getElementsByTagName
(
'
tr
'
)[
0
].
cells
.
length
,
3
,
'
不会增加表格列数量
'
);
equal
(
editor
.
selection
.
getRange
().
collapsed
,
true
,
'
检查光标
'
);
equal
(
editor
.
selection
.
getRange
().
startContainer
,
editor
.
body
.
getElementsByTagName
(
'
td
'
)[
0
],
'
检查光标
'
);
start
();
},
50
);
});
test
(
'
trace 3097 标题行中backspace键
'
,
function
()
{
var
editor
=
te
.
obj
[
0
];
var
range
=
te
.
obj
[
1
];
...
...
@@ -424,7 +454,6 @@ test('拖拽', function () {
var
width1
=
tds
[
1
].
width
;
ua
.
mousemove
(
tds
[
1
],
{
clientX
:
199
,
clientY
:
100
});
ua
.
mousedown
(
tds
[
1
],
{
clientX
:
199
,
clientY
:
100
});
debugger
equal
(
editor
.
body
.
style
.
cursor
,
'
col-resize
'
,
'
检查鼠标显示
'
);
ua
.
mousemove
(
tds
[
1
],
{
clientX
:
299
,
clientY
:
100
});
ua
.
mouseup
(
tds
[
1
],
{
clientX
:
299
,
clientY
:
100
});
...
...
@@ -909,17 +938,19 @@ test('点击一行的最左边,但是每行只有一列,这时选中单元格中
var
tds
=
editor
.
body
.
getElementsByTagName
(
'
td
'
);
tds
[
0
].
innerHTML
=
'
hello
'
;
setTimeout
(
function
()
{
ua
.
click
(
tds
[
0
],
{
clientX
:
10
,
clientY
:
23
});
setTimeout
(
function
()
{
var
selectedTds
=
editor
.
getUETable
(
editor
.
body
.
firstChild
).
selectedTds
;
equal
(
selectedTds
.
length
,
0
,
'
不选中行
'
);
if
(
ua
.
browser
.
webkit
)
{
ua
.
checkResult
(
editor
.
selection
.
getRange
(),
tds
[
0
].
firstChild
,
tds
[
0
].
firstChild
,
0
,
5
,
false
,
'
检查选中的range
'
);
}
else
{
ua
.
checkResult
(
editor
.
selection
.
getRange
(),
tds
[
0
],
tds
[
0
],
0
,
1
,
false
,
'
检查选中的range
'
);
}
start
();
},
500
);
window
.
scrollTo
(
0
,
0
);
//保证位置准确
ua
.
click
(
tds
[
0
],
{
clientX
:
10
,
clientY
:
23
});
setTimeout
(
function
()
{
var
selectedTds
=
editor
.
getUETable
(
editor
.
body
.
firstChild
).
selectedTds
;
equal
(
selectedTds
.
length
,
0
,
'
不选中行
'
);
if
(
ua
.
browser
.
webkit
)
{
ua
.
checkResult
(
editor
.
selection
.
getRange
(),
tds
[
0
].
firstChild
,
tds
[
0
].
firstChild
,
0
,
5
,
false
,
'
检查选中的range
'
);
}
else
{
ua
.
checkResult
(
editor
.
selection
.
getRange
(),
tds
[
0
],
tds
[
0
],
0
,
1
,
false
,
'
检查选中的range
'
);
}
start
();
},
500
);
},
500
);
stop
();
});
...
...
_test/plugins/table.core.js
浏览文件 @
aed77ce2
...
...
@@ -49,7 +49,7 @@ test("getMaxCols", function () {
equal
(
maxCols
,
6
,
"
最大列数为6
"
);
});
test
(
"
getSameEndPosCells
"
,
function
()
{
test
(
"
ie9 active trace 3728
getSameEndPosCells
"
,
function
()
{
var
table
=
getTable
(
"
<tr><td rowspan='2'>1</td><td>2</td><td>3</td></tr><tr><td>2</td><td>3</td></tr>
"
),
ut
=
new
UT
(
table
);
var
cell
=
table
.
rows
[
0
].
cells
[
0
],
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录