Opened 7 years ago

Closed 7 years ago

#14760 closed defect (fixed)

html.html attr_map, attr_reconnect test failures on IE8

Reported by: bill Owned by: bill
Priority: undecided Milestone: 1.8
Component: HTML Version: 1.7.1
Keywords: dohfail Cc:
Blocked By: Blocking:

Description

IE8 and perhaps other browsers/browser versions get intermittent failures on the attr_map and attr_reconnect tests. I finally figured out that the problem happens if the test is run while the browser is minified.

    _AssertFailure: assertEqual() failed: 	expected
		2
	but got
		1

 with hint: 
		onfocus ctr == 2
     ERROR IN: 		 function attr_map(t){
							var input = document.createElement("input");
							var ctr= 0;
							dojo.attr(input, {
								"class": "thinger blah",
								"tabIndex": 1,
								"type": "text",
								"onfocus": function(e){
									ctr++;
								}
							});
							dojo.body().appendChild(input);
							doh.is(1, dojo.attr(input, "tabIndex"), "tabIndex");
							if(!has("ie") || has("ie") > 7){
								// IE6/7 treats type="text" as missing, even if it was
								// explicitly specified
								doh.is("text", dojo.attr(input, "type"), "type");
							}
							doh.is(0, ctr, "onfocus ctr == 0");
							doh.t(dojo.hasClass(input, "thinger"), "hasClass of thinger");
							doh.t(dojo.hasClass(input, "blah"), "hasClass of blah");
							var def = new doh.Deferred();
							input.focus();
							setTimeout(def.getTestErrback(function(){
								doh.is(1, ctr, "onfocus ctr == 1");
								input.blur();
								input.focus();
								setTimeout(def.getTestCallback(function(){
									doh.is(2, ctr, "onfocus ctr == 2");
								}), 10);
							}), 10);
							return def;
						} FAILED test: ../../dojo/tests/_base/html.html::t::attr_map 125 ms     _AssertFailure: assertEqual() failed: 	expected
		2
	but got
		1

     ERROR IN: 		 function attr_reconnect(t){
							var input = document.createElement("input");
							var ctr = 0;
							dojo.attr(input, "type", "text");
							dojo.attr(input, "onfocus", function(e){ ctr++; });
							dojo.attr(input, "onfocus", function(e){ ctr++; });
							dojo.attr(input, "onfocus", function(e){ ctr++; });
							dojo.body().appendChild(input);
							if(!has("ie") || has("ie") > 7){
								// IE6/7 treats type="text" as missing, even if it was
								// explicitly specified
								doh.is("text", dojo.attr(input, "type"));
							}
							doh.is(0, ctr);
							var def = new doh.Deferred();
							input.focus();
							setTimeout(def.getTestErrback(function(){
								doh.is(1, ctr);
								input.blur();
								input.focus();
								setTimeout(def.getTestCallback(function(){
									doh.is(2, ctr);
								}), 10);
							}), 10);
							return def;
						} FAILED test: ../../dojo/tests/_base/html.html::t::attr_reconnect 110 ms

Change History (2)

comment:1 Changed 7 years ago by bill

Keywords: dohfail added
Milestone: tbd1.8
Owner: changed from Eugene Lazutkin to bill
Status: newassigned

I have a fix, I'll checkin.

comment:2 Changed 7 years ago by bill

Resolution: fixed
Status: assignedclosed

In [27811]:

Fix IE spurious test errors in attr_map, attr_reconnect when browser window is minimized. FF still fails though. Fixes #14760.

Note: See TracTickets for help on using tickets.