From 2ef0cdbbe15dfb83173cad674965f3f9f59f05d3 Mon Sep 17 00:00:00 2001 From: guomeicen Date: Thu, 28 Aug 2025 09:13:57 +0800 Subject: [PATCH 1/3] ActsStorageFileIoV9JSTest Signed-off-by: guomeicen --- services/cloudsyncservice/src/ipc/cloud_sync_service.cpp | 4 ++-- test/unittests/cloudsync_sa/ipc/cloud_sync_service_test.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/services/cloudsyncservice/src/ipc/cloud_sync_service.cpp b/services/cloudsyncservice/src/ipc/cloud_sync_service.cpp index df8dbd037..58eb806cb 100644 --- a/services/cloudsyncservice/src/ipc/cloud_sync_service.cpp +++ b/services/cloudsyncservice/src/ipc/cloud_sync_service.cpp @@ -818,7 +818,7 @@ int32_t CloudSyncService::StartFileCache(const std::vector &uriVec, for (auto &uri : uriVec) { if (!DfsuAccessTokenHelper::CheckUriPermission(uri)) { LOGE("permission denied"); - return E_PERMISSION_DENIED; + return E_ILLEGAL_URI; } } } @@ -833,7 +833,7 @@ int32_t CloudSyncService::StartFileCache(const std::vector &uriVec, if (downloadCb == nullptr) { LOGE("Invalid downloadCallback, not a valid ICloudDownloadCallback."); // Common error code for single and batch download task. - return E_BROKEN_IPC; + return E_SERVICE_INNER_ERROR; } ret = dataSyncManager_->StartDownloadFile(bundleNameUserInfo, uriVec, downloadId, fieldkey, downloadCb, timeout); LOGI("End StartFileCache, ret: %{public}d", ret); diff --git a/test/unittests/cloudsync_sa/ipc/cloud_sync_service_test.cpp b/test/unittests/cloudsync_sa/ipc/cloud_sync_service_test.cpp index 32a1dc64b..cb42c00de 100644 --- a/test/unittests/cloudsync_sa/ipc/cloud_sync_service_test.cpp +++ b/test/unittests/cloudsync_sa/ipc/cloud_sync_service_test.cpp @@ -1395,7 +1395,7 @@ HWTEST_F(CloudSyncServiceTest, StartFileCacheTest001, TestSize.Level1) EXPECT_CALL(*dfsuAccessToken_, GetUserId()).WillOnce(Return(0)); EXPECT_CALL(*dfsuAccessToken_, GetPid()).WillOnce(Return(101)); auto ret = servicePtr_->StartFileCache({uri}, downloadId, fieldkey, callback, timeout); - EXPECT_EQ(ret, E_BROKEN_IPC); + EXPECT_EQ(ret, E_SERVICE_INNER_ERROR); } catch (...) { EXPECT_FALSE(true); GTEST_LOG_(INFO) << "StartFileCacheTest001 failed"; -- Gitee From e0fbb96d717a222c486795fe70e3aa6920d0d7b9 Mon Sep 17 00:00:00 2001 From: guomeicen Date: Fri, 29 Aug 2025 10:13:07 +0000 Subject: [PATCH 2/3] update services/cloudsyncservice/src/ipc/cloud_sync_service.cpp. Signed-off-by: guomeicen --- services/cloudsyncservice/src/ipc/cloud_sync_service.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/cloudsyncservice/src/ipc/cloud_sync_service.cpp b/services/cloudsyncservice/src/ipc/cloud_sync_service.cpp index 58eb806cb..a353e07ce 100644 --- a/services/cloudsyncservice/src/ipc/cloud_sync_service.cpp +++ b/services/cloudsyncservice/src/ipc/cloud_sync_service.cpp @@ -833,7 +833,7 @@ int32_t CloudSyncService::StartFileCache(const std::vector &uriVec, if (downloadCb == nullptr) { LOGE("Invalid downloadCallback, not a valid ICloudDownloadCallback."); // Common error code for single and batch download task. - return E_SERVICE_INNER_ERROR; + return E_BROKEN_IPC; } ret = dataSyncManager_->StartDownloadFile(bundleNameUserInfo, uriVec, downloadId, fieldkey, downloadCb, timeout); LOGI("End StartFileCache, ret: %{public}d", ret); -- Gitee From a3aee8e9d5e4877299851d5129731077a81d8bf2 Mon Sep 17 00:00:00 2001 From: guomeicen Date: Fri, 29 Aug 2025 10:13:56 +0000 Subject: [PATCH 3/3] update test/unittests/cloudsync_sa/ipc/cloud_sync_service_test.cpp. Signed-off-by: guomeicen --- test/unittests/cloudsync_sa/ipc/cloud_sync_service_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unittests/cloudsync_sa/ipc/cloud_sync_service_test.cpp b/test/unittests/cloudsync_sa/ipc/cloud_sync_service_test.cpp index cb42c00de..32a1dc64b 100644 --- a/test/unittests/cloudsync_sa/ipc/cloud_sync_service_test.cpp +++ b/test/unittests/cloudsync_sa/ipc/cloud_sync_service_test.cpp @@ -1395,7 +1395,7 @@ HWTEST_F(CloudSyncServiceTest, StartFileCacheTest001, TestSize.Level1) EXPECT_CALL(*dfsuAccessToken_, GetUserId()).WillOnce(Return(0)); EXPECT_CALL(*dfsuAccessToken_, GetPid()).WillOnce(Return(101)); auto ret = servicePtr_->StartFileCache({uri}, downloadId, fieldkey, callback, timeout); - EXPECT_EQ(ret, E_SERVICE_INNER_ERROR); + EXPECT_EQ(ret, E_BROKEN_IPC); } catch (...) { EXPECT_FALSE(true); GTEST_LOG_(INFO) << "StartFileCacheTest001 failed"; -- Gitee