Skip to content

Commit c760d16

Browse files
mattwoodrowMatt Woodrow
andauthored
Perf-Dashboard.Render sync phase sets location.hash, but the actual DOM (#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]>
1 parent f4763c3 commit c760d16

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

resources/perf.webkit.org/public/v3/bundled-scripts.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/perf.webkit.org/public/v3/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
function openCharts()
8181
{
8282
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)))';
83+
window.onhashchange();
8384
}
8485

8586
function mockAPIs() {

resources/perf.webkit.org/public/v3/pages/page-router.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,11 @@ class PageRouter {
9797

9898
_hashDidChange()
9999
{
100-
if (unescape(location.hash) == this._hash)
100+
let unescapedHash = unescape(location.hash);
101+
if (unescapedHash == this._hash)
101102
return;
102103
this.route();
103-
this._hash = null;
104+
this._hash = unescapedHash;
104105
}
105106

106107
_serializeToHash(route, state)

0 commit comments

Comments
 (0)