[Libreoffice-commits] core.git: libreofficekit/CppunitTest_libreofficekit_tiledrendering.mk libreofficekit/qa
Tor Lillqvist
tml at collabora.com
Mon Mar 27 21:00:59 UTC 2017
libreofficekit/CppunitTest_libreofficekit_tiledrendering.mk | 4 +
libreofficekit/qa/unit/tiledrendering.cxx | 26 ++++++------
2 files changed, 18 insertions(+), 12 deletions(-)
New commits:
commit c0b5e7ec7112f228b31389a4a3cc9b40d7c181cb
Author: Tor Lillqvist <tml at collabora.com>
Date: Mon Mar 27 23:38:13 2017 +0300
Use symbolic names for keys from css::awt::Key
Change-Id: Iee2f4540cddeb05fcf0ae2ecadf7de8fbb4e3a0d
diff --git a/libreofficekit/CppunitTest_libreofficekit_tiledrendering.mk b/libreofficekit/CppunitTest_libreofficekit_tiledrendering.mk
index 5b1727efbe98..ead598f965e5 100644
--- a/libreofficekit/CppunitTest_libreofficekit_tiledrendering.mk
+++ b/libreofficekit/CppunitTest_libreofficekit_tiledrendering.mk
@@ -33,6 +33,10 @@ $(eval $(call gb_CppunitTest_add_libs,libreofficekit_tiledrendering,\
))
endif
+$(eval $(call gb_CppunitTest_use_api,libreofficekit_tiledrendering,\
+ offapi \
+))
+
$(eval $(call gb_CppunitTest_use_configuration,libreofficekit_tiledrendering))
# vim: set noet sw=4 ts=4:
diff --git a/libreofficekit/qa/unit/tiledrendering.cxx b/libreofficekit/qa/unit/tiledrendering.cxx
index a4e84ee8d122..a805121992e5 100644
--- a/libreofficekit/qa/unit/tiledrendering.cxx
+++ b/libreofficekit/qa/unit/tiledrendering.cxx
@@ -19,6 +19,8 @@
#include <osl/file.hxx>
#include <rtl/bootstrap.hxx>
+#include <com/sun/star/awt/Key.hpp>
+
#if defined __clang__ && defined __linux__
#include <cxxabi.h>
#include <config_options.h>
@@ -263,16 +265,16 @@ void TiledRenderingTest::testDocumentLoadLanguage(Office* pOffice)
// assert that '.' is the decimal separator
insertString(*pDocument, "1.5");
- pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, 1027); // right arrow
- pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, 1027);
+ pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, css::awt::Key::RIGHT);
+ pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, css::awt::Key::RIGHT);
processEventsToIdle();
insertString(*pDocument, "=2*A1");
- pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, 1280); // enter
- pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, 1280);
- pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, 1025); // up arrow
- pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, 1025);
+ pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, css::awt::Key::RETURN);
+ pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, css::awt::Key::RETURN);
+ pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, css::awt::Key::UP);
+ pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, css::awt::Key::UP);
processEventsToIdle();
// we've got a meaningful result
@@ -290,16 +292,16 @@ void TiledRenderingTest::testDocumentLoadLanguage(Office* pOffice)
// with cs-CZ, the decimal separator is ',' instead, assert that
insertString(*pDocument, "1,5");
- pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, 1027); // right arrow
- pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, 1027);
+ pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, css::awt::Key::RIGHT);
+ pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, css::awt::Key::RIGHT);
processEventsToIdle();
insertString(*pDocument, "=2*A1");
- pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, 1280); // enter
- pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, 1280);
- pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, 1025); // up arrow
- pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, 1025);
+ pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, css::awt::Key::RETURN);
+ pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, css::awt::Key::RETURN);
+ pDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 0, css::awt::Key::UP);
+ pDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 0, css::awt::Key::UP);
processEventsToIdle();
// we've got a meaningful result
More information about the Libreoffice-commits
mailing list