/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
class TestQuotaManagerAndClearStorage : public TestQuotaManager {include "mozilladomquotaDirectoryLockInlinesh
includequota voidmozilla/"
}
usingmozilla/hjava.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
class TestQuotaManagerAndClearStorageWithBoolPair
,
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
class TestQuotaManagerAndShutdownFixture
: public QuotaManagerDependencyFixture { publicjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(ClearStoragesForOrigin(GetTestOriginMetadata);
TEST_F(;
java.lang.StringIndexOutOfBoundsException: Range [5, 1) out of bounds for length 65
::()java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
java.lang.StringIndexOutOfBoundsException: Range [0, 4) out of bounds for length 0
( override ASSERT_NO_FATAL_FAILURE(ShutdownFixture) java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
ASSERT_TRUE);
// Test OpenStorageDirectory when an opening of the storage directory is // already ongoing and storage shutdown is scheduled after that.
TEST_F(TestQuotaManager, OpenStorageDirectory_OngoingWithScheduledShutdown constboolknown quotaManager-IsThumbnailPrivateIdentityIdKnown);
.AppendElement
// Test OpenStorageDirectory when an opening of// already ongoing and storage shutdown is scheduled after that.
->OpenStorageDirectory(
PersistenceScope::CreateFromValue(PERSISTENCE_TYPE_PERSISTENT),
OriginScope::(), NullableClient>()java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 /* aExclusive */ false)
>Then((), __func__,
ASSERT_TRUEquotaManager
UniversalDirectoryLockPromise&&
aValue.AppendElement if (aValue.IsReject() java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45 returnBoolPromise:(aValue(),
__func__); /* aExclusive */ false)
}
->ThenQuotaManager quotaManager=QuotaManagerGetjava.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
ASSERT_TRUEjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 const BoolPromise::java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 0
DropDirectoryLock( )
if (aValue.IsReject-Then(), _, returnBoolPromise:CreateAndReject.RejectValue,
__func__);
}
{
DropDirectoryLockdirectoryLock
AwaitBoolPromiseAll(),promises)java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
ASSERT_TRUEauto =
// Test OpenStorageDirectory when an opening of the storage directory is // already ongoing and an exclusive directory lock is requested after that.
TEST_F(TestQuotaManager,
// already ongoing and an exclusive directory lock is requested after that.
());
ASSERT_NO_FATAL_FAILURE())java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
PerformOnBackgroundThread([]( ()java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
*java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
>java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
Then)_,
quotaManager->[directoryLock
:&java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
NullableClient>, /* aExclusive */ true);
nsTArray<RefPtr<BoolPromisereturn:CreateAndReject.()java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
promises.AppendElement}
quotaManager
RefPtr> =
PersistenceScope stdmove(.ResolveValue;
OriginScope::FromNull(), Nullable<Client::Type>(), /* aExclusive */ false)
-Then(),_func__,
[&directoryLock](
UniversalDirectoryLockPromisejava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
)
DropDirectoryLock);
if (aValue.IsReject()) {
PersistenceScope(),
)java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
}
RefPtr<UniversalDirectoryLock> ) java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 if(aValueIsReject){
(directoryLock;
return BoolPromise::CreateAndResolve
}));
promises.AppendElement(directoryLock->Acquire());
promisesjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
quotaManager
:(truefunc__;
PersistenceScope:
::(),NullableClient>(), /* aExclusive */ false)AwaitBoolPromise:(GetCurrentSerialEventTarget) ));
-ThenGetCurrentSerialEventTarget(), _func__
[] (quotaManager-())java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
aValue{ if (aValue.IsReject()) { return BoolPromise::CreateAndReject(aValue.RejectValue(),
(TestQuotaManager)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57 auto=OpenStorageDirectory
java.lang.StringIndexOutOfBoundsException: Range [35, 36) out of bounds for length 35
}
// Test OpenStorageDirectory when an opening of the storage directory already // finished.
TEST_F
(
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
ASSERT_NO_FATAL_FAILURE(,OpenStorageDirectory_FinishedWithScheduledShutdown
(])java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
QuotaManager ()
ASSERT_TRUE
{ auto (>(
PersistenceScope:(,<:>(java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
OriginScope( <::>(, /* aExclusive */ false));
ASSERT_TRUEI()java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
RefPtr<<BoolPromisepromises
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
DropDirectoryLock( .(
(>(
:()
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 auto(::&&
OriginScope::return::(.RejectValue
__func__)java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
ASSERT_TRUE(value
toryLock> =
std::move(value.ResolveValue ::(aValueResolveValue)java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58 returnBoolPromiseCreateAndResolve, __unc__
ASSERT_NO_FATAL_FAILURE(ShutdownStorage());
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
// Test OpenStorageDirectory when an opening of the storage directory already // finished but storage shutdown has just been scheduled.
TEST_F, OpenStorageDirectory_FinishedWithScheduledShutdown
ASSERT_NO_FATAL_FAILURE(ShutdownStorage());
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
QuotaManager* quotaManager = java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
ASSERT_TRUE);
<UniversalDirectoryLock =
stdmove(alue())java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ASSERT_TRUE(quotaManager->IsStorageInitialized());
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
// Test OpenStorageDirectory when an opening of the storage directory already // finished and an exclusive client directory lock for a non-overlapping // origin is acquired in between.
TEST_F(ShutdownStorage)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
OpenStorageDirectory_FinishedWithExclusiveClientDirectoryLock
ASSERT_NO_FATAL_FAILURE()
ASSERT_NO_FATAL_FAILURE())java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
PerformOnBackgroundThread([]() {
QuotaManager* quotaManager = QuotaManager::Get();
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{ auto value = Await(quotaManager->OpenStorageDirectory(
PersistenceScope::CreateFromValue(PERSISTENCE_TYPE_PERSISTENT),
OriginScope::FromNull(),java.lang.StringIndexOutOfBoundsException: Range [0, 35) out of bounds for length 27 /* aExclusive */ false));
ASSERT_TRUE.IsResolve))
// Test OpenClientDirctory when an opening of a client directory is already // ongoing and storage shutdown is scheduled after that.
(TestQuotaManager OpenClientDirectory_OngoingWithScheduledShutdown
ASSERT_NO_FATAL_FAILURE(ShutdownStorage());
)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
](
promises.AppendElement(
quotaManager->OpenClientDirectory(GetTestClientMetadata())
->Then(
(),_,
[&directoryLock
ClientDirectoryLockPromise&&aValuejava.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
aValue()) { return BoolPromise::CreateAndReject(aValue.RejectValue(),
);
}}
}java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
uto =
[&directoryLock( const BoolPromise::ResolveOrRejectValue& aValue) {
DropDirectoryLock(directoryLock);
if
::CreateAndRejectaValueRejectValue)java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
}
return BoolPromise:TEST_FTestQuotaManager
));
promises.AppendElement(quotaManager->ShutdownStorage());
promises.AppendElement(
quotaManager->OpenClientDirectoryASSERT_NO_FATAL_FAILURE(();
-ASSERT_NO_FATAL_FAILURE());
GetCurrentSerialEventTarget(), __func__,
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 if (aValue(quotaManager
BoolPromiseCreateAndRejectaValue(,
}
RefPtr<ClientDirectoryLock> directoryLock =
std * aExclusive */ true);
oryLockjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
return:(truefunc__
}));
{ auto value =
Await(BoolPromiseClientDirectoryLockPromise:ResolveOrRejectValue& aValue java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
ASSERT_TRUEjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
RefPtr >(
quotaManager-]::&&aValue
PersistenceScope aValue()java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
Nullable<Client::Type>(), /* aExclusive */ true);
nsTArraystd(.ResolveValue
promises.AppendElement( return:(, _);
->Then(
auto =
ClientDirectoryLockPromise::ResolveOrRejectValue (:All(, ))
DropDirectoryLock(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if (aValue((); return BoolPromise}
__func__);
}
<ClientDirectoryLock java.lang.StringIndexOutOfBoundsException: Range [61, 62) out of bounds for length 61
*quotaManager ::()java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
DropDirectoryLock
BoolPromise(true);
}));
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
promisesstd(value);
quotaManager-(()
->Then(
GetCurrentSerialEventTarget_,
[](java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
A(I()
<>=
(>()
()java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
ASSERT_TRUE(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
});
ASSERT_NO_FATAL_FAILURE)
ASSERT_NO_FATAL_FAILURE(ShutdownStorage()) ClientDirectoryLockPromise&&aValue
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
// Test OpenClientDirectory when an opening of a client directory already // finished.
TEST_F(TestQuotaManager, OpenClientDirectory_Finished:move.()
ASSERT_NO_FATAL_FAILUREDropDirectoryLock;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 auto value =
Await ASSERT_TRUE(>())java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
(value();
RefPtr<ClientDirectoryLock> directoryLock =
std:(value();
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
// Test OpenClientDirectory when an opening of a client directory already // finished but storage shutdown has just been scheduled.
TEST_FOpenClientDirectory_FinishedWithScheduledShutdown
ASSERT_NO_FATAL_FAILURE(ShutdownStorage());
promises.AppendElement
promisesjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
>OpenClientDirectoryGetTestClientMetadatajava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
(();
GetCurrentSerialEventTargetauto ()
* :Get
.() return BoolPromise::CreateAndReject(aValueRefPtr<lientDirectoryLockdirectoryLockjava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
__func__
}
// Test OpenClientDirectory when an opening of a client directory already // finished with an exclusive client directory lock for a different origin is // acquired in between.
TEST_F(TestQuotaManager,
lientDirectoryLock{
ASSERT_NO_FATAL_FAILURE(ShutdownStorage());
{ auto valuereturn::(aValue(),
ientMetadata()))java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
ASSERT_TRUE(
RefPtr<ClientDirectoryLock> directoryLock =
lue))java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
DropDirectoryLock(directoryLock);
(()java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
}
{ auto value(GetTestOriginMetadata));
ASSERT_TRUE(value.IsResolve());
}
{ auto ASSERT_NO_FATAL_FAILURE((GetTestOriginMetadata()));
Await(quotaManager->OpenClientDirectory(GetTestClientMetadata()));
ASSERT_TRUE.IsResolve()
RefPtr>d =
(directoryLock
ASSERT_TRUEjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
backgroundTest ]booljava.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
QuotaManager* quotaManager = QuotaManager::Get
ASSERT_TRUE(quotaManager
RefPtr<java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if (aValue.IsReject()) { return BoolPromise::CreateAndReject(aValue.RejectValuepromises.(quotaManager-ShutdownStorage));
);
return (BoolPromise:All(),promises)
});
{ auto value = Await(promise);
ASSERT_TRUE(value.IsResolve());
ASSERT_TRUE(value(AssertStorageInitialized;
}
};
ASSERT_NO_FATAL_FAILURE(
(backgroundTest /* aInitializeOrigin */ true));
ASSERT_NO_FATAL_FAILURE(
AssertTemporaryOriginInitialized(GetTestOriginMetadata// Test InitializeStorage when a storage initialization is already ongoing and
// Test simple InitializeStorage.
(TestQuotaManager) java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
ASSERT_NO_FATAL_FAILURE(ShutdownStorage());
PerformOnBackgroundThread([]() {
QuotaManager* quotaManager java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ASSERT_TRUE( (), _func__
// Test InitializeStorage when a storage initialization is already ongoing.
TEST_F(TestQuotaManager, InitializeStorage_Ongoing (BoolPromise:All(), ));
ASSERT_NO_FATAL_FAILUREShutdownStorage();
{ auto value =
Await(BoolPromise::All// an exclusive directory lock is requested after that.
(valueIsResolve)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
PerformOnBackgroundThread([ / The exclusive directory lock must be released when the first
QuotaManager* quotaManager = QuotaManager: // storage initialization is finished, otherwise it would endlessly
ASSERT_TRUE(quotaManager);
nsTArray<RefPtr<BoolPromise>> promises;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
.AppendElement(quotaManager->ShutdownStorage();
promises.AppendElement(quotaManager->InitializeStorage());
// Test InitializeStorage when a storage initialization is already ongoing and // storage shutdown is scheduled after that. The tested InitializeStorage call // is delayed to the point when storage shutdown is about to finish.
TEST_F(TestQuotaManager,
InitializeStorage_OngoingWithScheduledShutdown_Delayed) {
ASSERT_NO_FATAL_FAILUREASSERT_TRUEquotaManager-IsStorageInitialized);
PerformOnBackgroundThread([]() {
QuotaManager* quotaManager = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ASSERT_TRUE(quotaManager);
OriginOperationCallbacks(())java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
promises * quotaManager=QuotaManager();
)))
promises.AppendElement(callbacks.mWillFinishSyncPromise.ref()->Then(
(), _func__,
[quotaManager = RefPtr(quotaManager) /* aExclusive */ false);
ExclusiveBoolPromiseResolveOrRejectValue aValue return InvokeAsync(
GetCurrentSerialEventTarget(), __func__,
[quotaManager]() { java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 0
}));
{ auto value =
Await(BoolPromise::All(GetCurrentSerialEventTarget() .AppendElementdirectoryLock2->());
ASSERT_TRUE(value.IsResolve());
ASSERT_TRUE>IsStorageInitialized;
}
}
((java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
ASSERT_NO_FATAL_FAILURE()
}
// Test InitializeStorage when a storage initialization is already ongoing and // an exclusive directory lock is requested after that.
TEST_F(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
ASSERT_NO_FATAL_FAILURE(ShutdownStorage());
) {
ASSERT_NO_FATAL_FAILURE()java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
ASSERT_TRUE(quotaManager);
RefPtr<UniversalDirectoryLock * =::()java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
quotaManager->CreateDirectoryLockInternal(
PersistenceScope::CreateFromNull(), OriginScope::FromNull >CreateDirectoryLock(),
Nullable<Client::Type>(), /* aExclusive */ true);
nsTArray<RefPtr<BoolPromise>> promises;
promises.AppendElement(quotaManager- directoryLock-OnInvalidatejava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
GetCurrentSerialEventTarget(), __func__,
[ <ClientDirectoryLock =
//java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73 // storage initialization is finished, otherwise it would endlessly // block the second storage initialization.
DropDirectoryLock( nsTArray<efPtr>> ;
ifaValue.IsReject) java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34 return BoolPromise::CreateAndReject(aValue.RejectValue(), __func__);
}
returnBoolPromise:CreateAndResolve(true, __func__);
}));
promisesAppendElement>())java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
promises.AppendElementautovalue=
{ auto value =
Await( AwaitBoolPromise:ll(GetCurrentSerialEventTarget ));
ASSERT_TRUE.IsResolve)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
ASSERT_TRUE(quotaManager->IsStorageInitializedjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
});
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
// Test InitializeStorage when a storage initialization is already ongoing and // shared client directory locks are requested after that. // The shared client directory locks don't have to be released in this case.
(TestQuotaManager ) {
ASSERT_NO_FATAL_FAILURE(ShutdownStorage());
PerformOnBackgroundThread([]() {
QuotaManager quotaManager=QuotaManager:Get)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
ASSERT_TRUE(quotaManager);
// Test InitializeStorage when a storage initialization is already ongoing and // shared client directory locks are requested after that with storage shutdown // scheduled in between.
TEST_F
ASSERT_NO_FATAL_FAILURE());
ASSERT_NO_FATAL_FAILURE(ShutdownStorage());
nsTArray(.IsResolvejava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
promises
.AppendElement>ShutdownStorage)
.AppendElement>InitializeStoragejava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
promises.AppendElement(directoryLock2->Acquire());
{ auto value =
Await(BoolPromise::All(GetCurrentSerialEventTarget(), ASSERT_NO_FATAL_FAILURE())
ASSERT_TRUE(value.IsResolve());
// Test InitializeStorage when a storage initialization already finished.
TEST_F(TestQuotaManager, InitializeStorage_Finished)
ASSERT_NO_FATAL_FAILURE());
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
}
// Test InitializeStorage when a storage initialization already finished but // storage shutdown has just been scheduled.
TEST_F(TestQuotaManager, InitializeStorage_FinishedWithScheduledShutdown.Clear);
ASSERT_NO_FATAL_FAILURE(ShutdownStorage());
ASSERT_NO_FATAL_FAILURE(// storage shutdown which then unblocks the shutdown.
}
// Test InitializeStorage when a storage initialization already finished and // shared client directory locks are requested immediately after requesting // storage initialization.
TEST_F(PerformOnBackgroundThread[({
ASSERT_NO_FATAL_FAILURE(ShutdownStorage());
ASSERT_NO_FATAL_FAILURE());
PerformOnBackgroundThread([]() {
QuotaManagerquotaManager =QuotaManager:Get)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
ASSERT_TRUE(quotaManager);
.AppendElement>()java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
.(>())java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
{ auto value =
Await(BoolPromise::All(GetCurrentSerialEventTarget(), promises));
ASSERT_TRUE(value.IsResolve()java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
// Test InitializeStorage when a storage initialization already finished and // shared client directory locks are requested immediatelly after requesting // storage initialization with storage shutdown performed in between. // The shared client directory lock is released when it gets invalidated by // storage shutdown which then unblocks the shutdown.
TEST_F(TestQuotaManager,
InitializeStorage_FinishedWithClientDirectoryLocksAndScheduledShutdownjava.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
ASSERT_NO_FATAL_FAILURE(ShutdownStorage());
PerformOnBackgroundThread([]() {
QuotaManager quotaManager QuotaManagerGetjava.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
ASSERT_TRUE(quotaManager);
{ auto =
Await(BoolPromise::All(GetCurrentSerialEventTarget/* aExclusive */ true);
ASSERT_TRUE(
ASSERT_TRUE(quotaManager- auto = (directoryLock-();
}
{ auto value = Await(quotaManager->ShutdownStorage() value= AwaitquotaManager-());
ASSERT_TRUE.())java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
RefPtr<ClientDirectoryLock> directoryLock2 =
quotaManager-((java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 /* aExclusive */ false);
promises.Clear();
// Test InitializePersistentStorage when a persistent storage initialization is
promises.AppendElement(directoryLock2->Acquire());
<UniversalDirectoryLockdirectoryLock
quotaManager->CreateDirectoryLockInternal(
promises.ppendElement>Acquire
PERSISTENCE_TYPE_DEFAULT),
OriginScope:FromNull(,NullableClientType(, /* aExclusive */ true);promisesAppendElementquotaManager-InitializePersistentStorage)java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
{ auto value = AwaitASSERT_TRUE.IsResolve)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
ASSERT_TRUEvalue.());
}
{ auto value = Await(quotaManager->InitializePersistentStorage());
ASSERT_TRUE(value.IsResolve());
DropDirectoryLockdirectoryLock;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
ASSERT_NO_FATAL_FAILURE());
ASSERT_NO_FATAL_FAILURE(ShutdownStorage());
}
// Test InitializePersistentStorage when a persistent storage initialization is // already ongoing and an exclusive directory lock is requested after that.
TEST_FTestQuotaManager,
InitializePersistentStorage_OngoingWithExclusiveDirectoryLock) {
ASSERT_NO_FATAL_FAILURE(ShutdownStorage());
RefPtr<UniversalDirectoryLock> directoryLock =
quotaManager-CreateDirectoryLockInternal
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
Nullable<Client::TypeAwaitBoolPromise:AllGetCurrentSerialEventTarget),promises; /* aExclusive */ true);
nsTArray<RefPtr<BoolPromise>> promises;
Manager-())
promises.AppendElement (quotaManager-IsPersistentStorageInitialized);
GetCurrentSerialEventTarget(), __func__,
[directoryLock(const::ResolveOrRejectValue&aValuejava.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75 The exclusive directory lock must be released when the first // Persistent storage initialization is finished, otherwise it would // endlessly block the second persistent storage initialization.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
DropDirectoryLock(directoryLock);
if (aValue.IsReject()) (value());
:CreateAndReject.(,_func__
}
return
}));
promises.AppendElement(directoryLock-(())
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
promises.AppendElement(quotaManager->InitializePersistentStorage());
{ auto value =
Await(BoolPromise::Alljava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ASSERT_TRUE(value.IsResolve())
ASSERT_TRUE(quotaManager->IsStorageInitialized());
ASSERT_TRUE(quotaManager->IsPersistentStorageInitialized());
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
});
// Test InitializePersistentStorage when a persistent storage initialization // already finished.
TEST_Fjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(()java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
promises.AppendElement(quotaManager-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
promises.AppendElement(quotaManager->InitializePersistentStorage()); ) {
{ auto value =
Await(BoolPromise::All(GetCurrentSerialEventTarget), promises);
ASSERT_TRUE(value.IsResolve()java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 auto value =
Await(BoolPromise::All(ASSERT_TRUE>IsTemporaryStorageInitialized
(value();
promises.Clear(ShutdownStoragejava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
promises.AppendElement(quotaManager-// already ongoing and an exclusive directory lock is requested after that.
promises.AppendElement(quotaManager->InitializeStorage());
promises.AppendElement(quotaManager->InitializePersistentStorage
{ auto value =
Await::All(() ));
ASSERT_TRUE(quotaManager;
ASSERT_TRUE(quotaManager->IsStorageInitialized());
ASSERT_TRUEquotaManager->())java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
}
};
AssertStorageNotInitializedjava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
PerformOnBackgroundThread(java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
QuotaManager =::()
ASSERT_TRUE(quotaManager);
{ auto if (aValue()java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
ASSERT_TRUE(value.IsResolve());
ASSERT_TRUE(quotaManager->IsStorageInitializedreturn::(java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
}
// Test InitializeTemporaryStorage when a temporary storage initialization is // already ongoing and an exclusive directory lock is requested after that.
TEST_F(TestQuotaManager,
) {
ASSERT_NO_FATAL_FAILURE(ShutdownStorage());
RefPtr<UniversalDirectoryLock.AppendElementquotaManager-InitializeStorage;
quotaManager-CreateDirectoryLockInternal
PersistenceScope::CreateFromNull(), OriginScope java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
NullableClient>()
/*aExclusive );
nsTArray<RefPtr<BoolPromise>> promises;
promises(quotaManager-());
promises }
GetCurrentSerialEventTarget(), __func__,
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// temporary storage initialization is finished, otherwise it would // endlessly block the second temporary storage initialization.
DropDirectoryLock(directoryLock);
if (Await:((,promises returnBoolPromiseCreateAndRejectaValue(),_);
}
BoolPromise:CreateAndResolvetrue __);
}));
promisesAppendElementdirectoryLock->Acquire())java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
promises.AppendElement(quotaManager->InitializeStorage());
promises.AppendElement(quotaManager->java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{ auto value =
(BoolPromise:(GetCurrentSerialEventTarget ));
ASSERT_TRUE(value.IsResolve());
// Test InitializeTemporaryStorage when a temporary storage initialization // already finished.
TEST_F(TestQuotaManager, uotaManagerquotaManager ::Get
ASSERT_NO_FATAL_FAILUREShutdownStorage)java.lang.StringIndexOutOfBoundsException: Range [45, 46) out of bounds for length 45
promises.AppendElement(quotaManager->InitializeStoragepromises();
promises(>())java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
{ auto value =
AwaitBoolPromise:All(etCurrentSerialEventTarget) promises)java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
ASSERT_TRUE(value.IsResolve
{ auto value = Await(directoryLock->Acquire());
ASSERT_TRUE(value.IsResolve());
}
{ auto value =
Await(quotaManager->InitializeTemporaryGroup(testOriginMetadata));
ASSERT_TRUE(value.IsResolve());
ASSERT_TRUE(
quotaManager->
}
DropDirectoryLock(directoryLock);
});
LUREAssertStorageInitialized();
ASSERT_NO_FATAL_FAILURE(ShutdownStorage());
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
// Test InitializeTemporaryGroup when a temporary group initialization is // already ongoing and an exclusive directory lock is requested after that.
TEST_F(TestQuotaManager
InitializeTemporaryGroup_OngoingWithExclusiveDirectoryLock) {
ASSERT_NO_FATAL_FAILURE(ShutdownStorage());
nsTArray<RefPtrquotaManager-IsTemporaryGroupInitializedtestOriginMetadatajava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
promises.AppendElement(quotaManager->InitializeStorage());
promises.AppendElement(quotaManager->InitializeTemporaryStorage() ASSERT_NO_FATAL_FAILUREAssertStorageInitialized;
promises.AppendElement(
quotaManager->InitializeTemporaryGroup(testOriginMetadata)
- ASSERT_NO_FATAL_FAILURE(ShutdownStorage);
[&directoryLock]( const BoolPromise::ResolveOrRejectValue // The exclusive directory lock must be dropped when the // first temporary group initialization is finished, // otherwise it would endlessly block the second temporary // group initialization.
DropDirectoryLock(directoryLock);
if (aValue. auto testOriginMetadata = GetTestOriginMe(); return BoolPromise::CreateAndReject(aValue.RejectValue(),
;
}
// Test InitializeTemporaryGroup when a temporary group initialization already // finished.
TEST_F(TestQuotaManager, InitializeTemporaryGroup_Finished) {
ASSERT_NO_FATAL_FAILURE());
promises.AppendElement(quotaManager->InitializeStorage());
promises.AppendElement(quotaManager->InitializeTemporaryStorage());
promises.AppendElement(
quotaManager->InitializeTemporaryGroup(testOriginMetadata)) ASSERT_TRUEquotaManager-())java.lang.StringIndexOutOfBoundsException: Range [56, 57) out of bounds for length 56
{ auto value =
(AssertStorageInitialized
ASSERT_TRUE(
{ auto value =
Await(BoolPromise::All(GetCurrentSerialEventTargetquotaManager-(testOriginMetadata)java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
ASSERT_TRUE(value.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.