Skip to content

Commit f8884de

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 f8884de

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

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

+4-3
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

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ class PageRouter {
66
this._currentPage = null;
77
this._historyTimer = null;
88
this._hash = null;
9+
this._previousHash = null;
910

1011
window.onhashchange = this._hashDidChange.bind(this);
1112
}
@@ -97,8 +98,12 @@ class PageRouter {
9798

9899
_hashDidChange()
99100
{
100-
if (unescape(location.hash) == this._hash)
101+
let unescapedHash = unescape(location.hash);
102+
if (unescapedHash == this._hash)
101103
return;
104+
if(unescapedHash == this._previousHash)
105+
return;
106+
this._previousHash = unescapedHash;
102107
this.route();
103108
this._hash = null;
104109
}

0 commit comments

Comments
 (0)