The problem here is that the test expects to receive a request for the
|test-network-request.html| but the waitForFinishedRequest() accepts any
request that happens to occur at the same time. In this particular bug,
a GMP update is triggered during the test and the waitForFinishedRequest()
promise resolves with that particular request which obviously isn't the
one the test was expecting.
These changes add an optional predicate function parameter to
waitForFinishedRequest() which will be called for each completed request
and the returned promise only resolves when the predicate returns true for
a request.
Also, browser_console_netlogging.js begins to use the aforementioned
functionality by passing a predicate that only accepts the request for
|test-network-request.html| effectively fixing the intermittent failure.
MozReview-Commit-ID: AWhMRjrqP8i