|
Lines 17-22
Link Here
|
| 17 |
}, |
17 |
}, |
| 18 |
|
18 |
|
| 19 |
members : { |
19 |
members : { |
|
|
20 |
|
| 21 |
testFocusIndicator : function() { |
| 22 |
var hasFocusIndicator = function( widget ) { |
| 23 |
var node = widget._getTargetNode(); |
| 24 |
var result = false; |
| 25 |
for( var i = 0; i < node.childNodes.length; i++ ) { |
| 26 |
if( node.childNodes[ i ].getAttribute( "id") == "focusIndicator" ) { |
| 27 |
result = true; |
| 28 |
} |
| 29 |
} |
| 30 |
return result; |
| 31 |
} |
| 32 |
var button = new org.eclipse.rwt.widgets.Button( "push" ); |
| 33 |
this._currentButton = button; |
| 34 |
button.addToDocument(); |
| 35 |
qx.ui.core.Widget.flushGlobalQueues(); |
| 36 |
assertFalse( button.hasState( "focus" ) ); |
| 37 |
assertFalse( hasFocusIndicator( button ) ); |
| 38 |
button.focus(); |
| 39 |
qx.ui.core.Widget.flushGlobalQueues(); |
| 40 |
assertTrue( hasFocusIndicator( button ) ); |
| 41 |
button.setImage( "test.jpg" ); |
| 42 |
qx.ui.core.Widget.flushGlobalQueues(); |
| 43 |
assertTrue( hasFocusIndicator( button ) ); |
| 44 |
button.blur(); |
| 45 |
qx.ui.core.Widget.flushGlobalQueues(); |
| 46 |
assertFalse( hasFocusIndicator( button ) ); |
| 47 |
button.destroy(); |
| 48 |
qx.ui.core.Widget.flushGlobalQueues(); |
| 49 |
}, |
| 50 |
|
| 20 |
testParent : function() { |
51 |
testParent : function() { |
| 21 |
var button = new org.eclipse.rwt.widgets.Button( "push" ); |
52 |
var button = new org.eclipse.rwt.widgets.Button( "push" ); |
| 22 |
this._currentButton = button; |
53 |
this._currentButton = button; |
|
Lines 33-39
Link Here
|
| 33 |
button.getCellNode( 2 ).parentNode |
64 |
button.getCellNode( 2 ).parentNode |
| 34 |
); |
65 |
); |
| 35 |
button.setParent( null ); |
66 |
button.setParent( null ); |
| 36 |
button.dispose(); |
67 |
button.destroy(); |
| 37 |
qx.ui.core.Widget.flushGlobalQueues(); |
68 |
qx.ui.core.Widget.flushGlobalQueues(); |
| 38 |
}, |
69 |
}, |
| 39 |
|
70 |
|
|
Lines 45-51
Link Here
|
| 45 |
qx.ui.core.Widget.flushGlobalQueues(); |
76 |
qx.ui.core.Widget.flushGlobalQueues(); |
| 46 |
assertEquals( "Hello World!", button.getCellNode( 2 ).innerHTML ); |
77 |
assertEquals( "Hello World!", button.getCellNode( 2 ).innerHTML ); |
| 47 |
button.setParent( null ); |
78 |
button.setParent( null ); |
| 48 |
button.dispose(); |
79 |
button.destroy(); |
| 49 |
qx.ui.core.Widget.flushGlobalQueues(); |
80 |
qx.ui.core.Widget.flushGlobalQueues(); |
| 50 |
}, |
81 |
}, |
| 51 |
|
82 |
|
|
Lines 59-65
Link Here
|
| 59 |
this.testUtil.getCssBackgroundImage( button.getCellNode( 1 ) ).search( "test.jpg" ) != -1 |
90 |
this.testUtil.getCssBackgroundImage( button.getCellNode( 1 ) ).search( "test.jpg" ) != -1 |
| 60 |
); |
91 |
); |
| 61 |
button.setParent( null ); |
92 |
button.setParent( null ); |
| 62 |
button.dispose(); |
93 |
button.destroy(); |
| 63 |
qx.ui.core.Widget.flushGlobalQueues(); |
94 |
qx.ui.core.Widget.flushGlobalQueues(); |
| 64 |
}, |
95 |
}, |
| 65 |
|
96 |
|