<commit_before>/**
 * Created with JetBrains PhpStorm.
 * User: Administrator
 * Date: 13-5-15
 * Time: 下午7:15
 * To change this template use File | Settings | File Templates.
 */
module( 'plugins.video' );

test( '视频', function () {
    var editor = te.obj[0];
    var range = te.obj[1];
    editor.setContent( '<p>hello</p>' );
    range.setStart(editor.body.firstChild,0).collapse(true).select();
    var videoObject  ={url: "http://player.youku.com/player.php/Type/Folder/Fid/19275705/Ob/1/sid/XNTU3Mjk4NzQ4/v.swf", width: "500", height: "400", align: "center"}
    editor.execCommand( 'insertvideo',videoObject);
    stop();
    setTimeout(function(){
        var img = editor.body.getElementsByTagName('img');
        equal(img.length,1,'插入img');
        equal(img[0].width,"500");
        equal(img[0].height,"400");
        equal(img[0].src,editor.options.UEDITOR_HOME_URL+'themes/default/images/spacer.gif');
        if(ua.browser.gecko||ua.browser.ie>8){
            ok(img[0].style.background.indexOf('url(\"'+editor.options.UEDITOR_HOME_URL+'themes/default/images/videologo.gif\")') > -1);
        }
        else
        {
            ok(img[0].style.background.indexOf("url("+editor.options.UEDITOR_HOME_URL+"themes/default/images/videologo.gif)") > -1);
        }
        start();
    },100);
} );<commit_msg>[fix] by Jinqn修改用例<commit_after>/**
 * Created with JetBrains PhpStorm.
 * User: Administrator
 * Date: 13-5-15
 * Time: 下午7:15
 * To change this template use File | Settings | File Templates.
 */
module( 'plugins.video' );

test( '插入优酷视频', function () {
    var editor = te.obj[0];
    var range = te.obj[1];
    editor.setContent( '<p>hello</p>' );
    range.setStart(editor.body.firstChild,0).collapse(true).select();
    var videoObject  ={url: "http://player.youku.com/player.php/Type/Folder/Fid/19275705/Ob/1/sid/XNTU3Mjk4NzQ4/v.swf", width: "500", height: "400", align: "center"}
    editor.execCommand( 'insertvideo',videoObject);
    stop();
    setTimeout(function(){
        var img = editor.body.getElementsByTagName('img');
        equal(img.length,1,'插入img');
        equal(img[0].width,"500");
        equal(img[0].height,"400");
        equal(img[0].src,editor.options.UEDITOR_HOME_URL+'themes/default/images/spacer.gif');
        if(ua.browser.gecko||ua.browser.ie>8){
            ok(img[0].style.background.indexOf('url(\"'+editor.options.UEDITOR_HOME_URL+'themes/default/images/videologo.gif\")') > -1);
        }
        else
        {
            ok(img[0].style.background.indexOf("url("+editor.options.UEDITOR_HOME_URL+"themes/default/images/videologo.gif)") > -1);
        }
        start();
    },100);
} );

test( '插入上传视频', function () {
    var editor = te.obj[0];
    var range = te.obj[1];
    editor.setContent( '<p>hello</p>' );
    range.setStart(editor.body.firstChild,0).collapse(true).select();
    var videoObject  ={url: "http://player.youku.com/player.php/Type/Folder/Fid/19275705/Ob/1/sid/XNTU3Mjk4NzQ4/v.swf", width: "500", height: "400", align: "center"}
    editor.execCommand( 'insertvideo',videoObject);
    stop();
    setTimeout(function(){
        var img = editor.body.getElementsByTagName('img');
        equal(img.length,1,'插入img');
        equal(img[0].width,"500");
        equal(img[0].height,"400");
        equal(img[0].src,editor.options.UEDITOR_HOME_URL+'themes/default/images/spacer.gif');
        if(ua.browser.gecko||ua.browser.ie>8){
            ok(img[0].style.background.indexOf('url(\"'+editor.options.UEDITOR_HOME_URL+'themes/default/images/videologo.gif\")') > -1);
        }
        else
        {
            ok(img[0].style.background.indexOf("url("+editor.options.UEDITOR_HOME_URL+"themes/default/images/videologo.gif)") > -1);
        }
        start();
    },100);
} );
{'fraction_non_alphanumeric': 0.19048884165781083, 'fraction_numerical': 0.035334750265674814, 'mean_word_length': 3.2161254199328106, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '773283', 'n_tokens_mistral': 1412, 'n_tokens_neox': 1366, 'n_words': 169}