Bug 1694727, remove the testing only code for history.length handling, r=peterv

Differential Revision: https://phabricator.services.mozilla.com/D108034
This commit is contained in:
Olli Pettay
2021-03-11 19:31:30 +00:00
parent 1d612ff649
commit 4c33db23b8
12 changed files with 2 additions and 201 deletions

View File

@@ -3143,35 +3143,6 @@ bool BrowsingContext::CanSet(FieldIndex<IDX_PendingInitialization>,
return IsTop() && GetPendingInitialization() && !aNewValue;
}
void BrowsingContext::SessionHistoryChanged(int32_t aIndexDelta,
int32_t aLengthDelta) {
if (XRE_IsParentProcess() || mozilla::SessionHistoryInParent()) {
// This method is used to test index and length for the session history
// in child process only.
return;
}
if (!IsTop()) {
// Some tests have unexpected setup while Fission shistory is being
// implemented.
return;
}
RefPtr<ChildSHistory> shistory = GetChildSessionHistory();
if (!shistory || !shistory->AsyncHistoryLength()) {
return;
}
nsID changeID = shistory->AddPendingHistoryChange(aIndexDelta, aLengthDelta);
uint32_t index = shistory->Index();
uint32_t length = shistory->Count();
// Do artificial history update through parent process to test asynchronous
// history.length handling.
ContentChild::GetSingleton()->SendSessionHistoryUpdate(this, index, length,
changeID);
}
bool BrowsingContext::IsPopupAllowed() {
for (auto* context = GetCurrentWindowContext(); context;
context = context->GetParentWindowContext()) {