Closed Bug 1472737 Opened 6 years ago Closed 6 years ago

Ignore areas that open new tabs, windows and so on in BrowserTestUtils

Categories

(Testing :: Code Coverage, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: marco, Unassigned)

References

Details

E.g. in openNewForegroundTab, we should stop profiling before opening a new tab, and restart profiling after opening it and right before going back to the code of the test.
Note: it's not going to be easy to cover all cases (developers could be reimplementing parts of BrowserTestUtils in their test files), but hopefully this will cover the majority of cases.
For some functions unfortunately we can't do much. E.g. when tests use waitForNewWindow: > let winPromise = BrowserTestUtils.waitForNewWindow(); > OpenBrowserWindow(); > > // Do something as part of the test. > > let win = await winPromise; If we exit the profiling when calling waitForNewWindow and reenter when the promise is resolved, we might ignore parts of the tests that are actually meaningful. Unfortunately, looking at bug 1362774 comment 119 it seems not using the BTU function to open a new window is preferred...
And actually, unfortunately we might have the same problems in tests which use something like openNewBrowserWindow, as the test could do: > let winPromise = BrowserTestUtils.openNewBrowserWindow(); > > // Do something as part of the test. > > let win = await winPromise; Where we would ignore part of the test. I wish there was a function that also awaited for the thing to happen before returning to the test :(
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.