summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2020-11-26 11:41:18 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2020-11-26 10:59:15 +0100
commit269e36ece4ff720e10c83126d7c553c7287645c6 (patch)
tree97960981163dad0592ee9c380fdcc0d8f84dded9 /chart2
parent82d8d76b8a6bb0d7b6585411666f5421a99b6d34 (diff)
Introduce BootstrapFixture::IsDefaultDPI convenience function
It should be used to conditionally disable tests that are unreliable in non-default-DPI environments. The workaround implemented by use of the function should be temporary, until a proper fix is found. Change-Id: Ie236226fcfd0ffb054149efc2b7a1727506c4ad0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106661 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/qa/extras/chart2import.cxx5
-rw-r--r--chart2/qa/extras/xshape/chart2xshape.cxx14
2 files changed, 9 insertions, 10 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index a0b9c00dd24d..490b2ce2698d 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -2563,6 +2563,11 @@ void Chart2ImportTest::testStockChartShiftedCategoryPosition()
void Chart2ImportTest::testTdf133376()
{
+ // FIXME: the DPI check should be removed when either (1) the test is fixed to work with
+ // non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin.
+ if (!IsDefaultDPI())
+ return;
+
load("/chart2/qa/extras/data/xlsx/", "tdf133376.xlsx");
Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0, mxComponent),
UNO_QUERY_THROW);
diff --git a/chart2/qa/extras/xshape/chart2xshape.cxx b/chart2/qa/extras/xshape/chart2xshape.cxx
index 68dcc1e7e030..a1a0032effc3 100644
--- a/chart2/qa/extras/xshape/chart2xshape.cxx
+++ b/chart2/qa/extras/xshape/chart2xshape.cxx
@@ -14,8 +14,6 @@
#include <test/xmldiff.hxx>
#include <test/xmltesttools.hxx>
-#include <vcl/outdev.hxx>
-#include <vcl/svapp.hxx>
#include <fstream>
@@ -117,8 +115,7 @@ void Chart2XShapeTest::testPieChartLabels1()
{
// FIXME: the DPI check should be removed when either (1) the test is fixed to work with
// non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin.
- if (Application::GetDefaultDevice()->GetDPIX() != 96
- || Application::GetDefaultDevice()->GetDPIY() != 96)
+ if (!IsDefaultDPI())
return;
// inside placement for the best fit case
@@ -130,8 +127,7 @@ void Chart2XShapeTest::testPieChartLabels2()
{
// FIXME: the DPI check should be removed when either (1) the test is fixed to work with
// non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin.
- if (Application::GetDefaultDevice()->GetDPIX() != 96
- || Application::GetDefaultDevice()->GetDPIY() != 96)
+ if (!IsDefaultDPI())
return;
// text wrap: wrap all text labels except one
@@ -143,8 +139,7 @@ void Chart2XShapeTest::testPieChartLabels3()
{
// FIXME: the DPI check should be removed when either (1) the test is fixed to work with
// non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin.
- if (Application::GetDefaultDevice()->GetDPIX() != 96
- || Application::GetDefaultDevice()->GetDPIY() != 96)
+ if (!IsDefaultDPI())
return;
// text wrap: wrap no text label except one
@@ -156,8 +151,7 @@ void Chart2XShapeTest::testPieChartLabels4()
{
// FIXME: the DPI check should be removed when either (1) the test is fixed to work with
// non-default DPI; or (2) unit tests on Windows are made to use svp VCL plugin.
- if (Application::GetDefaultDevice()->GetDPIX() != 96
- || Application::GetDefaultDevice()->GetDPIY() != 96)
+ if (!IsDefaultDPI())
return;
// data value and percent value are centered horizontally