mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 07:13:20 +00:00
Bug 1396228 - Filter out by type if the type if specified for PerformanceEntry.getEntries. r=baku
MozReview-Commit-ID: 4XManqN8BVY --HG-- extra : rebase_source : 2fefe77e5fcadbd4e5632d557e554e8356c1ef52
This commit is contained in:
parent
8ae5e3226b
commit
8f3ef222fd
@ -90,10 +90,18 @@ PerformanceObserverEntryList::GetEntriesByName(
|
||||
nsTArray<RefPtr<PerformanceEntry>>& aRetval)
|
||||
{
|
||||
aRetval.Clear();
|
||||
const bool typePassed = aEntryType.WasPassed();
|
||||
for (const RefPtr<PerformanceEntry>& entry : mEntries) {
|
||||
if (entry->GetName().Equals(aName)) {
|
||||
aRetval.AppendElement(entry);
|
||||
if (!entry->GetName().Equals(aName)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (typePassed &&
|
||||
!entry->GetEntryType().Equals(aEntryType.Value())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
aRetval.AppendElement(entry);
|
||||
}
|
||||
aRetval.Sort(PerformanceEntryComparator());
|
||||
}
|
||||
|
@ -1,11 +0,0 @@
|
||||
[po-getentries.any.html]
|
||||
type: testharness
|
||||
[getEntries, getEntriesByType and getEntriesByName work]
|
||||
expected: FAIL
|
||||
|
||||
|
||||
[po-getentries.any.worker.html]
|
||||
type: testharness
|
||||
[getEntries, getEntriesByType and getEntriesByName work]
|
||||
expected: FAIL
|
||||
|
Loading…
Reference in New Issue
Block a user