Skip to content

Commit f7cb31b

Browse files
author
Matt Woodrow
committed
Perf-Dashboard.Render sync phase sets location.hash, but the actual DOM
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.
1 parent 68d8f57 commit f7cb31b

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

+2-2
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

+1
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

+3-2
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)