Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTim Buschtöns2011-01-18 13:16:21 +0000
committerTim Buschtöns2011-01-18 13:16:21 +0000
commita6ecbf73e0c6a09a27af979c1fa685476b3f33ba (patch)
tree71700be715d3ddb20fe2861554a6039728894ed7 /tests
parentb35ca4d647c7590e82d9ab868d1f0851b00740b6 (diff)
downloadorg.eclipse.rap-a6ecbf73e0c6a09a27af979c1fa685476b3f33ba.tar.gz
org.eclipse.rap-a6ecbf73e0c6a09a27af979c1fa685476b3f33ba.tar.xz
org.eclipse.rap-a6ecbf73e0c6a09a27af979c1fa685476b3f33ba.zip
fix for Bug 334504 - Traverse event with detail = TRAVERSE_RETURN not fired in IE, Safari and Chrome
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.rap.rwt.jstest/js/org/eclipse/rwt/test/tests/EventHandlerTest.js24
-rw-r--r--tests/org.eclipse.rap.rwt.jstest/js/org/eclipse/rwt/test/tests/TestUtilTest.js21
-rw-r--r--tests/org.eclipse.rap.rwt.q07.jstest/js/org/eclipse/rwt/test/tests/EventHandlerTest.js24
-rw-r--r--tests/org.eclipse.rap.rwt.q07.jstest/js/org/eclipse/rwt/test/tests/TestUtilTest.js21
4 files changed, 84 insertions, 6 deletions
diff --git a/tests/org.eclipse.rap.rwt.jstest/js/org/eclipse/rwt/test/tests/EventHandlerTest.js b/tests/org.eclipse.rap.rwt.jstest/js/org/eclipse/rwt/test/tests/EventHandlerTest.js
index 45dcada240..5da6f41c19 100644
--- a/tests/org.eclipse.rap.rwt.jstest/js/org/eclipse/rwt/test/tests/EventHandlerTest.js
+++ b/tests/org.eclipse.rap.rwt.jstest/js/org/eclipse/rwt/test/tests/EventHandlerTest.js
@@ -187,8 +187,26 @@ qx.Class.define( "org.eclipse.rwt.test.tests.EventHandlerTest", {
var expected = [ 120, "X" ];
assertEquals( expected, log );
widget.destroy();
- },
-
+ },
+
+ testKeyPressEnter : function() {
+ var testUtil = org.eclipse.rwt.test.fixture.TestUtil;
+ var widget = new qx.ui.basic.Terminator();
+ widget.addToDocument();
+ testUtil.flush();
+ widget.focus();
+ var log = [];
+ widget.addEventListener( "keypress", function( event ) {
+ log.push( event.getKeyCode() );
+ log.push( event.getCharCode() );
+ log.push( event.getKeyIdentifier() );
+ } );
+ testUtil.keyDown( widget._getTargetNode(), "Enter" );
+ var expected = [ 13, 0, "Enter" ];
+ assertEquals( expected, log );
+ widget.destroy();
+ },
+
testKeyDownPrintable : function() {
var testUtil = org.eclipse.rwt.test.fixture.TestUtil;
var widget = new qx.ui.basic.Terminator();
@@ -282,7 +300,7 @@ qx.Class.define( "org.eclipse.rwt.test.tests.EventHandlerTest", {
var expected = [ "keydown", "keypress", "keypress" ];
assertEquals( expected, log );
widget.destroy();
- },
+ },
testKeyDownPrintableSpecialCharNoKeyInput : function() {
var testUtil = org.eclipse.rwt.test.fixture.TestUtil;
diff --git a/tests/org.eclipse.rap.rwt.jstest/js/org/eclipse/rwt/test/tests/TestUtilTest.js b/tests/org.eclipse.rap.rwt.jstest/js/org/eclipse/rwt/test/tests/TestUtilTest.js
index 0b9381a5c9..44fe5a9de2 100644
--- a/tests/org.eclipse.rap.rwt.jstest/js/org/eclipse/rwt/test/tests/TestUtilTest.js
+++ b/tests/org.eclipse.rap.rwt.jstest/js/org/eclipse/rwt/test/tests/TestUtilTest.js
@@ -436,6 +436,27 @@ qx.Class.define( "org.eclipse.rwt.test.tests.TestUtilTest", {
widget.destroy();
},
+ testPressEnter : function() {
+ var testUtil = org.eclipse.rwt.test.fixture.TestUtil;
+ var widget = new qx.ui.basic.Terminator();
+ widget.addToDocument();
+ testUtil.flush();
+ var log = [];
+ widget.addEventListener( "keypress", function( event ) {
+ log.push( event.getDomEvent().keyCode );
+ log.push( event.getDomEvent().charCode );
+ } );
+ widget.focus();
+ testUtil.press( widget, "Enter" );
+ var expected = qx.core.Variant.select( "qx.client", {
+ "webkit" : [ 13, 13 ],
+ "mshtml|opera" : [ 13, undefined ],
+ "default" : [ 13, 0 ]
+ } );
+ assertEquals( expected, log );
+ widget.destroy();
+ },
+
testShiftPress : function() {
var testUtil = org.eclipse.rwt.test.fixture.TestUtil;
var widget = new qx.ui.basic.Terminator();
diff --git a/tests/org.eclipse.rap.rwt.q07.jstest/js/org/eclipse/rwt/test/tests/EventHandlerTest.js b/tests/org.eclipse.rap.rwt.q07.jstest/js/org/eclipse/rwt/test/tests/EventHandlerTest.js
index 45dcada240..5da6f41c19 100644
--- a/tests/org.eclipse.rap.rwt.q07.jstest/js/org/eclipse/rwt/test/tests/EventHandlerTest.js
+++ b/tests/org.eclipse.rap.rwt.q07.jstest/js/org/eclipse/rwt/test/tests/EventHandlerTest.js
@@ -187,8 +187,26 @@ qx.Class.define( "org.eclipse.rwt.test.tests.EventHandlerTest", {
var expected = [ 120, "X" ];
assertEquals( expected, log );
widget.destroy();
- },
-
+ },
+
+ testKeyPressEnter : function() {
+ var testUtil = org.eclipse.rwt.test.fixture.TestUtil;
+ var widget = new qx.ui.basic.Terminator();
+ widget.addToDocument();
+ testUtil.flush();
+ widget.focus();
+ var log = [];
+ widget.addEventListener( "keypress", function( event ) {
+ log.push( event.getKeyCode() );
+ log.push( event.getCharCode() );
+ log.push( event.getKeyIdentifier() );
+ } );
+ testUtil.keyDown( widget._getTargetNode(), "Enter" );
+ var expected = [ 13, 0, "Enter" ];
+ assertEquals( expected, log );
+ widget.destroy();
+ },
+
testKeyDownPrintable : function() {
var testUtil = org.eclipse.rwt.test.fixture.TestUtil;
var widget = new qx.ui.basic.Terminator();
@@ -282,7 +300,7 @@ qx.Class.define( "org.eclipse.rwt.test.tests.EventHandlerTest", {
var expected = [ "keydown", "keypress", "keypress" ];
assertEquals( expected, log );
widget.destroy();
- },
+ },
testKeyDownPrintableSpecialCharNoKeyInput : function() {
var testUtil = org.eclipse.rwt.test.fixture.TestUtil;
diff --git a/tests/org.eclipse.rap.rwt.q07.jstest/js/org/eclipse/rwt/test/tests/TestUtilTest.js b/tests/org.eclipse.rap.rwt.q07.jstest/js/org/eclipse/rwt/test/tests/TestUtilTest.js
index 0b9381a5c9..44fe5a9de2 100644
--- a/tests/org.eclipse.rap.rwt.q07.jstest/js/org/eclipse/rwt/test/tests/TestUtilTest.js
+++ b/tests/org.eclipse.rap.rwt.q07.jstest/js/org/eclipse/rwt/test/tests/TestUtilTest.js
@@ -436,6 +436,27 @@ qx.Class.define( "org.eclipse.rwt.test.tests.TestUtilTest", {
widget.destroy();
},
+ testPressEnter : function() {
+ var testUtil = org.eclipse.rwt.test.fixture.TestUtil;
+ var widget = new qx.ui.basic.Terminator();
+ widget.addToDocument();
+ testUtil.flush();
+ var log = [];
+ widget.addEventListener( "keypress", function( event ) {
+ log.push( event.getDomEvent().keyCode );
+ log.push( event.getDomEvent().charCode );
+ } );
+ widget.focus();
+ testUtil.press( widget, "Enter" );
+ var expected = qx.core.Variant.select( "qx.client", {
+ "webkit" : [ 13, 13 ],
+ "mshtml|opera" : [ 13, undefined ],
+ "default" : [ 13, 0 ]
+ } );
+ assertEquals( expected, log );
+ widget.destroy();
+ },
+
testShiftPress : function() {
var testUtil = org.eclipse.rwt.test.fixture.TestUtil;
var widget = new qx.ui.basic.Terminator();

Back to the top