tests/ImageTests.st
branchjv
changeset 8269 5382a417a503
child 8420 76e39223f5ab
equal deleted inserted replaced
8232:ddbaa22b9352 8269:5382a417a503
       
     1 "{ Package: 'stx:libview/tests' }"
       
     2 
       
     3 "{ NameSpace: Smalltalk }"
       
     4 
       
     5 TestCase subclass:#ImageTests
       
     6 	instanceVariableNames:''
       
     7 	classVariableNames:''
       
     8 	poolDictionaries:''
       
     9 	category:'Graphics-Images-Tests'
       
    10 !
       
    11 
       
    12 
       
    13 !ImageTests methodsFor:'running'!
       
    14 
       
    15 setUp
       
    16     Screen current isNil ifTrue:[
       
    17         Smalltalk openDisplay
       
    18     ].
       
    19     self skipIf: Screen current isNil description: 'Display connection not available'
       
    20 
       
    21     "Created: / 25-04-2016 / 20:30:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    22     "Modified: / 03-01-2018 / 21:27:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    23 ! !
       
    24 
       
    25 !ImageTests methodsFor:'tests - regression'!
       
    26 
       
    27 test_fromScreen_01
       
    28     | image |
       
    29 
       
    30     self skipIf: true  description: 'Image fromScreen: is broken on XWayland'.
       
    31     image := Image fromScreen.
       
    32 
       
    33     "Created: / 04-01-2018 / 09:22:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    34 !
       
    35 
       
    36 test_fromView_01
       
    37     | view image |
       
    38 
       
    39     [ 
       
    40         view := Button new.
       
    41         view label: 'Hello world'.
       
    42         view open.
       
    43         image := Image fromView: view grab: false.  
       
    44     ] ensure:[ 
       
    45         view topView close.
       
    46     ].
       
    47     self assert: image notNil.
       
    48 
       
    49     "Created: / 03-01-2018 / 21:28:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    50 ! !
       
    51 
       
    52 !ImageTests class methodsFor:'documentation'!
       
    53 
       
    54 version_HG
       
    55 
       
    56     ^ '$Changeset: <not expanded> $'
       
    57 ! !
       
    58