parseExport only needs to export files

This saves about 50% of the chart2export test time as we no longer
import files that we will never need.

Change-Id: I7ddbae9e8b3194d10e2c25b59cfdd2fa5d345b9d
Reviewed-on: https://gerrit.libreoffice.org/25023
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
This commit is contained in:
Markus Mohrhard
2016-05-16 03:43:24 +02:00
parent 98505584ba
commit df52355607
2 changed files with 10 additions and 2 deletions

View File

@@ -214,7 +214,7 @@ OUString findChartFile(const OUString& rDir, uno::Reference< container::XNameAcc
xmlDocPtr Chart2ExportTest::parseExport(const OUString& rDir, const OUString& rFilterFormat)
{
std::shared_ptr<utl::TempFile> pTempFile = reload(rFilterFormat);
std::shared_ptr<utl::TempFile> pTempFile = save(rFilterFormat);
// Read the XML stream we're interested in.
uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), pTempFile->GetURL());

View File

@@ -71,6 +71,7 @@ class ChartTest : public test::BootstrapFixture, public unotest::MacrosTest
public:
ChartTest():mbSkipValidation(false) {}
void load( const OUString& rDir, const OUString& rFileName );
std::shared_ptr<utl::TempFile> save( const OUString& rFileName );
std::shared_ptr<utl::TempFile> reload( const OUString& rFileName );
uno::Sequence < OUString > getImpressChartColumnDescriptions( const char* pDir, const char* pName );
OUString getFileExtension( const OUString& rFileName );
@@ -117,7 +118,7 @@ void ChartTest::load( const OUString& aDir, const OUString& aName )
CPPUNIT_ASSERT(mxComponent.is());
}
std::shared_ptr<utl::TempFile> ChartTest::reload(const OUString& rFilterName)
std::shared_ptr<utl::TempFile> ChartTest::save(const OUString& rFilterName)
{
uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
auto aArgs(::comphelper::InitPropertySequence({
@@ -126,6 +127,13 @@ std::shared_ptr<utl::TempFile> ChartTest::reload(const OUString& rFilterName)
std::shared_ptr<utl::TempFile> pTempFile = std::make_shared<utl::TempFile>();
pTempFile->EnableKillingFile();
xStorable->storeToURL(pTempFile->GetURL(), aArgs);
return pTempFile;
}
std::shared_ptr<utl::TempFile> ChartTest::reload(const OUString& rFilterName)
{
std::shared_ptr<utl::TempFile> pTempFile = save(rFilterName);
mxComponent->dispose();
mxComponent = loadFromDesktop(pTempFile->GetURL(), maServiceName);
std::cout << pTempFile->GetURL();