Closed
Bug 1168726
Opened 10 years ago
Closed 10 years ago
Use performange.getEntriesByType instead of getEntries in test if there is no clear reason
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla41
Tracking | Status | |
---|---|---|
firefox41 | --- | fixed |
People
(Reporter: hiro, Assigned: hiro)
References
Details
Attachments
(1 file, 1 obsolete file)
10.13 KB,
patch
|
hiro
:
review+
|
Details | Diff | Splinter Review |
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.
Assignee | ||
Comment 1•10 years ago
|
||
: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)
Comment 2•10 years ago
|
||
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+
Assignee | ||
Comment 3•10 years ago
|
||
(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+
Assignee | ||
Updated•10 years ago
|
Keywords: checkin-needed
Keywords: checkin-needed
Comment 5•10 years ago
|
||
Comment 6•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox41:
--- → fixed
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•