diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-08-18 11:07:07 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-08-18 19:22:53 +0200 |
commit | 5296b0ffe3ce031cab29d64d62e1bdc3fb2595fe (patch) | |
tree | fc18edc8c8a5557c21232718fec4acda3da72a10 /cui/source/dialogs | |
parent | 987fe1175de2db53235cc6f2441335fcc3548d64 (diff) |
don't access network during a UITest
Change-Id: If6cc3da3e75ad7689a0de35784c2d29d5b01b96e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155833
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui/source/dialogs')
-rw-r--r-- | cui/source/dialogs/AdditionsDialog.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/cui/source/dialogs/AdditionsDialog.cxx b/cui/source/dialogs/AdditionsDialog.cxx index 73b16ed06e90..f0dedf626acf 100644 --- a/cui/source/dialogs/AdditionsDialog.cxx +++ b/cui/source/dialogs/AdditionsDialog.cxx @@ -275,6 +275,11 @@ SearchAndParseThread::SearchAndParseThread(AdditionsDialog* pDialog, const bool , m_bExecute(true) , m_bIsFirstLoading(isFirstLoading) { + // if we are running a UITest, e.g. UITest_sw_options then + // don't attempt to downloading anything + static const bool bUITest = getenv("LIBO_TEST_UNIT"); + + m_bUITest = bUITest; } SearchAndParseThread::~SearchAndParseThread() {} @@ -284,7 +289,8 @@ void SearchAndParseThread::Append(AdditionInfo& additionInfo) if (!m_bExecute) return; OUString aPreviewFile; - bool bResult = getPreviewFile(additionInfo, aPreviewFile); // info vector json data + bool bResult + = !m_bUITest && getPreviewFile(additionInfo, aPreviewFile); // info vector json data if (!bResult) { @@ -398,7 +404,7 @@ void SearchAndParseThread::execute() if (m_bIsFirstLoading) { - std::string sResponse = ucbGet(m_pAdditionsDialog->m_sURL); + std::string sResponse = !m_bUITest ? ucbGet(m_pAdditionsDialog->m_sURL) : ""; parseResponse(sResponse, m_pAdditionsDialog->m_aAllExtensionsVector); std::sort(m_pAdditionsDialog->m_aAllExtensionsVector.begin(), m_pAdditionsDialog->m_aAllExtensionsVector.end(), |