summaryrefslogtreecommitdiff
path: root/desktop/qa
diff options
context:
space:
mode:
authorAndrzej Hunt <andrzej@ahunt.org>2015-11-06 18:09:34 +0100
committerAndrzej Hunt <andrzej@ahunt.org>2015-11-08 09:58:12 +0000
commit2f13f051c3c39f77d5f65ff0e3f4a476ccb95f1a (patch)
treebecee9dd9d85c0e0f9d5d4136af3b37d61688e12 /desktop/qa
parent8655fa318c1924994eb659b4bb60074c86ad70c1 (diff)
sc lok: Add initial test for .uno:CellCursor
This should be extended with checking that we receive "EMPTY" when there is no cursor shown - that would require e.g. simulating keyboard input to hide the cell cursor. Change-Id: Ia7be5ec3e158f21967b4c307ac10abb2b5e2a56a Reviewed-on: https://gerrit.libreoffice.org/19828 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Andrzej Hunt <andrzej@ahunt.org> Tested-by: Andrzej Hunt <andrzej@ahunt.org>
Diffstat (limited to 'desktop/qa')
-rw-r--r--desktop/qa/desktop_lib/test_desktop_lib.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 0e666782564c..17002b7b75eb 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -68,6 +68,7 @@ public:
void testSaveAsCalc();
void testPasteWriter();
void testRowColumnHeaders();
+ void testCellCursor();
void testCommandResult();
CPPUNIT_TEST_SUITE(DesktopLOKTest);
@@ -82,6 +83,7 @@ public:
CPPUNIT_TEST(testSaveAsCalc);
CPPUNIT_TEST(testPasteWriter);
CPPUNIT_TEST(testRowColumnHeaders);
+ CPPUNIT_TEST(testCellCursor);
CPPUNIT_TEST(testCommandResult);
CPPUNIT_TEST_SUITE_END();
@@ -435,6 +437,24 @@ void DesktopLOKTest::testRowColumnHeaders()
}
}
+void DesktopLOKTest::testCellCursor()
+{
+ LibLODocument_Impl* pDocument = loadDoc("search.ods");
+
+ boost::property_tree::ptree aTree;
+
+ char* pJSON = pDocument->m_pDocumentClass->getCommandValues(pDocument, ".uno:CellCursor?tileWidth=1&tileHeight=1&outputWidth=1&outputHeight=1");
+
+ std::stringstream aStream(pJSON);
+ free(pJSON);
+ CPPUNIT_ASSERT(!aStream.str().empty());
+
+ boost::property_tree::read_json(aStream, aTree);
+
+ OString aRectangle(aTree.get<std::string>("commandValues").c_str());
+ CPPUNIT_ASSERT_EQUAL(aRectangle, OString("0, 0, 1278, 254"));
+}
+
void DesktopLOKTest::testCommandResult()
{
LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");