summaryrefslogtreecommitdiff
path: root/indra/viewer_components/updater/tests/llupdaterservice_test.cpp
diff options
context:
space:
mode:
authorMark Palange (Mani) <palange@lindenlab.com>2010-11-10 14:26:14 -0800
committerMark Palange (Mani) <palange@lindenlab.com>2010-11-10 14:26:14 -0800
commitb2e84d739b4f5c00b497e57e892fc10d78af8b76 (patch)
treef035b0be5134c0286f4af7d4f5835ea533ec2e3f /indra/viewer_components/updater/tests/llupdaterservice_test.cpp
parentf42bb00627f756b277496ec203d567cac31b3438 (diff)
CHOP-151 Adding startup updater flow to drive update installation and resume.
Diffstat (limited to 'indra/viewer_components/updater/tests/llupdaterservice_test.cpp')
-rw-r--r--indra/viewer_components/updater/tests/llupdaterservice_test.cpp71
1 files changed, 68 insertions, 3 deletions
diff --git a/indra/viewer_components/updater/tests/llupdaterservice_test.cpp b/indra/viewer_components/updater/tests/llupdaterservice_test.cpp
index 7f45ae51fb..57732ad0a5 100644
--- a/indra/viewer_components/updater/tests/llupdaterservice_test.cpp
+++ b/indra/viewer_components/updater/tests/llupdaterservice_test.cpp
@@ -36,6 +36,7 @@
#include "../../../test/debug.h"
#include "llevents.h"
+#include "lldir.h"
/*****************************************************************************
* MOCK'd
@@ -48,6 +49,70 @@ void LLUpdateChecker::check(std::string const & protocolVersion, std::string con
LLUpdateDownloader::LLUpdateDownloader(Client & ) {}
void LLUpdateDownloader::download(LLURI const & , std::string const &){}
+class LLDir_Mock : public LLDir
+{
+ void initAppDirs(const std::string &app_name,
+ const std::string& app_read_only_data_dir = "") {}
+ U32 countFilesInDir(const std::string &dirname, const std::string &mask)
+ {
+ return 0;
+ }
+
+ BOOL getNextFileInDir(const std::string &dirname,
+ const std::string &mask,
+ std::string &fname, BOOL wrap)
+ {
+ return false;
+ }
+ void getRandomFileInDir(const std::string &dirname,
+ const std::string &mask,
+ std::string &fname) {}
+ std::string getCurPath() { return ""; }
+ BOOL fileExists(const std::string &filename) const { return false; }
+ std::string getLLPluginLauncher() { return ""; }
+ std::string getLLPluginFilename(std::string base_name) { return ""; }
+
+} gDirUtil;
+LLDir* gDirUtilp = &gDirUtil;
+LLDir::LLDir() {}
+LLDir::~LLDir() {}
+S32 LLDir::deleteFilesInDir(const std::string &dirname,
+ const std::string &mask)
+{ return 0; }
+
+void LLDir::setChatLogsDir(const std::string &path){}
+void LLDir::setPerAccountChatLogsDir(const std::string &username){}
+void LLDir::setLindenUserDir(const std::string &username){}
+void LLDir::setSkinFolder(const std::string &skin_folder){}
+bool LLDir::setCacheDir(const std::string &path){ return true; }
+void LLDir::dumpCurrentDirectories() {}
+
+std::string LLDir::getExpandedFilename(ELLPath location,
+ const std::string &filename) const
+{
+ return "";
+}
+
+std::string LLUpdateDownloader::downloadMarkerPath(void)
+{
+ return "";
+}
+
+void LLUpdateDownloader::resume(void) {}
+
+/*
+#pragma warning(disable: 4273)
+llus_mock_llifstream::llus_mock_llifstream(const std::string& _Filename,
+ ios_base::openmode _Mode,
+ int _Prot) :
+ std::basic_istream<char,std::char_traits< char > >(NULL,true)
+{}
+
+llus_mock_llifstream::~llus_mock_llifstream() {}
+bool llus_mock_llifstream::is_open() const {return true;}
+void llus_mock_llifstream::close() {}
+*/
+
/*****************************************************************************
* TUT
*****************************************************************************/
@@ -96,9 +161,9 @@ namespace tut
bool got_usage_error = false;
try
{
- updater.setParams("1.0",test_url, "update" ,test_channel, test_version);
+ updater.initialize("1.0",test_url, "update" ,test_channel, test_version);
updater.startChecking();
- updater.setParams("1.0", "other_url", "update", test_channel, test_version);
+ updater.initialize("1.0", "other_url", "update", test_channel, test_version);
}
catch(LLUpdaterService::UsageError)
{
@@ -112,7 +177,7 @@ namespace tut
{
DEBUG;
LLUpdaterService updater;
- updater.setParams("1.0", test_url, "update", test_channel, test_version);
+ updater.initialize("1.0", test_url, "update", test_channel, test_version);
updater.startChecking();
ensure(updater.isChecking());
updater.stopChecking();