<commit_before>$.define("event","more/spec,event",function(){
    var iframe =  $("<iframe id='test_event' style='display:none;width:0px;height:0px;' src='/test/event.html' frameBorder=0  />" ).appendTo("body");//
    window.eventTestCall = function(){
        var idoc = iframe.contents()[0];
        $.fixture("事件模块-event",{
            "fire complicated event": function(id){
                $(document).keyup(function(e){
                    expect( e.type, id ).eq( "keyup" );
                    $.log("fire complicated event "+ e.type);
                    $(this).unbind(e.type)
                }).fire("keyup");
                $(document).mousedown(function(e){
                    expect( e.type, id ).eq( "mousedown" );
                    $.log("fire complicated event "+ e.type);
                    $(this).unbind(e.type)
                }).fire("mousedown");
                $(document).mouseup(function(e){
                    expect( e.type, id ).eq( "mouseup" );
                    $.log("fire complicated event "+ e.type);
                    $(this).unbind(e.type)
                }).fire("mouseup");
                $(document).contextmenu(function(e){
                    expect( e.type, id ).eq( "contextmenu" );
                    $.log("fire complicated event "+ e.type);
                    $(this).unbind(e.type)
                }).fire("contextmenu");
                $(document).mousemove(function(e){
                    expect( e.type, id ).eq( "mousemove" );
                    $.log("fire complicated event "+ e.type);
                    $(this).unbind(e.type)
                }).fire("mousemove");
                $("body").mousewheel(function(e){
                    expect( e.type, id ).eq( "mousewheel" );
                    $.log("fire complicated event "+ e.type);
                    $(this).unbind(e.type)
                }).fire("mousewheel")
            },

            "fire mouseover, mouseenter": function(id){
                var node = $("#mouseenter",idoc);
                node.mouseover(function(e){
                    expect( e.type, id ).eq( "mouseover" );
                    $.log("mouseover")
                });
                node.mouseenter(function(e){
                    expect( e.type, id ).eq( "mouseenter" );
                    $.log("mouseenter")
                });
                node.fire("mouseover");
                node.fire("mouseenter")
            },
            "fire mouseleave": function(id){
                var node = $("#mouseenter",idoc);
                node.mouseleave(function(e){
                    expect( e.type, id ).eq( "mouseleave" );
                    $.log("mouseleave")
                });
                node.fire("mouseleave")
            },
            "click":function(id){
                var a = $("#domtree,#domtree div",idoc).click(function(e){
                    expect( e.type, id ).eq( "click" );
                });
                var tabindex = []
                a.eq(0).find("div").each(function(el){
                    el.onclick = function(){
                        var a = this.tabIndex || this.tabindex;
                        $.log(a)
                        tabindex.push(a);
                    }
                });
                a.filter(".inner").fire("click");
                expect( tabindex.join(","),id ).eq( "5,4,3,2,1" );
                
            },
            "focusin": function(id){
                $("#focusin",idoc).bind("focusin",function(e){
                    expect( e.target.id,id ).eq( "focus_input" );
                    e.target.style.color = "red";
                });
                $("#focus_input",idoc).fire("focusin");//DOMFocusIn
            },
            "event clone": function(id){
                var source = $("#source",idoc).click(function(e){
                    $.log(e.type+":"+this.innerHTML)
                    expect(e.type+":"+this.innerHTML, id ).eq( "click:clone" );
                }).mousedown(function(e){
                    $.log(e.type+":"+this.innerHTML);
                    expect(e.type+":"+this.innerHTML, id ).eq( "mousedown:clone" );
                });
                var clone = source.clone(true).html("clone").afterTo(source)
                clone.fire("click").fire("mousedown")
            },
            "mass_fire": function( id ){
                var form = $("#form", idoc);
                form.submit(function(e){
                    $.log(e.type+":"+e.currentTarget.nodeName)
                    expect(e.type+":"+e.currentTarget.nodeName, id).eq("submit:FORM")
                });
                //测试冒泡
                $("body", idoc).submit(function(e){
                    $.log(e.type+":"+e.currentTarget.nodeName);<commit_msg>添加执行次数的测试<commit_after>$.define("event","more/spec,event",function(){
    var iframe =  $("<iframe id='test_event' style='display:none;width:0px;height:0px;' src='/test/event.html' frameBorder=0  />" ).appendTo("body");//
    window.eventTestCall = function(){
        var idoc = iframe.contents()[0];
        $.fixture("事件模块-event",{
            "fire complicated event": function(id){
                $(document).keyup(function(e){
                    expect( e.type, id ).eq( "keyup" );
                    $.log("fire complicated event "+ e.type);
                    $(this).unbind(e.type)
                }).fire("keyup");
                $(document).mousedown(function(e){
                    expect( e.type, id ).eq( "mousedown" );
                    $.log("fire complicated event "+ e.type);
                    $(this).unbind(e.type)
                }).fire("mousedown");
                $(document).mouseup(function(e){
                    expect( e.type, id ).eq( "mouseup" );
                    $.log("fire complicated event "+ e.type);
                    $(this).unbind(e.type)
                }).fire("mouseup");
                $(document).contextmenu(function(e){
                    expect( e.type, id ).eq( "contextmenu" );
                    $.log("fire complicated event "+ e.type);
                    $(this).unbind(e.type)
                }).fire("contextmenu");
                $(document).mousemove(function(e){
                    expect( e.type, id ).eq( "mousemove" );
                    $.log("fire complicated event "+ e.type);
                    $(this).unbind(e.type)
                }).fire("mousemove");
                $("body").mousewheel(function(e){
                    expect( e.type, id ).eq( "mousewheel" );
                    $.log("fire complicated event "+ e.type);
                    $(this).unbind(e.type)
                }).fire("mousewheel")
            },

            "fire mouseover, mouseenter": function(id){
                var node = $("#mouseenter",idoc);
                node.mouseover(function(e){
                    expect( e.type, id ).eq( "mouseover" );
                    $.log("mouseover")
                });
                node.mouseenter(function(e){
                    expect( e.type, id ).eq( "mouseenter" );
                    $.log("mouseenter")
                });
                node.fire("mouseover");
                node.fire("mouseenter")
            },
            "fire mouseleave": function(id){
                var node = $("#mouseenter",idoc);
                node.mouseleave(function(e){
                    expect( e.type, id ).eq( "mouseleave" );
                    $.log("mouseleave")
                });
                node.fire("mouseleave")
            },
            "click":function(id){
                var a = $("#domtree,#domtree div",idoc).click(function(e){
                    expect( e.type, id ).eq( "click" );
                });
                var tabindex = []
                a.eq(0).find("div").each(function(el){
                    el.onclick = function(){
                        var a = this.tabIndex || this.tabindex;
                        $.log(a)
                        tabindex.push(a);
                    }
                });
                a.filter(".inner").fire("click");
                expect( tabindex.join(","),id ).eq( "5,4,3,2,1" );
                
            },
            "focusin": function(id){
                $("#focusin",idoc).bind("focusin",function(e){
                    expect( e.target.id,id ).eq( "focus_input" );
                    e.target.style.color = "red";
                });
                $("#focus_input",idoc).fire("focusin");//DOMFocusIn
            },
            "event clone": function(id){
                var source = $("#source",idoc).click(function(e){
                    $.log(e.type+":"+this.innerHTML)
                    expect(e.type+":"+this.innerHTML, id ).eq( "click:clone" );
                }).mousedown(function(e){
                    $.log(e.type+":"+this.innerHTML);
                    expect(e.type+":"+this.innerHTML, id ).eq( "mousedown:clone" );
                });
                var clone = source.clone(true).html("clone").afterTo(source)
                clone.fire("click").fire("mousedown")
            },
            "event.times": function(){
                var a = 1;//测试事件的调用次数
                $("body").on("mouseup",function(){
                    a++;
                },2)
                $("body").fire("mouseup");
                $("body").fire("mouseup");
                $("body").fire("mouseup");
                $("body").fire("mouseup");
                $("body").fire("mouseup")
                expect(a ).eq( 3 );
            },
            "mass_fire": function( id ){
                var form = $("#form", idoc);
                form.submit(function(e){
                    $.log(e.type+":"+e.currentTarget.nodeName)
                    expect(e.type+":"+e.currentTarget.nodeName, id).eq("submit:FORM")
                });
                //测试冒泡
                $("body", idoc).submit(function(e){
                    $.log(e.type+":"+e.currentTarget.nodeName);
{'fraction_non_alphanumeric': 0.17221607484156523, 'fraction_numerical': 0.002313650538175234, 'mean_word_length': 1.283417547083142, 'pattern_counts': {'":': 29, '<': 5, '<?xml version=': 0, '>': 5, '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': '2924592', 'n_tokens_mistral': 2795, 'n_tokens_neox': 2611, 'n_words': 415}