Skip to content

Commit

Permalink
Perf-Dashboard.Render sync phase sets location.hash, but the actual D…
Browse files Browse the repository at this point in the history
…OM (#488)

modifications happen asynchronously in the onhashchange() callback.

This results in nothing interesting being measured during the sync phase, and
the resulting rendering update (during the async phase) not including the
change.

Change the test to manually and synchronously trigger the onhashchange()
callback, and change the page content to detect and omit duplicate events.

Co-authored-by: Matt Woodrow <[email protected]>
  • Loading branch information
mattwoodrow and Matt Woodrow authored Mar 1, 2025
1 parent f4763c3 commit c760d16
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions resources/perf.webkit.org/public/v3/bundled-scripts.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions resources/perf.webkit.org/public/v3/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
function openCharts()
{
location.hash = '/charts/?since=1678991819934\u0026paneList=((55-1649-53731881-null-(5-2.5-500))-(55-1407-null-null-(5-2.5-500))-(55-1648-null-null-(5-2.5-500))-(55-1974-null-null-(5-2.5-500)))';
window.onhashchange();
}

function mockAPIs() {
Expand Down
5 changes: 3 additions & 2 deletions resources/perf.webkit.org/public/v3/pages/page-router.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,11 @@ class PageRouter {

_hashDidChange()
{
if (unescape(location.hash) == this._hash)
let unescapedHash = unescape(location.hash);
if (unescapedHash == this._hash)
return;
this.route();
this._hash = null;
this._hash = unescapedHash;
}

_serializeToHash(route, state)
Expand Down

0 comments on commit c760d16

Please sign in to comment.