RegressionTests__Win32OLETests.st
author Claus Gittinger <cg@exept.de>
Tue, 25 Feb 2020 17:19:49 +0100
changeset 2586 7dc7be5a6f3d
parent 2480 6ffb0b50d9cb
permissions -rw-r--r--
#OTHER by cg s
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1707
76213a555906 #BUGFIX by sr
sr
parents: 1447
diff changeset
     1
"{ Encoding: utf8 }"
76213a555906 #BUGFIX by sr
sr
parents: 1447
diff changeset
     2
2480
6ffb0b50d9cb #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
     3
"
6ffb0b50d9cb #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
     4
 COPYRIGHT (c) 2018 by eXept Software AG
6ffb0b50d9cb #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
     5
              All Rights Reserved
6ffb0b50d9cb #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
     6
6ffb0b50d9cb #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
     7
 This software is furnished under a license and may be used
6ffb0b50d9cb #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
     8
 only in accordance with the terms of that license and with the
6ffb0b50d9cb #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
6ffb0b50d9cb #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
    10
 be provided or otherwise made available to, or used by, any
6ffb0b50d9cb #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
    11
 other person.  No title to or ownership of the software is
6ffb0b50d9cb #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
    12
 hereby transferred.
6ffb0b50d9cb #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
    13
"
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 1393
diff changeset
    14
"{ Package: 'stx:goodies/regression' }"
1353
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
"{ NameSpace: RegressionTests }"
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
TestCase subclass:#Win32OLETests
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	instanceVariableNames:''
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	classVariableNames:''
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
	poolDictionaries:''
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
	category:'tests-Regression-RuntimeSystem'
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
2480
6ffb0b50d9cb #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
    25
!Win32OLETests class methodsFor:'documentation'!
6ffb0b50d9cb #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
    26
6ffb0b50d9cb #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
    27
copyright
6ffb0b50d9cb #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
    28
"
6ffb0b50d9cb #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
    29
 COPYRIGHT (c) 2018 by eXept Software AG
6ffb0b50d9cb #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
    30
              All Rights Reserved
6ffb0b50d9cb #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
    31
6ffb0b50d9cb #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
    32
 This software is furnished under a license and may be used
6ffb0b50d9cb #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
    33
 only in accordance with the terms of that license and with the
6ffb0b50d9cb #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
6ffb0b50d9cb #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
    35
 be provided or otherwise made available to, or used by, any
6ffb0b50d9cb #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
    36
 other person.  No title to or ownership of the software is
6ffb0b50d9cb #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
    37
 hereby transferred.
6ffb0b50d9cb #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
    38
"
6ffb0b50d9cb #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 2233
diff changeset
    39
! !
1353
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
1355
8844ec16d47b #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
    41
!Win32OLETests class methodsFor:'queries'!
8844ec16d47b #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
    42
8844ec16d47b #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
    43
coveredPackageNames
8844ec16d47b #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
    44
    ^ #('exept:ole')
8844ec16d47b #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
    45
! !
8844ec16d47b #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 1353
diff changeset
    46
1353
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
!Win32OLETests methodsFor:'tests'!
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
test00_loadOLE
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    |iid_IEnum|
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
2233
73a9c0ab4b0a #BUGFIX by Stefan Reise
sr
parents: 1722
diff changeset
    52
    self 
73a9c0ab4b0a #BUGFIX by Stefan Reise
sr
parents: 1722
diff changeset
    53
        skipIf:[
73a9c0ab4b0a #BUGFIX by Stefan Reise
sr
parents: 1722
diff changeset
    54
            OperatingSystem isMSWINDOWSlike not 
73a9c0ab4b0a #BUGFIX by Stefan Reise
sr
parents: 1722
diff changeset
    55
            or:[ExternalAddress pointerSize = 8]] 
73a9c0ab4b0a #BUGFIX by Stefan Reise
sr
parents: 1722
diff changeset
    56
        description:'test skipped (OS is not WINDOWS 32bit)'.
1353
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
    Smalltalk at:#ExternalLibraryFunction:Verbose put:true.
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
    Smalltalk at:#ObjectFileLoader:Verbose put:true.
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
    "/
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
    "/ this will already perform a number of calls into OLE,
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
    "/ to get the CLSIDs of various wellknown interfaces
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
    "/ (see OLEInterfaceConstants initialize)
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
    Smalltalk loadPackage:'exept:ole'.
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 1393
diff changeset
    66
    "/ so when we arrive here without error, some is already known to work..
1353
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
    self assert:(OLEInterfaceConstants notNil).
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
    iid_IEnum := OLEInterfaceConstants classVarAt:#'IID_IEnum'.
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
    self assert:(iid_IEnum notNil).
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
    self assert:(iid_IEnum class == GUID).
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
    self assert:(iid_IEnum printString = '{2AE64960-CDDD-101C-9029-040224007802}').
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
    "
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
     self new test00_loadOLE
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
    "
2233
73a9c0ab4b0a #BUGFIX by Stefan Reise
sr
parents: 1722
diff changeset
    77
73a9c0ab4b0a #BUGFIX by Stefan Reise
sr
parents: 1722
diff changeset
    78
    "Modified: / 21-05-2019 / 16:22:47 / Stefan Reise"
1356
a8e8d673f22e #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1355
diff changeset
    79
!
a8e8d673f22e #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1355
diff changeset
    80
a8e8d673f22e #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1355
diff changeset
    81
test01_SysAllocString
2233
73a9c0ab4b0a #BUGFIX by Stefan Reise
sr
parents: 1722
diff changeset
    82
    |ole rslt|
1356
a8e8d673f22e #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1355
diff changeset
    83
2233
73a9c0ab4b0a #BUGFIX by Stefan Reise
sr
parents: 1722
diff changeset
    84
    self 
73a9c0ab4b0a #BUGFIX by Stefan Reise
sr
parents: 1722
diff changeset
    85
        skipIf:[
73a9c0ab4b0a #BUGFIX by Stefan Reise
sr
parents: 1722
diff changeset
    86
            OperatingSystem isMSWINDOWSlike not 
73a9c0ab4b0a #BUGFIX by Stefan Reise
sr
parents: 1722
diff changeset
    87
            or:[ExternalAddress pointerSize = 8]] 
73a9c0ab4b0a #BUGFIX by Stefan Reise
sr
parents: 1722
diff changeset
    88
        description:'test skipped (OS is not WINDOWS 32bit)'.
1707
76213a555906 #BUGFIX by sr
sr
parents: 1447
diff changeset
    89
1356
a8e8d673f22e #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1355
diff changeset
    90
    ole := OLEAutomationDLL current.
a8e8d673f22e #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1355
diff changeset
    91
    rslt := ole SysAllocString: 'hello World'.
a8e8d673f22e #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1355
diff changeset
    92
a8e8d673f22e #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1355
diff changeset
    93
    self assert:(rslt notNil).
1372
a990b4eb7030 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
    94
    self assert:(rslt sizeInBytes == (4 + ('hello World' size * 2) "+ 2")).
a990b4eb7030 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
    95
    self assert:(rslt sizeInCharacters == 'hello World' size).
a990b4eb7030 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
    96
    self assert:(rslt characterAt:1) == $h.
a990b4eb7030 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1356
diff changeset
    97
    self assert:(rslt characterAt:2) == $e.
1356
a8e8d673f22e #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1355
diff changeset
    98
a8e8d673f22e #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1355
diff changeset
    99
    "
a8e8d673f22e #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1355
diff changeset
   100
     self new test01_SysAllocString
a8e8d673f22e #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1355
diff changeset
   101
    "
2233
73a9c0ab4b0a #BUGFIX by Stefan Reise
sr
parents: 1722
diff changeset
   102
73a9c0ab4b0a #BUGFIX by Stefan Reise
sr
parents: 1722
diff changeset
   103
    "Modified (format): / 21-05-2019 / 16:22:55 / Stefan Reise"
1374
caed36c1303d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1372
diff changeset
   104
!
caed36c1303d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1372
diff changeset
   105
caed36c1303d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1372
diff changeset
   106
test02_GuidFromProgID
1722
54ee95429abb #BUGFIX by sr
sr
parents: 1707
diff changeset
   107
    |guid appToId|
1374
caed36c1303d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1372
diff changeset
   108
1722
54ee95429abb #BUGFIX by sr
sr
parents: 1707
diff changeset
   109
    self 
2233
73a9c0ab4b0a #BUGFIX by Stefan Reise
sr
parents: 1722
diff changeset
   110
        skipIf:[
73a9c0ab4b0a #BUGFIX by Stefan Reise
sr
parents: 1722
diff changeset
   111
            OperatingSystem isMSWINDOWSlike not 
73a9c0ab4b0a #BUGFIX by Stefan Reise
sr
parents: 1722
diff changeset
   112
            or:[ExternalAddress pointerSize = 8]] 
73a9c0ab4b0a #BUGFIX by Stefan Reise
sr
parents: 1722
diff changeset
   113
        description:'test skipped (OS is not WINDOWS 32bit)'.
1707
76213a555906 #BUGFIX by sr
sr
parents: 1447
diff changeset
   114
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 1393
diff changeset
   115
    self
1707
76213a555906 #BUGFIX by sr
sr
parents: 1447
diff changeset
   116
        should:[
1722
54ee95429abb #BUGFIX by sr
sr
parents: 1707
diff changeset
   117
            guid := GUID clsidFromProgID:'Foo.Bar'.
54ee95429abb #BUGFIX by sr
sr
parents: 1707
diff changeset
   118
        ] 
54ee95429abb #BUGFIX by sr
sr
parents: 1707
diff changeset
   119
        raise:OLEError.
1376
d2973f7acf8c #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 1375
diff changeset
   120
1722
54ee95429abb #BUGFIX by sr
sr
parents: 1707
diff changeset
   121
    appToId := Dictionary new.
54ee95429abb #BUGFIX by sr
sr
parents: 1707
diff changeset
   122
    appToId at:'AcroPDF.PDF'                        put:nil.
54ee95429abb #BUGFIX by sr
sr
parents: 1707
diff changeset
   123
    appToId at:'InternetExplorer.Application'       put:'{0002DF01-0000-0000-C000-000000000046}'.
54ee95429abb #BUGFIX by sr
sr
parents: 1707
diff changeset
   124
    appToId at:'Msxml2.DOMDocument.4.0'             put:'{88D969C0-F192-11D4-A65F-0040963251E5}'.
54ee95429abb #BUGFIX by sr
sr
parents: 1707
diff changeset
   125
    appToId at:'Microsoft.JScript.Vsa.VsaEngine'    put:'{B71E484D-93ED-4B56-BFB9-CEED5134822B}'.
54ee95429abb #BUGFIX by sr
sr
parents: 1707
diff changeset
   126
        
54ee95429abb #BUGFIX by sr
sr
parents: 1707
diff changeset
   127
    appToId keysAndValuesDo:[:app :id |
54ee95429abb #BUGFIX by sr
sr
parents: 1707
diff changeset
   128
        OLEError handle:[:ex |
54ee95429abb #BUGFIX by sr
sr
parents: 1707
diff changeset
   129
            ex hresult = (OLEStatusCodeConstants at:#CO_E_CLASSSTRING) ifTrue:[
54ee95429abb #BUGFIX by sr
sr
parents: 1707
diff changeset
   130
                "/ kind of expected - your machine has app not installed...
54ee95429abb #BUGFIX by sr
sr
parents: 1707
diff changeset
   131
                Transcript showCR:'OLE: class not found: ', app
54ee95429abb #BUGFIX by sr
sr
parents: 1707
diff changeset
   132
            ] ifFalse:[
54ee95429abb #BUGFIX by sr
sr
parents: 1707
diff changeset
   133
                self assert:false description:'unexpected error code'.
54ee95429abb #BUGFIX by sr
sr
parents: 1707
diff changeset
   134
            ]
54ee95429abb #BUGFIX by sr
sr
parents: 1707
diff changeset
   135
        ] do:[
54ee95429abb #BUGFIX by sr
sr
parents: 1707
diff changeset
   136
            guid := GUID clsidFromProgID:app.
54ee95429abb #BUGFIX by sr
sr
parents: 1707
diff changeset
   137
            self assert:guid notNil.
54ee95429abb #BUGFIX by sr
sr
parents: 1707
diff changeset
   138
54ee95429abb #BUGFIX by sr
sr
parents: 1707
diff changeset
   139
            id notNil ifTrue:[
54ee95429abb #BUGFIX by sr
sr
parents: 1707
diff changeset
   140
                self assert:guid printString = id.
54ee95429abb #BUGFIX by sr
sr
parents: 1707
diff changeset
   141
            ].
54ee95429abb #BUGFIX by sr
sr
parents: 1707
diff changeset
   142
        ].
1375
7be5753688a8 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 1374
diff changeset
   143
    ].
1374
caed36c1303d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1372
diff changeset
   144
caed36c1303d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1372
diff changeset
   145
    "
caed36c1303d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1372
diff changeset
   146
     self new test02_GuidFromProgID
caed36c1303d #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1372
diff changeset
   147
    "
1377
c68053a15d26 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1376
diff changeset
   148
c68053a15d26 #REFACTORING
Claus Gittinger <cg@exept.de>
parents: 1376
diff changeset
   149
    "Modified: / 30-03-2016 / 02:28:15 / cg"
2233
73a9c0ab4b0a #BUGFIX by Stefan Reise
sr
parents: 1722
diff changeset
   150
    "Modified: / 21-05-2019 / 16:23:00 / Stefan Reise"
1378
9f3b1678697b #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
   151
!
9f3b1678697b #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
   152
1381
7fae9f959864 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
   153
test03_verbsEnumerator
7fae9f959864 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
   154
    |clsID enumerator nextVerb|
7fae9f959864 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
   155
1707
76213a555906 #BUGFIX by sr
sr
parents: 1447
diff changeset
   156
    self skipIf:[OperatingSystem isMSWINDOWSlike not] description:'test skipped (OS is not WINDOWS)'.
1722
54ee95429abb #BUGFIX by sr
sr
parents: 1707
diff changeset
   157
    self skipIf:true description:'tests unfinished code'.
1707
76213a555906 #BUGFIX by sr
sr
parents: 1447
diff changeset
   158
1381
7fae9f959864 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
   159
    clsID := GUID clsidFromProgID:'InternetExplorer.Application'.
7fae9f959864 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
   160
    self assert:clsID notNil.
7fae9f959864 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
   161
    self assert:(clsID printString = '{0002DF01-0000-0000-C000-000000000046}').
7fae9f959864 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
   162
7fae9f959864 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
   163
    enumerator := OLERegistryInterface verbsEnumerator:clsID.
7fae9f959864 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
   164
    self assert:(enumerator notNil).
7fae9f959864 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
   165
7fae9f959864 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
   166
    nextVerb := enumerator next.
7fae9f959864 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
   167
    self assert:nextVerb notNil.
7fae9f959864 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
   168
    enumerator release.
7fae9f959864 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
   169
7fae9f959864 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
   170
    "
7fae9f959864 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
   171
     self new test03_verbsEnumerator
7fae9f959864 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
   172
    "
7fae9f959864 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
   173
7fae9f959864 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
   174
    "Created: / 30-03-2016 / 11:29:03 / cg"
7fae9f959864 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
   175
!
7fae9f959864 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
   176
7fae9f959864 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
   177
test20_CreateInstance
1380
6b362a19ffd2 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 1379
diff changeset
   178
    |guid iDispatch iWebBrowser iWebBrowserApp iWebBrowser2
1382
82953a8ea3e4 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 1381
diff changeset
   179
     ids visibleID params result specTable|
1378
9f3b1678697b #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
   180
1707
76213a555906 #BUGFIX by sr
sr
parents: 1447
diff changeset
   181
    self skipIf:[OperatingSystem isMSWINDOWSlike not] description:'test skipped (OS is not WINDOWS)'.
1722
54ee95429abb #BUGFIX by sr
sr
parents: 1707
diff changeset
   182
    self skipIf:true description:'tests unfinished code'.
1707
76213a555906 #BUGFIX by sr
sr
parents: 1447
diff changeset
   183
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 1393
diff changeset
   184
    guid := (GUID clsidFromProgID:'InternetExplorer.Application').
1378
9f3b1678697b #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
   185
    self assert:(guid notNil).
9f3b1678697b #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
   186
    self assert:(guid printString = '{0002DF01-0000-0000-C000-000000000046}').
9f3b1678697b #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
   187
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 1393
diff changeset
   188
    iDispatch := IClassFactory
1707
76213a555906 #BUGFIX by sr
sr
parents: 1447
diff changeset
   189
                createInstance:guid
76213a555906 #BUGFIX by sr
sr
parents: 1447
diff changeset
   190
                iid: (OLEInterface oleConstantAt:'IID_IDispatch')
76213a555906 #BUGFIX by sr
sr
parents: 1447
diff changeset
   191
                controllingUnknown:nil
76213a555906 #BUGFIX by sr
sr
parents: 1447
diff changeset
   192
                context:(OLEInterface oleConstantAt:'CLSCTX_ALL').
1378
9f3b1678697b #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
   193
    self assert:(iDispatch notNil).
9f3b1678697b #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
   194
9f3b1678697b #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
   195
    self assert:(iDispatch hasTypeInfo).
9f3b1678697b #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
   196
    iWebBrowser := iDispatch queryInterface: IWebBrowser iid.
9f3b1678697b #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
   197
    self assert:(iWebBrowser notNil).
1382
82953a8ea3e4 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 1381
diff changeset
   198
    specTable := OLEDispatchSpecificationTable constructSpecificationTable: iDispatch getTypeInfo.
1378
9f3b1678697b #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
   199
    iDispatch release.
9f3b1678697b #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
   200
9f3b1678697b #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
   201
    iWebBrowserApp := iWebBrowser queryInterface: IWebBrowserApp iid.
9f3b1678697b #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
   202
    self assert:(iWebBrowserApp notNil).
9f3b1678697b #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
   203
    iWebBrowser release.
9f3b1678697b #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
   204
9f3b1678697b #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
   205
    iWebBrowser2 := iWebBrowserApp queryInterface: IWebBrowser2 iid.
9f3b1678697b #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
   206
    self assert:(iWebBrowser2 notNil).
9f3b1678697b #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
   207
    iWebBrowserApp release.
9f3b1678697b #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
   208
1380
6b362a19ffd2 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 1379
diff changeset
   209
    "/ iWebBrowser2 setProperty:'Visible' value:true.
6b362a19ffd2 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 1379
diff changeset
   210
    ids := iWebBrowser2 getIDsOfNames:(Array with:'Visible').
6b362a19ffd2 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 1379
diff changeset
   211
    visibleID := ids first.
6b362a19ffd2 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 1379
diff changeset
   212
6b362a19ffd2 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 1379
diff changeset
   213
    params := OLE_DISPPARAMS new.
6b362a19ffd2 #BUGFIX
Claus Gittinger <cg@exept.de>
parents: 1379
diff changeset
   214
    params cArgs: 0.
1382
82953a8ea3e4 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 1381
diff changeset
   215
    result := iWebBrowser2 invokePropertyGet: visibleID with:params.
82953a8ea3e4 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 1381
diff changeset
   216
    self assert:(result == false).
82953a8ea3e4 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 1381
diff changeset
   217
82953a8ea3e4 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 1381
diff changeset
   218
"/    params := OLEDispatchValueAdaptor new
82953a8ea3e4 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 1381
diff changeset
   219
"/                parametersForPropertySet: aIDispatchSpecification arguments: valueArray
82953a8ea3e4 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 1381
diff changeset
   220
"/                parameters parametersForPropertySet: aDispatchSpecification arguments: valueArray
82953a8ea3e4 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 1381
diff changeset
   221
82953a8ea3e4 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 1381
diff changeset
   222
    params := OLE_DISPPARAMS new.
82953a8ea3e4 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 1381
diff changeset
   223
    params cArgs: 1.
1722
54ee95429abb #BUGFIX by sr
sr
parents: 1707
diff changeset
   224
    params arguments:(Array with:true asOLEVariant).
1382
82953a8ea3e4 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 1381
diff changeset
   225
    result := iWebBrowser2 invokePropertyPut: visibleID with:params.
82953a8ea3e4 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 1381
diff changeset
   226
    self assert:(result == false).
1379
b287b40bb60f #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1378
diff changeset
   227
1378
9f3b1678697b #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
   228
    iWebBrowser2 release.
9f3b1678697b #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
   229
1447
2351db93aa5b package changes
Claus Gittinger <cg@exept.de>
parents: 1393
diff changeset
   230
1378
9f3b1678697b #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
   231
    "
1381
7fae9f959864 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
   232
     self new test20_CreateInstance
1378
9f3b1678697b #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
   233
    "
9f3b1678697b #FEATURE
Claus Gittinger <cg@exept.de>
parents: 1377
diff changeset
   234
1381
7fae9f959864 #DOCUMENTATION
Claus Gittinger <cg@exept.de>
parents: 1380
diff changeset
   235
    "Created: / 30-03-2016 / 11:26:36 / cg"
1382
82953a8ea3e4 #UI_ENHANCEMENT
Claus Gittinger <cg@exept.de>
parents: 1381
diff changeset
   236
    "Modified: / 30-03-2016 / 20:08:04 / cg"
1353
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
! !
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
!Win32OLETests class methodsFor:'documentation'!
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
version
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
    ^ '$Header$'
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
!
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
version_CVS
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
    ^ '$Header$'
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
! !
f4b960546cfe initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248