Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Tests/LootLockerTests/PlayMode/PlayerFilesTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,10 @@ public IEnumerator PlayerFiles_UpdateFile_CreatesNewRevision()
yield return new WaitUntil(() => uploadDone);
Assert.IsTrue(uploadedFile.success, "Initial upload failed");

// Revision timestamps have second granularity, so revisions created within the same
// second are indistinguishable and their relative order is undefined.
yield return new WaitForSeconds(1f);

// When — update the file
LootLockerPlayerFile updatedFile = new LootLockerPlayerFile();
bool updateDone = false;
Expand Down Expand Up @@ -425,6 +429,10 @@ public IEnumerator PlayerFiles_GetFileRevision_ReturnsSpecificRevision()
yield return new WaitUntil(() => uploadDone);
Assert.IsTrue(uploadedFile.success, "Initial upload failed");

// Revision timestamps have second granularity, so revisions created within the same
// second are indistinguishable and their relative order is undefined.
yield return new WaitForSeconds(1f);

// Update to create a second revision
LootLockerPlayerFile updateResponse = new LootLockerPlayerFile();
bool updateDone = false;
Expand Down Expand Up @@ -485,6 +493,10 @@ public IEnumerator PlayerFiles_PromoteFileRevision_RestoresOldRevision()
yield return new WaitUntil(() => uploadDone);
Assert.IsTrue(uploadedFile.success, "Initial upload failed");

// Revision timestamps have second granularity, so revisions created within the same
// second are indistinguishable and their relative order is undefined.
yield return new WaitForSeconds(1f);

// Update to create revision 2
LootLockerPlayerFile updateResponse = new LootLockerPlayerFile();
bool updateDone = false;
Expand Down Expand Up @@ -607,6 +619,10 @@ public IEnumerator PlayerFiles_GetFileRevisionByKey_ReturnsSpecificRevision()
yield return new WaitUntil(() => firstDone);
Assert.IsTrue(firstUpload.success, "First upload for get revision by key test failed");

// Revision timestamps have second granularity, so revisions created within the same
// second are indistinguishable and their relative order is undefined.
yield return new WaitForSeconds(1f);

LootLockerPlayerFile secondUpload = new LootLockerPlayerFile();
bool secondDone = false;
LootLockerSDKManager.UploadPlayerFileByKey(pathB, "test", true, fileKey, response =>
Expand Down Expand Up @@ -664,6 +680,10 @@ public IEnumerator PlayerFiles_PromoteFileRevisionByKey_PromotesRevision()
yield return new WaitUntil(() => firstDone);
Assert.IsTrue(firstUpload.success, "First upload for promote by key test failed");

// Revision timestamps have second granularity, so revisions created within the same
// second are indistinguishable and their relative order is undefined.
yield return new WaitForSeconds(1f);

LootLockerPlayerFile secondUpload = new LootLockerPlayerFile();
bool secondDone = false;
LootLockerSDKManager.UploadPlayerFileByKey(pathB, "test", true, fileKey, response =>
Expand Down
Loading