Opened 11 years ago

Closed 10 years ago

#8748 closed defect (fixed)

Test failures in dijit.tests.ondijitclick for safari and chrome

Reported by: Adam Peller Owned by: bill
Priority: high Milestone: 1.4
Component: Dijit Version: 1.3.0b1
Keywords: Cc:
Blocked By: Blocking:

Description

There are dojo.isSafari checks in the test. Perhaps they should be changed to isWebKit checks? That still does not seem to account for the numerous failures -- I see everything except the first and last tests failing on trunk.

GROUP "dijit.tests.ondijitclick" has 1 test to run
 17 tests to run in 1 groups
 ------------------------------------------------------------
 GROUP "ondijitclick" has 17 tests to run
 PASSED test: ../../dijit/tests/ondijitclick.html::ondijitclick::ondijitclick fires once on a space-key-up * SKIPPED * 0 ms
 TypeError: Object #<a KeyboardEvent> has no method 'initKeyEvent'
     ERROR IN:
 		 function (t){
							var w = dijit.byId("widget1");
							if (dojo.isSafari){ // safari has error
								this.name += " * SKIPPED *";
								return;
							}

							// simulate control+space up
							if (document.createEvent){
								var e = document.createEvent("KeyboardEvent");
								e.initKeyEvent("keyup",true,true,null,true,false,false,false,32,0);
								w.domNode.focus();
								w.clickCount = 0;
								w.domNode.dispatchEvent(e);
								t.is(0, w.clickCount);
							}	
						}
 FAILED test: ../../dijit/tests/ondijitclick.html::ondijitclick::ondijitclick does not fire with CONTROL+SPACE-up 24 ms
 TypeError: Object #<a KeyboardEvent> has no method 'initKeyEvent'
     ERROR IN:
 		 function (t){
							var w = dijit.byId("widget1");
							if (dojo.isSafari){ // safari has error
								this.name += " * SKIPPED *";
								return;
							}

							// simulate alt+space up
							if (document.createEvent){
								var e = document.createEvent("KeyboardEvent");
								e.initKeyEvent("keyup",true,true,null,false,true,false,false,32,0);
								w.domNode.focus();
								w.clickCount = 0;
								w.domNode.dispatchEvent(e);
								t.is(0, w.clickCount);
							}	
						}
 FAILED test: ../../dijit/tests/ondijitclick.html::ondijitclick::ondijitclick does not fire with ALT+SPACE-up 0 ms
 TypeError: Object #<a KeyboardEvent> has no method 'initKeyEvent'
     ERROR IN:
 		 function (t){
							var w = dijit.byId("widget1");
							if (dojo.isSafari){ // safari has error
								this.name += " * SKIPPED *";
								return;
							}

							// simulate shift+space up
							if (document.createEvent){
								var e = document.createEvent("KeyboardEvent");
								e.initKeyEvent("keyup",true,true,null,false,false,true,false,32,0);
								w.domNode.focus();
								w.clickCount = 0;
								w.domNode.dispatchEvent(e);
								t.is(0, w.clickCount);
							}	
						}
 FAILED test: ../../dijit/tests/ondijitclick.html::ondijitclick::ondijitclick does not fire with SHIFT+SPACE-up 1 ms
 TypeError: Object #<a KeyboardEvent> has no method 'initKeyEvent'
     ERROR IN:
 		 function (t){
							var w = dijit.byId("widget1");
							if (dojo.isSafari){ // safari has error
								this.name += " * SKIPPED *";
								return;
							}

							// simulate meta+space up
							if (document.createEvent){
								var e = document.createEvent("KeyboardEvent");
								e.initKeyEvent("keyup",true,true,null,false,false,false,true,32,0);
								w.domNode.focus();
								w.clickCount = 0;
								w.domNode.dispatchEvent(e);
								t.is(0, w.clickCount);
							}	
						}
 FAILED test: ../../dijit/tests/ondijitclick.html::ondijitclick::ondijitclick does not fire with META+SPACE-up 0 ms
 PASSED test: ../../dijit/tests/ondijitclick.html::ondijitclick::ondijitclick fires once on an enter-key-down except in FF * SKIPPED * 0 ms
 TypeError: Object #<a KeyboardEvent> has no method 'initKeyEvent'
     ERROR IN:
 		 function (t){
							var w = dijit.byId("widget1");
							if (dojo.isSafari){ // safari has error
								this.name += " * SKIPPED *";
								return;
							}

							// simulate control+enter down
							if (document.createEvent && !dojo.isSafari){
								var e = document.createEvent("KeyboardEvent");
								e.initKeyEvent("keydown",true,true,null,true,false,false,false,13,0);
								w.domNode.focus();
								w.clickCount = 0;
								w.domNode.dispatchEvent(e);
								t.is(0,w.clickCount);
							}
						}
 FAILED test: ../../dijit/tests/ondijitclick.html::ondijitclick::ondijitclick does not fire with CONTROL+ENTER-key-down 0 ms
 TypeError: Object #<a KeyboardEvent> has no method 'initKeyEvent'
     ERROR IN:
 		 function (t){
							var w = dijit.byId("widget1");
							if (dojo.isSafari){ // safari has error
								this.name += " * SKIPPED *";
								return;
							}

							// simulate alt+enter down
							if (document.createEvent && !dojo.isSafari){
								var e = document.createEvent("KeyboardEvent");
								e.initKeyEvent("keydown",true,true,null,false,true,false,false,13,0);
								w.domNode.focus();
								w.clickCount = 0;
								w.domNode.dispatchEvent(e);
								t.is(0, w.clickCount);
							}
						}
 FAILED test: ../../dijit/tests/ondijitclick.html::ondijitclick::ondijitclick does not fire with ALT+ENTER-key-down 0 ms
 TypeError: Object #<a KeyboardEvent> has no method 'initKeyEvent'
     ERROR IN:
 		 function (t){
							var w = dijit.byId("widget1");
							if (dojo.isSafari){ // safari has error
								this.name += " * SKIPPED *";
								return;
							}

							// simulate shift+enter down
							if (document.createEvent && !dojo.isSafari){
								var e = document.createEvent("KeyboardEvent");
								e.initKeyEvent("keydown",true,true,null,false,false,true,false,13,0);
								w.domNode.focus();
								w.clickCount = 0;
								w.domNode.dispatchEvent(e);
								t.is(0, w.clickCount);
							}
						}
 FAILED test: ../../dijit/tests/ondijitclick.html::ondijitclick::ondijitclick does not fire with SHIFT+ENTER-key-down 0 ms
 TypeError: Object #<a KeyboardEvent> has no method 'initKeyEvent'
     ERROR IN:
 		 function (t){
							var w = dijit.byId("widget1");
							if (dojo.isSafari){ // safari has error
								this.name += " * SKIPPED *";
								return;
							}

							// simulate shift+enter down
							if (document.createEvent && !dojo.isSafari){
								var e = document.createEvent("KeyboardEvent");
								e.initKeyEvent("keydown",true,true,null,false,false,false,true,13,0);
								w.domNode.focus();
								w.clickCount = 0;
								w.domNode.dispatchEvent(e);
								t.is(0, w.clickCount);
							}
						}
 FAILED test: ../../dijit/tests/ondijitclick.html::ondijitclick::ondijitclick does not fire with META+ENTER-key-down 4 ms
 PASSED test: ../../dijit/tests/ondijitclick.html::ondijitclick::ondijitclick fires once on an enter-key-press in FF * SKIPPED * 0 ms
 TypeError: Object #<a KeyboardEvent> has no method 'initKeyEvent'
     ERROR IN:
 		 function (t){
							var w = dijit.byId("widget1");
							if (dojo.isSafari){ // safari has error
								this.name += " * SKIPPED *";
								return;
							}

							// simulate control+enter down
							if (document.createEvent && !dojo.isSafari){
								var e = document.createEvent("KeyboardEvent");
								e.initKeyEvent("keypress",true,true,null,true,false,false,false,13,0);
								w.domNode.focus();
								w.clickCount = 0;
								w.domNode.dispatchEvent(e);
								t.is(0, w.clickCount);
							}
						}
 FAILED test: ../../dijit/tests/ondijitclick.html::ondijitclick::ondijitclick does not fire with CONTROL+ENTER-key-press 0 ms
 TypeError: Object #<a KeyboardEvent> has no method 'initKeyEvent'
     ERROR IN:
 		 function (t){
							var w = dijit.byId("widget1");
							if (dojo.isSafari){ // safari has error
								this.name += " * SKIPPED *";
								return;
							}

							// simulate alt+enter down
							if (document.createEvent && !dojo.isSafari){
								var e = document.createEvent("KeyboardEvent");
								e.initKeyEvent("keypress",true,true,null,false,true,false,false,13,0);
								w.domNode.focus();
								w.clickCount = 0;
								w.domNode.dispatchEvent(e);
								t.is(0, w.clickCount);
							}
						}
 FAILED test: ../../dijit/tests/ondijitclick.html::ondijitclick::ondijitclick does not fire with ALT+ENTER-key-press 0 ms
 TypeError: Object #<a KeyboardEvent> has no method 'initKeyEvent'
     ERROR IN:
 		 function (t){
							var w = dijit.byId("widget1");
							if (dojo.isSafari){ // safari has error
								this.name += " * SKIPPED *";
								return;
							}

							// simulate shift+enter down
							if (document.createEvent && !dojo.isSafari){
								var e = document.createEvent("KeyboardEvent");
								e.initKeyEvent("keypress",true,true,null,false,false,true,false,13,0);
								w.domNode.focus();
								w.clickCount = 0;
								w.domNode.dispatchEvent(e);
								t.is(0, w.clickCount);
							}
						}
 FAILED test: ../../dijit/tests/ondijitclick.html::ondijitclick::ondijitclick does not fire with SHIFT+ENTER-key-press 0 ms
 TypeError: Object #<a KeyboardEvent> has no method 'initKeyEvent'
     ERROR IN:
 		 function (t){
							var w = dijit.byId("widget1");
							if (dojo.isSafari){ // safari has error
								this.name += " * SKIPPED *";
								return;
							}

							// simulate meta+enter down
							if (document.createEvent && !dojo.isSafari){
								var e = document.createEvent("KeyboardEvent");
								e.initKeyEvent("keypress",true,true,null,false,false,false,true,13,0);
								w.domNode.focus();
								w.clickCount = 0;
								w.domNode.dispatchEvent(e);
								t.is(0, w.clickCount);
							}
						}
 FAILED test: ../../dijit/tests/ondijitclick.html::ondijitclick::ondijitclick does not fire with META+ENTER-key-press 0 ms
 PASSED test: ../../dijit/tests/ondijitclick.html::ondijitclick::ondijitclick does not fire on a space-key-down * SKIPPED * 0 ms
 PASSED test: ../../dijit/tests/ondijitclick.html::ondijitclick::ondijitclick fires once on a mouse click 1 ms
 PASSED test: ../../dijit/tests/ondijitclick.html 0 ms

Change History (5)

comment:1 Changed 11 years ago by Adam Peller

Milestone: tbd1.3
Owner: set to Douglas Hays

comment:2 Changed 11 years ago by Douglas Hays

Owner: changed from Douglas Hays to bill

I'm not completely sure I know what the dijitclick event does. Hopefully bill will know. I'm pretty sure I don't use it anywhere - maybe I should be.

comment:3 Changed 11 years ago by bill

Milestone: 1.31.4
Summary: Chrome: test failures in dijit.tests.ondijitclickTest failures in dijit.tests.ondijitclick for safari and chrome

ondijitclick is just for handling "clicks" via keyboard (enter key or space key) on nodes that aren't normally clicked, like <div>.

Anyway, this is just a problem with the test file. It tries to simulate events using:

var e = document.createEvent("KeyboardEvent");
e.initKeyEvent("keydown",true,true,null,false,false,false,false,32,0);

Should convert it to a robot test. That would be good in any case because it's a truer test.

comment:4 Changed 11 years ago by bill

(In [16819]) This test doesn't run on chrome, nor on safari, due to the way it's written. Should be converted to a robot test. For the time being though, just update the test file to skip the test for chrome, as it does for safari. Refs #8748.

comment:5 Changed 10 years ago by bill

Resolution: fixed
Status: newclosed

In [17013] converted these tests to robot tests, forgot to reference this ticket.

The tests are running fine in safari (4.0.3) and chrome (v3) now.

Note: See TracTickets for help on using tickets.