music.js 1.2 KB

1234567891011121314151617
  1. module( 'plugins.music' );
  2. test( ' trace 3745 3780 音乐', function () {
  3. var editor = te.obj[0];
  4. var range = te.obj[1];
  5. editor.setContent( '<p>hello</p>' );
  6. range.setStart(editor.body.firstChild,0).collapse(true).select();
  7. editor.execCommand( 'music',{url:"http://box.baidu.com/widget/flash/bdspacesong.swf?from=tiebasongwidget&url=…artist=%E5%BC%A0%E6%B6%A6%E8%B4%9E&extra=Vol.%202&autoPlay=false&loop=true"});
  8. stop();
  9. setTimeout(function(){
  10. ua.manualDeleteFillData(editor.body);
  11. ua.checkSameHtml(editor.getContent(),'<p><embed type=\"application/x-shockwave-flash\" class=\"edui-faked-music\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" src=\"http://box.baidu.com/widget/flash/bdspacesong.swf?from=tiebasongwidget&url=…artist=%E5%BC%A0%E6%B6%A6%E8%B4%9E&extra=Vol.%202&autoPlay=false&loop=true\" width=\"400\" height=\"95\" align=\"none\" wmode=\"transparent\" play=\"true\" loop=\"false\" menu=\"false\" allowscriptaccess=\"never\" allowfullscreen=\"true\"/>hello</p>','');
  12. equal(editor.body.firstChild.firstChild.tagName.toLowerCase(),'img');
  13. equal(editor.body.firstChild.firstChild.className,'edui-faked-music');
  14. start();
  15. },50);
  16. } );