Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
dde9b4d8
Kaydet (Commit)
dde9b4d8
authored
Ock 06, 2016
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
uitest: some more work for the UI testing
Change-Id: I79193190f8f614b2d6a71032f05a0518eb9d1a1d
üst
d5c3f1bf
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
124 additions
and
9 deletions
+124
-9
testdllapi.hxx
include/test/testdllapi.hxx
+6
-0
uiobject.hxx
include/test/uiobject.hxx
+31
-4
uitest.hxx
include/test/uitest.hxx
+6
-0
Library_uitest.mk
test/Library_uitest.mk
+1
-1
uiobject.cxx
test/source/uitest/uiobject.cxx
+75
-4
window.cxx
vcl/source/window/window.cxx
+5
-0
No files found.
include/test/testdllapi.hxx
Dosyayı görüntüle @
dde9b4d8
...
...
@@ -28,6 +28,12 @@
#define OOO_DLLPUBLIC_TEST SAL_DLLPUBLIC_IMPORT
#endif
#if defined DLLIMPLEMENTATION_UITEST
#define UITEST_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
#else
#define UITEST_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
#endif
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
include/test/uiobject.hxx
Dosyayı görüntüle @
dde9b4d8
...
...
@@ -9,20 +9,27 @@
#include <rtl/ustring.hxx>
#include <map>
#include <memory>
#include <vcl/window.hxx>
#include <test/testdllapi.hxx>
enum
class
UIObjectType
{
WINDOW
,
DIALOG
,
UNKNOWN
};
typedef
std
::
map
<
const
OUString
,
OUString
>
StringMap
;
/**
* This class wraps a UI object like vcl::Window and provides
* an interface for the UI testing.
*
* This class should only have virtual methods.
*/
class
UIObject
class
UI
TEST_DLLPUBLIC
UI
Object
{
public
:
...
...
@@ -31,16 +38,36 @@ public:
/**
* returns the state of the wrapped UI object
*/
virtual
std
::
map
<
const
OUString
,
OUString
>
get_state
();
virtual
StringMap
get_state
();
/**
* executes an action on the wrapped UI object,
* possibly with some additional parameters
*/
virtual
void
execute
(
const
OUString
&
rAction
,
const
std
::
map
<
const
OUString
,
OUString
>&
rParameters
);
const
StringMap
&
rParameters
);
virtual
UIObjectType
getType
()
const
;
virtual
std
::
unique_ptr
<
UIObject
>
get_child
(
const
OUString
&
rID
);
};
class
WindowUIObject
:
public
UIObject
{
VclPtr
<
vcl
::
Window
>
mxWindow
;
public
:
WindowUIObject
(
VclPtr
<
vcl
::
Window
>
xWindow
);
virtual
StringMap
get_state
()
override
;
virtual
void
execute
(
const
OUString
&
rAction
,
const
StringMap
&
rParameters
)
override
;
virtual
UIObjectType
getType
()
const
override
;
virtual
UIObjectType
getType
(
);
virtual
std
::
unique_ptr
<
UIObject
>
get_child
(
const
OUString
&
rID
);
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
include/test/uitest.hxx
Dosyayı görüntüle @
dde9b4d8
...
...
@@ -7,6 +7,12 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <test/testdllapi.hxx>
class
UITEST_DLLPUBLIC
UITest
{
public
:
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
test/Library_uitest.mk
Dosyayı görüntüle @
dde9b4d8
...
...
@@ -10,7 +10,7 @@
$(eval $(call gb_Library_Library,uitest))
$(eval $(call gb_Library_add_defs,uitest,\
-D
OOO_
DLLIMPLEMENTATION_UITEST \
-DDLLIMPLEMENTATION_UITEST \
))
$(eval $(call gb_Library_use_sdk_api,uitest))
...
...
test/source/uitest/uiobject.cxx
Dosyayı görüntüle @
dde9b4d8
...
...
@@ -9,27 +9,98 @@
#include <test/uiobject.hxx>
#include <iostream>
UIObject
::~
UIObject
()
{
}
std
::
map
<
const
OUString
,
OUString
>
UIObject
::
get_state
()
StringMap
UIObject
::
get_state
()
{
std
::
map
<
const
OUString
,
OUString
>
aMap
;
StringMap
aMap
;
aMap
[
"NotImplemented"
]
=
"NotImplemented"
;
return
aMap
;
}
void
UIObject
::
execute
(
const
OUString
&
/*rAction*/
,
const
std
::
map
<
const
OUString
,
OUString
>
&
/*rParameters*/
)
const
StringMap
&
/*rParameters*/
)
{
// should never be called
throw
std
::
exception
();
}
UIObjectType
UIObject
::
getType
()
UIObjectType
UIObject
::
getType
()
const
{
return
UIObjectType
::
UNKNOWN
;
}
std
::
unique_ptr
<
UIObject
>
UIObject
::
get_child
(
const
OUString
&
)
{
return
std
::
unique_ptr
<
UIObject
>
();
}
WindowUIObject
::
WindowUIObject
(
VclPtr
<
vcl
::
Window
>
xWindow
)
:
mxWindow
(
xWindow
)
{
}
StringMap
WindowUIObject
::
get_state
()
{
StringMap
aMap
;
aMap
[
"Visible"
]
=
OUString
::
boolean
(
mxWindow
->
IsVisible
());
aMap
[
"Enabled"
]
=
OUString
::
boolean
(
mxWindow
->
IsEnabled
());
if
(
mxWindow
->
GetParent
())
aMap
[
"Parent"
]
=
mxWindow
->
GetParent
()
->
get_id
();
return
aMap
;
}
void
WindowUIObject
::
execute
(
const
OUString
&
rAction
,
const
StringMap
&
rParameters
)
{
if
(
rAction
==
"SET"
)
{
for
(
auto
itr
=
rParameters
.
begin
();
itr
!=
rParameters
.
end
();
++
itr
)
{
std
::
cout
<<
itr
->
first
;
}
}
}
UIObjectType
WindowUIObject
::
getType
()
const
{
return
UIObjectType
::
WINDOW
;
}
namespace
{
vcl
::
Window
*
findChild
(
vcl
::
Window
*
pParent
,
const
OUString
&
rID
)
{
if
(
!
pParent
)
return
nullptr
;
size_t
nCount
=
pParent
->
GetChildCount
();
for
(
size_t
i
=
0
;
i
<
nCount
;
++
i
)
{
vcl
::
Window
*
pChild
=
pParent
->
GetChild
(
i
);
if
(
pChild
&&
pChild
->
get_id
()
==
rID
)
return
pChild
;
vcl
::
Window
*
pResult
=
findChild
(
pChild
,
rID
);
if
(
pResult
)
return
pResult
;
}
}
}
std
::
unique_ptr
<
UIObject
>
WindowUIObject
::
get_child
(
const
OUString
&
rID
)
{
vcl
::
Window
*
pWindow
=
findChild
(
mxWindow
.
get
(),
rID
);
if
(
pWindow
)
return
std
::
unique_ptr
<
UIObject
>
(
new
WindowUIObject
(
pWindow
));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vcl/source/window/window.cxx
Dosyayı görüntüle @
dde9b4d8
...
...
@@ -1829,6 +1829,11 @@ void Window::KeyInput( const KeyEvent& rKEvt )
if
(
autoacc
&&
cod
.
GetModifier
()
!=
0x4000
)
return
;
}
if
(
cod
.
IsShift
()
&&
cod
.
IsMod1
()
&&
cod
.
GetCode
()
==
KEY_F12
)
{
}
NotifyEvent
aNEvt
(
MouseNotifyEvent
::
KEYINPUT
,
this
,
&
rKEvt
);
if
(
!
CompatNotify
(
aNEvt
)
)
mpWindowImpl
->
mbKeyInput
=
true
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment