diff options
author | Sergey Yershov <yershov@corp.mail.ru> | 2016-03-09 15:10:00 +0300 |
---|---|---|
committer | Sergey Yershov <yershov@corp.mail.ru> | 2016-03-23 16:51:34 +0300 |
commit | f21b74ab9cdb4f89ba1a5c994de3ff5431b2aded (patch) | |
tree | 4ac8890265ce75241c8c901c447760ec85f4033b /storage/storage_integration_tests | |
parent | 0c2cacdb205f323a4fd02327fa9a0bdad7dafdec (diff) |
Prevents downloading MWM file if it is already downloaded and not out of date
Diffstat (limited to 'storage/storage_integration_tests')
-rw-r--r-- | storage/storage_integration_tests/storage_downloading_tests.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/storage/storage_integration_tests/storage_downloading_tests.cpp b/storage/storage_integration_tests/storage_downloading_tests.cpp index 9cab7ebf70..484209d533 100644 --- a/storage/storage_integration_tests/storage_downloading_tests.cpp +++ b/storage/storage_integration_tests/storage_downloading_tests.cpp @@ -55,6 +55,24 @@ void InitStorage(Storage & storage, Storage::TProgressFunction const & onProgres } // namespace +UNIT_TEST(SmallMwms_ReDownloadExistedMWMIgnored_Test) +{ + WritableDirChanger writableDirChanger(kMapTestDir); + Storage storage(COUNTRIES_FILE); + TEST(version::IsSingleMwm(storage.GetCurrentDataVersion()), ()); + + InitStorage(storage, [](TCountryId const & countryId, TLocalAndRemoteSize const & mapSize){}); + TEST(!storage.IsDownloadInProgress(), ()); + + storage.DownloadNode(kCountryId); + TEST(storage.IsDownloadInProgress(), ()); + testing::RunEventLoop(); + + TEST(!storage.IsDownloadInProgress(), ()); + storage.DownloadNode(kCountryId); + TEST(!storage.IsDownloadInProgress(), ()); +} + UNIT_TEST(SmallMwms_InterruptDownloadResumeDownload_Test) { WritableDirChanger writableDirChanger(kMapTestDir); |