Bug 185125 - REGRESSION(r230960): Browser tests under TimeSeriesChart fetchMeasurementSets all fail
Summary: REGRESSION(r230960): Browser tests under TimeSeriesChart fetchMeasurementSets...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Perf Dashboard (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-04-29 17:48 PDT by Ryosuke Niwa
Modified: 2018-04-30 16:45 PDT (History)
8 users (show)

See Also:


Attachments
Patch (2.03 KB, patch)
2018-04-30 09:30 PDT, dewei_zhu
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews206 for win-future (12.75 MB, application/zip)
2018-04-30 11:34 PDT, EWS Watchlist
no flags Details
Fixes the bug (14.15 KB, patch)
2018-04-30 12:10 PDT, Ryosuke Niwa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2018-04-29 17:48:48 PDT
Open browser-tests/index.html?grep=TimeSeriesChart%20fetchMeasurementSets

Observe all test cases fail with the following error:
TypeError: undefined is not an object (evaluating 'RemoteAPI.getJSONWithStatus')_fetchPrimaryCluster@file:///Volumes/Data/git-webkit/Websites/perf.webkit.org/public/v3/models/measurement-set.js:116:25

The problem is that unit-tests/resources/mock-remote-api.js directly imports privileged APIs for browser & node using require.
We can't do this because require(~) doesn't exist in a browser.

Each user of MockRemoteAPI needs to manually inject the appropriate type of PrivilegedAPI instead.
Comment 1 Ryosuke Niwa 2018-04-29 17:50:28 PDT
There are 48 browser test failures (out of 140 tests we have) all caused by this change :(
Comment 2 dewei_zhu 2018-04-30 09:30:49 PDT
Created attachment 339113 [details]
Patch
Comment 3 EWS Watchlist 2018-04-30 11:33:48 PDT
Comment on attachment 339113 [details]
Patch

Attachment 339113 [details] did not pass win-ews (win):
Output: http://webkit-queues.webkit.org/results/7509159

New failing tests:
http/tests/security/contentSecurityPolicy/userAgentShadowDOM/allow-video.html
Comment 4 EWS Watchlist 2018-04-30 11:34:00 PDT
Created attachment 339132 [details]
Archive of layout-test-results from ews206 for win-future

The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews206  Port: win-future  Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Comment 5 Ryosuke Niwa 2018-04-30 12:05:19 PDT
Comment on attachment 339113 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=339113&action=review

> Websites/perf.webkit.org/unit-tests/resources/mock-remote-api.js:67
> +        const PrivilegedAPI = useNodePrivilegedAPI ?
> +            require('../../tools/js/privileged-api').PrivilegedAPI : require('../../public/v3/privileged-api.js').PrivilegedAPI;

This is not right as it would end up loading PrivilegedAPI each time inject is called.
Comment 6 Ryosuke Niwa 2018-04-30 12:10:15 PDT
Created attachment 339134 [details]
Fixes the bug
Comment 7 Ryosuke Niwa 2018-04-30 16:43:46 PDT
Comment on attachment 339134 [details]
Fixes the bug

Clearing flags on attachment: 339134

Committed r231180: <https://trac.webkit.org/changeset/231180>
Comment 8 Ryosuke Niwa 2018-04-30 16:43:48 PDT
All reviewed patches have been landed.  Closing bug.
Comment 9 Radar WebKit Bug Importer 2018-04-30 16:45:16 PDT
<rdar://problem/39854346>