Closed Bug 1168726 Opened 9 years ago Closed 9 years ago

Use performange.getEntriesByType instead of getEntries in test if there is no clear reason

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: hiro, Assigned: hiro)

References

Details

Attachments

(1 file, 1 obsolete file)

Once the Frame Timing API has landed, performance.getEntries() contains Frame Timing entries. So if there is no clear reason to use getEntries, we should use getEntriesByType instead of getEntries.
Attached patch Fix (obsolete) (deleted) — Splinter Review
:baku, could you please review this? I actually should have noticed this issue when I wrote test for bug 1158731. https://treeherder.mozilla.org/#/jobs?repo=try&revision=27c084b530ab
Assignee: nobody → hiikezoe
Attachment #8611040 - Flags: review?(amarchesini)
Blocks: 1158032
Comment on attachment 8611040 [details] [diff] [review] Fix Review of attachment 8611040 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/tests/mochitest/general/resource_timing_iframe.html @@ +31,5 @@ > "http://mochi.test:8888/tests/dom/tests/mochitest/general/resource_timing_iframe.html").length, > "This iframe should NOT contain itself as an entry"); > > // Check that there are no iframes added as entries > + for (var i = 0 ; i < window.performance.getEntriesByType("resource").length ; i++) { just because window.performance.getEntriesByType("resource") != window.performance.getEntriesByType("resource") I think it's better if you do: var resources = window.performance.getEntriesByType("resource"); for (var i = 0; i < resources.length; ++i) { var entry = resources[i]; ...
Attachment #8611040 - Flags: review?(amarchesini) → review+
Attached patch Fix v2 (deleted) — Splinter Review
(In reply to Andrea Marchesini (:baku) from comment #2) > ::: dom/tests/mochitest/general/resource_timing_iframe.html > @@ +31,5 @@ > > "http://mochi.test:8888/tests/dom/tests/mochitest/general/resource_timing_iframe.html").length, > > "This iframe should NOT contain itself as an entry"); > > > > // Check that there are no iframes added as entries > > + for (var i = 0 ; i < window.performance.getEntriesByType("resource").length ; i++) { > > just because window.performance.getEntriesByType("resource") != > window.performance.getEntriesByType("resource") > > I think it's better if you do: > > var resources = window.performance.getEntriesByType("resource"); > for (var i = 0; i < resources.length; ++i) { > var entry = resources[i]; > ... Indeed! Thanks! Carrying over review+, tested locally.
Attachment #8611040 - Attachment is obsolete: true
Attachment #8611487 - Flags: review+
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: