diff --git a/frameworks/native/backup_ext/src/ext_extension.cpp b/frameworks/native/backup_ext/src/ext_extension.cpp index b5fcb349fd98175e7e5876a412e0051920bc4d83..96a03fa78219756a55632e8134aff74bf25fb88e 100644 --- a/frameworks/native/backup_ext/src/ext_extension.cpp +++ b/frameworks/native/backup_ext/src/ext_extension.cpp @@ -1461,6 +1461,7 @@ void BackupExtExtension::AsyncTaskRestoreForUpgrade() HILOGE("On restore, start ext timer fail."); return; } + HILOGI("On restore, start ext timer end."); ptr->curScenario_ = BackupRestoreScenario::FULL_RESTORE; if ((ptr->StartOnProcessTaskThread(obj, BackupRestoreScenario::FULL_RESTORE)) != ERR_OK) { HILOGE("Call onProcess result is timeout"); @@ -1516,6 +1517,7 @@ void BackupExtExtension::AsyncTaskIncrementalRestoreForUpgrade() HILOGE("On incrementalRestore, start ext timer fail."); return; } + HILOGI("On incrementalRestore, start ext timer end."); ptr->curScenario_ = BackupRestoreScenario::INCREMENTAL_RESTORE; if ((ptr->StartOnProcessTaskThread(obj, BackupRestoreScenario::INCREMENTAL_RESTORE)) != ERR_OK) { HILOGE("Call onProcess result is timeout"); diff --git a/frameworks/native/backup_ext/src/sub_ext_extension.cpp b/frameworks/native/backup_ext/src/sub_ext_extension.cpp index 6038f48b416ca56b8c9cc7786dee2f9b2e60b951..73bc11fa0ddf9a0a7f5145b6e4070dce1c7e68cf 100644 --- a/frameworks/native/backup_ext/src/sub_ext_extension.cpp +++ b/frameworks/native/backup_ext/src/sub_ext_extension.cpp @@ -197,73 +197,6 @@ tuple> BackupExtExtension::CheckRestoreFileInfos() return { true, errFiles }; } -void BackupExtExtension::AppIncrementalDone(ErrCode errCode) -{ - HILOGI("Begin"); - auto proxy = ServiceProxy::GetInstance(); - if (proxy == nullptr) { - HILOGE("Failed to obtain the ServiceProxy handle"); - DoClear(); - return; - } - auto ret = proxy->AppIncrementalDone(errCode); - if (ret != ERR_OK) { - HILOGE("Failed to notify the app done. err = %{public}d", ret); - } -} - -ErrCode BackupExtExtension::GetBackupInfo(std::string &result) -{ - auto obj = wptr(this); - auto ptr = obj.promote(); - if (ptr == nullptr) { - HILOGE("Failed to get ext extension."); - return BError(BError::Codes::EXT_INVAL_ARG, "extension getBackupInfo exception").GetCode(); - } - if (ptr->extension_ == nullptr) { - HILOGE("Failed to get extension."); - return BError(BError::Codes::EXT_INVAL_ARG, "extension getBackupInfo exception").GetCode(); - } - auto callBackup = [ptr](ErrCode errCode, const std::string result) { - if (ptr == nullptr) { - HILOGE("Failed to get ext extension."); - return; - } - HILOGI("GetBackupInfo callBackup start. errCode = %{public}d, result = %{public}s", errCode, result.c_str()); - if (errCode == ERR_OK) { - ptr->backupInfo_ = result; - } - }; - auto ret = ptr->extension_->GetBackupInfo(callBackup); - if (ret != ERR_OK) { - HILOGE("Failed to get backupInfo. err = %{public}d", ret); - return BError(BError::Codes::EXT_INVAL_ARG, "extension getBackupInfo exception").GetCode(); - } - HILOGD("backupInfo = %s", backupInfo_.c_str()); - result = backupInfo_; - backupInfo_.clear(); - - return ERR_OK; -} - -ErrCode BackupExtExtension::UpdateFdSendRate(std::string &bundleName, int32_t sendRate) -{ - try { - std::lock_guard lock(updateSendRateLock_); - HILOGI("Update SendRate, bundleName:%{public}s, sendRate:%{public}d", bundleName.c_str(), sendRate); - VerifyCaller(); - bundleName_ = bundleName; - sendRate_ = sendRate; - if (sendRate > 0) { - startSendFdRateCon_.notify_one(); - } - return ERR_OK; - } catch (...) { - HILOGE("Failed to UpdateFdSendRate"); - return BError(BError::Codes::EXT_BROKEN_IPC).GetCode(); - } -} - std::function BackupExtExtension::OnRestoreCallback(wptr obj) { HILOGI("Begin get full restore onRestore callback"); @@ -755,7 +688,7 @@ void BackupExtExtension::StartOnProcessTimeOutTimer(wptr obj std::unique_lock lock(extPtr->onProcessLock_); extPtr->stopCallJsOnProcess_.store(true); extPtr->isFirstCallOnProcess_.store(false); - extPtr->isExecAppDone_.store(false); + extPtr->isExecAppDone_.store(true); extPtr->onProcessTimeoutCnt_ = 0; extPtr->execOnProcessCon_.notify_one(); lock.unlock(); @@ -772,7 +705,7 @@ void BackupExtExtension::StartOnProcessTimeOutTimer(wptr obj HILOGE("Extension onProcess timeout, Increase cnt:%{public}d", extPtr->onProcessTimeoutCnt_.load()); }; int timeout = isFirstCallOnProcess_.load() ? BConstants::FIRST_CALL_APP_ON_PROCESS_MAX_TIMEOUT : - BConstants::APP_ON_PROCESS_MAX_TIMEOUT; + BConstants::APP_ON_PROCESS_MAX_TIMEOUT; uint32_t timerId = onProcessTimeoutTimer_.Register(timeoutCallback, timeout, true); onProcessTimeoutTimerId_ = timerId; HILOGI("End"); @@ -785,6 +718,73 @@ void BackupExtExtension::CloseOnProcessTimeOutTimer() HILOGI("End"); } +void BackupExtExtension::AppIncrementalDone(ErrCode errCode) +{ + HILOGI("Begin"); + auto proxy = ServiceProxy::GetInstance(); + if (proxy == nullptr) { + HILOGE("Failed to obtain the ServiceProxy handle"); + DoClear(); + return; + } + auto ret = proxy->AppIncrementalDone(errCode); + if (ret != ERR_OK) { + HILOGE("Failed to notify the app done. err = %{public}d", ret); + } +} + +ErrCode BackupExtExtension::GetBackupInfo(std::string &result) +{ + auto obj = wptr(this); + auto ptr = obj.promote(); + if (ptr == nullptr) { + HILOGE("Failed to get ext extension."); + return BError(BError::Codes::EXT_INVAL_ARG, "extension getBackupInfo exception").GetCode(); + } + if (ptr->extension_ == nullptr) { + HILOGE("Failed to get extension."); + return BError(BError::Codes::EXT_INVAL_ARG, "extension getBackupInfo exception").GetCode(); + } + auto callBackup = [ptr](ErrCode errCode, const std::string result) { + if (ptr == nullptr) { + HILOGE("Failed to get ext extension."); + return; + } + HILOGI("GetBackupInfo callBackup start. errCode = %{public}d, result = %{public}s", errCode, result.c_str()); + if (errCode == ERR_OK) { + ptr->backupInfo_ = result; + } + }; + auto ret = ptr->extension_->GetBackupInfo(callBackup); + if (ret != ERR_OK) { + HILOGE("Failed to get backupInfo. err = %{public}d", ret); + return BError(BError::Codes::EXT_INVAL_ARG, "extension getBackupInfo exception").GetCode(); + } + HILOGD("backupInfo = %s", backupInfo_.c_str()); + result = backupInfo_; + backupInfo_.clear(); + + return ERR_OK; +} + +ErrCode BackupExtExtension::UpdateFdSendRate(std::string &bundleName, int32_t sendRate) +{ + try { + std::lock_guard lock(updateSendRateLock_); + HILOGI("Update SendRate, bundleName:%{public}s, sendRate:%{public}d", bundleName.c_str(), sendRate); + VerifyCaller(); + bundleName_ = bundleName; + sendRate_ = sendRate; + if (sendRate > 0) { + startSendFdRateCon_.notify_one(); + } + return ERR_OK; + } catch (...) { + HILOGE("Failed to UpdateFdSendRate"); + return BError(BError::Codes::EXT_BROKEN_IPC).GetCode(); + } +} + bool BackupExtExtension::SetStagingPathProperties() { struct stat curBundleStat {}; diff --git a/frameworks/native/backup_ext/src/untar_file.cpp b/frameworks/native/backup_ext/src/untar_file.cpp index aa87d0a210bbdd236aba6ff5a893712fc66b6e77..84dacb0e19461a5e030e9fff3b0fe806e0f88649 100644 --- a/frameworks/native/backup_ext/src/untar_file.cpp +++ b/frameworks/native/backup_ext/src/untar_file.cpp @@ -516,7 +516,7 @@ bool UntarFile::IsValidTarBlock(TarHeader &header) if (strncmp(header.magic, TMAGIC.c_str(), TMAGIC_LEN - 1) == 0 && VerifyChecksum(header)) { return true; } - HILOGW("Invalid tar block"); + HILOGE("Invalid tar block"); return false; } @@ -548,7 +548,7 @@ ErrFileInfo UntarFile::CreateDir(string &path, mode_t mode) path[len - 1] = '\0'; } if (access(path.c_str(), F_OK) != 0) { - HILOGW("directory does not exist, path:%{public}s, err = %{public}d", path.c_str(), errno); + HILOGE("directory does not exist, path:%{public}s, err = %{public}d", path.c_str(), errno); if (!ForceCreateDirectoryWithMode(path, mode)) { HILOGE("Failed to force create directory %{public}s, err = %{public}d", path.c_str(), errno); errFileInfo[path].push_back(errno); @@ -565,7 +565,7 @@ FILE *UntarFile::CreateFile(string &filePath) } uint32_t len = filePath.length(); - HILOGW("Failed to open file %{public}d, %{public}s, err = %{public}d", len, + HILOGE("Failed to open file %{public}d, %{public}s, err = %{public}d", len, GetAnonyPath(filePath).c_str(), errno); size_t pos = filePath.rfind('/'); if (pos == string::npos) { @@ -576,7 +576,7 @@ FILE *UntarFile::CreateFile(string &filePath) if (ForceCreateDirectory(path)) { f = fopen(filePath.c_str(), "wb+"); if (f == nullptr) { - HILOGE("Failed to create file %{public}s, err = %{public}d", GetAnonyPath(filePath).c_str(), errno); + HILOGE("Failed to open file %{public}s, err = %{public}d", GetAnonyPath(filePath).c_str(), errno); } } diff --git a/interfaces/common/src/common_func.cpp b/interfaces/common/src/common_func.cpp index 8cc7572b09084ea78df95321207b8a3a1eb9f26d..0c0eec4fac8dfa43a56ce9283ec8c0bdc7a0fbb4 100644 --- a/interfaces/common/src/common_func.cpp +++ b/interfaces/common/src/common_func.cpp @@ -32,12 +32,12 @@ namespace OHOS { namespace AppFileService { using namespace OHOS::AppExecFwk; namespace { - const std::string FILE_SCHEME_PREFIX = "file://"; - const char BACKFLASH = '/'; - const std::string FILE_MANAGER_URI_HEAD = "/storage/"; - const std::string FILE_MANAGER_AUTHORITY = "docs"; - std::string g_bundleName = ""; - std::mutex g_globalMutex; +const std::string FILE_SCHEME_PREFIX = "file://"; +const char BACKFLASH = '/'; +const std::string FILE_MANAGER_URI_HEAD = "/storage/"; +const std::string FILE_MANAGER_AUTHORITY = "docs"; +std::string g_bundleName = ""; +std::mutex g_globalMutex; } static sptr GetBundleMgrProxy() { @@ -103,4 +103,3 @@ string CommonFunc::GetUriFromPath(const string &path) } } // namespace AppFileService } // namespace OHOS - diff --git a/interfaces/common/src/sandbox_helper.cpp b/interfaces/common/src/sandbox_helper.cpp index 074c77016b1a3a10782c65d3f1a607ecf0564598..312283159c0938a4051771eab474f53cf7ced6e9 100644 --- a/interfaces/common/src/sandbox_helper.cpp +++ b/interfaces/common/src/sandbox_helper.cpp @@ -313,6 +313,7 @@ static void GetNetworkIdFromUri(const std::string &fileUri, string &networkId) if (networkIdInfo.empty()) { return; } + size_t posIndex = networkIdInfo.find('='); if (posIndex == string::npos || posIndex == (networkIdInfo.size() - 1)) { return; diff --git a/interfaces/innerkits/native/file_share/src/file_permission.cpp b/interfaces/innerkits/native/file_share/src/file_permission.cpp index d82281d4f8dc22ca2ffe1773e16ccdeb1bee0327..f266d9c964831bf6940c9a19d9f8736d3adba705 100644 --- a/interfaces/innerkits/native/file_share/src/file_permission.cpp +++ b/interfaces/innerkits/native/file_share/src/file_permission.cpp @@ -14,7 +14,6 @@ */ #include "file_permission.h" #include "accesstoken_kit.h" -#include "file_uri.h" #include "log.h" #include "parameter.h" #include "uri.h" @@ -25,6 +24,7 @@ #include "sandbox_manager_err_code.h" #endif #include "bundle_constants.h" +#include "file_uri.h" #include "hap_token_info.h" #include "ipc_skeleton.h" #include "n_error.h" @@ -211,7 +211,7 @@ vector FilePermission::GetPathPolicyInfoFromUriPolicyInfo(const vect return pathPolicies; } -static bool CheckPermission(uint64_t tokenCaller, const string &permission) +static bool CheckPermission(uint32_t tokenCaller, const string &permission) { return Security::AccessToken::AccessTokenKit::VerifyAccessToken(tokenCaller, permission) == Security::AccessToken::PermissionState::PERMISSION_GRANTED; diff --git a/interfaces/innerkits/native/remote_file_share/src/remote_file_share.cpp b/interfaces/innerkits/native/remote_file_share/src/remote_file_share.cpp index 5961fe8c7d0e4931f784b94af8b05f5c308fe9bd..c4ffc9583bec766322d4978672760c984b5ca886 100644 --- a/interfaces/innerkits/native/remote_file_share/src/remote_file_share.cpp +++ b/interfaces/innerkits/native/remote_file_share/src/remote_file_share.cpp @@ -15,13 +15,13 @@ #include "remote_file_share.h" +#include #include +#include #include #include #include #include -#include -#include #include "log.h" #ifdef ENABLE_DEVICE_MANAGER @@ -30,8 +30,8 @@ #endif #include "sandbox_helper.h" #include "securec.h" -#include "uri.h" #include "unique_fd.h" +#include "uri.h" namespace OHOS { namespace AppFileService { @@ -40,29 +40,29 @@ namespace ModuleRemoteFileShare { using namespace OHOS::DistributedHardware; #endif namespace { - const int HMDFS_CID_SIZE = 64; - const int USER_ID_INIT = 100; - const unsigned HMDFS_IOC = 0xf2; - const std::string FILE_SCHEME = "file"; - const std::string DISTRIBUTED_DIR_PATH = "/data/storage/el2/distributedfiles"; - const std::string DST_PATH_HEAD = "/data/service/el2/"; - const std::string DST_PATH_MID = "/hmdfs/account/data/"; - const std::string SHAER_PATH_HEAD = "/mnt/hmdfs/"; - const std::string SHAER_PATH_MID = "/account/merge_view/services/"; - const std::string LOWER_SHARE_PATH_HEAD = "/mnt/hmdfs/"; - const std::string LOWER_SHARE_PATH_MID = "/account/device_view/local/services/"; - const std::string SHARE_PATH_DIR = "/.share"; - const std::string REMOTE_SHARE_PATH_DIR = "/.remote_share"; - const std::string MEDIA_AUTHORITY = "media"; - const std::string FILE_MANAGER_AUTHORITY = "docs"; - const std::string PACKAGE_NAME = "get_dfs_uri_from_local"; - const std::string NETWORK_PARA = "?networkid="; - const std::string MEDIA_BUNDLE_NAME = "com.ohos.medialibrary.medialibrarydata"; - const std::string FILE_MANAGER_URI_HEAD = "/storage/"; - const std::string REMOTE_SHARE_PATH_MID = "hmdfs/"; -} - -#define HMDFS_IOC_SET_SHARE_PATH _IOW(HMDFS_IOC, 1, struct HmdfsShareControl) +const int HMDFS_CID_SIZE = 64; +const int USER_ID_INIT = 100; +const unsigned HMDFS_IOC = 0xf2; +const std::string FILE_SCHEME = "file"; +const std::string DISTRIBUTED_DIR_PATH = "/data/storage/el2/distributedfiles"; +const std::string DST_PATH_HEAD = "/data/service/el2/"; +const std::string DST_PATH_MID = "/hmdfs/account/data/"; +const std::string SHAER_PATH_HEAD = "/mnt/hmdfs/"; +const std::string SHAER_PATH_MID = "/account/merge_view/services/"; +const std::string LOWER_SHARE_PATH_HEAD = "/mnt/hmdfs/"; +const std::string LOWER_SHARE_PATH_MID = "/account/device_view/local/services/"; +const std::string SHARE_PATH_DIR = "/.share"; +const std::string REMOTE_SHARE_PATH_DIR = "/.remote_share"; +const std::string MEDIA_AUTHORITY = "media"; +const std::string FILE_MANAGER_AUTHORITY = "docs"; +const std::string PACKAGE_NAME = "get_dfs_uri_from_local"; +const std::string NETWORK_PARA = "?networkid="; +const std::string MEDIA_BUNDLE_NAME = "com.ohos.medialibrary.medialibrarydata"; +const std::string FILE_MANAGER_URI_HEAD = "/storage/"; +const std::string REMOTE_SHARE_PATH_MID = "hmdfs/"; +} //namespace + +#define HMDFS_IOC_SET_SHARE_PATH _IOW(HMDFS_IOC, 1, struct HmdfsShareControl) #define HMDFS_IOC_GET_DST_PATH _IOR(HMDFS_IOC, 3, unsigned int) struct HmdfsShareControl { @@ -175,8 +175,7 @@ static bool DeleteShareDir(const std::string &PACKAGE_PATH, const std::string &S return result; } -static int CreateShareFile(struct HmdfsShareControl &shareControl, const char* file, - const std::string &deviceId) +static int CreateShareFile(struct HmdfsShareControl &shareControl, const char *file, const std::string &deviceId) { int32_t dirFd = open(file, O_RDONLY); if (dirFd < 0) { @@ -200,12 +199,13 @@ static int CreateShareFile(struct HmdfsShareControl &shareControl, const char* f static int CheckInputValidity(const int &fd, const int &userId, const std::string &deviceId) { - return (fd < 0) || (userId < USER_ID_INIT) || (deviceId != SHARE_ALL_DEVICE && - deviceId.size() != HMDFS_CID_SIZE); + return (fd < 0) || (userId < USER_ID_INIT) || (deviceId != SHARE_ALL_DEVICE && deviceId.size() != HMDFS_CID_SIZE); } -int RemoteFileShare::CreateSharePath(const int &fd, std::string &sharePath, - const int &userId, const std::string &deviceId) +int RemoteFileShare::CreateSharePath(const int &fd, + std::string &sharePath, + const int &userId, + const std::string &deviceId) { struct HmdfsShareControl shareControl; shareControl.fd = fd; @@ -265,7 +265,10 @@ int RemoteFileShare::CreateSharePath(const int &fd, std::string &sharePath, return 0; } -static int GetDistributedPath(Uri &uri, const int &userId, std::string &distributedPath, const std::string &bundleName) +static int GetDistributedPath(Uri &uri, + const int &userId, + std::string &distributedPath, + const std::string &bundleName) { distributedPath = DST_PATH_HEAD + std::to_string(userId) + DST_PATH_MID + bundleName + REMOTE_SHARE_PATH_DIR + SandboxHelper::Decode(uri.GetPath()); @@ -293,8 +296,10 @@ static std::string GetPhysicalPath(Uri &uri, const std::string &userId) return physicalPath; } -static void InitHmdfsInfo(struct HmdfsDstInfo &hdi, const std::string &physicalPath, - const std::string &distributedPath, const std::string &bundleName) +static void InitHmdfsInfo(struct HmdfsDstInfo &hdi, + const std::string &physicalPath, + const std::string &distributedPath, + const std::string &bundleName) { hdi.localLen = physicalPath.size() + 1; hdi.localPathIndex = reinterpret_cast(physicalPath.c_str()); @@ -312,7 +317,7 @@ static std::string GetLocalNetworkId() { const std::string LOCAL = "local"; std::string networkId = LOCAL; - #ifdef ENABLE_DEVICE_MANAGER +#ifdef ENABLE_DEVICE_MANAGER auto callback = std::make_shared(); int32_t ret = DeviceManager::GetInstance().InitDeviceManager(PACKAGE_NAME, callback); if (ret != 0) { @@ -326,7 +331,7 @@ static std::string GetLocalNetworkId() if (ret != 0 || networkId.empty()) { return ""; } - #endif +#endif return networkId; } @@ -446,7 +451,6 @@ int32_t RemoteFileShare::GetDfsUrisFromLocal(const std::vector &uri if (bundleName == MEDIA_AUTHORITY) { bundleName = MEDIA_BUNDLE_NAME; } - if (bundleName == FILE_MANAGER_AUTHORITY) { HmdfsUriInfo dfsUriInfo; (void)SetPublicDirHmdfsInfo(physicalPath, uriStr, dfsUriInfo, networkId); diff --git a/interfaces/kits/js/file_share/grant_permissions.cpp b/interfaces/kits/js/file_share/grant_permissions.cpp index f3dc51c2900b4d94228c301104a1a6996c56992d..f8c3448c5bc5c378aaaa199036fb779e02e70bf4 100644 --- a/interfaces/kits/js/file_share/grant_permissions.cpp +++ b/interfaces/kits/js/file_share/grant_permissions.cpp @@ -23,7 +23,6 @@ #include "js_native_api.h" #include "log.h" #include "n_napi.h" -#include "parameter.h" #include "tokenid_kit.h" namespace OHOS { diff --git a/services/backup_sa/src/module_external/bms_adapter.cpp b/services/backup_sa/src/module_external/bms_adapter.cpp index e1f415e89dfa100823f36734360d015f3d1f25f8..f01d20757a3dc21540fb9fd7bdaa7d7ff9c2492c 100644 --- a/services/backup_sa/src/module_external/bms_adapter.cpp +++ b/services/backup_sa/src/module_external/bms_adapter.cpp @@ -353,8 +353,8 @@ vector BundleMgrAdapter::GetBundleInfosForIncrement GetAllowAndExtName(installedBundle.extensionInfos); if (!allToBackup) { bundleInfos.emplace_back(BJsonEntityCaps::BundleInfo {installedBundle.name, installedBundle.appIndex, - installedBundle.versionCode, installedBundle.versionName, 0, 0, allToBackup, fullBackupOnly, extName, - restoreDeps, supportScene, extraInfo}); + installedBundle.versionCode, installedBundle.versionName, 0, 0, allToBackup, fullBackupOnly, + extName, restoreDeps, supportScene, extraInfo}); continue; } auto it = std::find_if(extraIncreData.begin(), extraIncreData.end(), diff --git a/test/unittest/file_share_native/file_share_test.cpp b/test/unittest/file_share_native/file_share_test.cpp index 9542521aabd5bffc846d1af361f83be045cc3093..2a0b3c27918ccad7fc66c328583813f89e89f1ea 100644 --- a/test/unittest/file_share_native/file_share_test.cpp +++ b/test/unittest/file_share_native/file_share_test.cpp @@ -25,7 +25,6 @@ #include "access_token_error.h" #include "accesstoken_kit.h" -#include "file_permission.h" #include "file_share.h" #include "ipc_skeleton.h" #include "log.h" diff --git a/test/unittest/js_file_uri_test/FileUri.test.js b/test/unittest/js_file_uri_test/FileUri.test.js index b275622d3856ba7f1f25ec36e997be02473e94e4..d8129632ffd5a4ac7411469f6d5094fa1861fb99 100644 --- a/test/unittest/js_file_uri_test/FileUri.test.js +++ b/test/unittest/js_file_uri_test/FileUri.test.js @@ -82,7 +82,7 @@ describe('FileShareJSTest', function () { let fileUriObject = new fileuri.FileUri(uri); let realPath = fileUriObject.path; console.info(`getPathFromUri success: ${JSON.stringify(realPath)}`); - expect(resultPath == realPath).assertTrue(); + expect(resultPath === realPath).assertTrue(); } catch (error) { console.error(`getPathFromUri failed:${JSON.stringify(error)}`); expect(false).assertTrue(); @@ -105,7 +105,7 @@ describe('FileShareJSTest', function () { let fileUriObject = new fileuri.FileUri(uri); let realPath = fileUriObject.path; console.info(`getPathFromUri success: ${JSON.stringify(realPath)}`); - expect(resultSharePath == realPath || realPath == resultPath).assertTrue(); + expect(resultSharePath === realPath || realPath === resultPath).assertTrue(); } catch (error) { console.error(`getPathFromUri failed:${JSON.stringify(error)}`); expect(false).assertTrue(); @@ -128,7 +128,7 @@ describe('FileShareJSTest', function () { let fileUriObject = new fileuri.FileUri(uri); let realPath = fileUriObject.path; console.info(`getPathFromUri success: ${JSON.stringify(realPath)}`); - expect(resultSharePath == realPath || realPath == resultPath).assertTrue(); + expect(resultSharePath === realPath || realPath === resultPath).assertTrue(); } catch (error) { console.error(`getPathFromUri failed:${JSON.stringify(error)}`); expect(false).assertTrue();