зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1276490 - Do not use Math.random() to create unique values to avoid intermittent failrues. r=jgraham
MozReview-Commit-ID: 3QHrpCTpEzM --HG-- extra : rebase_source : 7aaa4dae880b2e49fa0dd36d1eaba0d723d81592
This commit is contained in:
Родитель
3525b6a693
Коммит
76a40b897e
|
@ -15,11 +15,15 @@ New resources will <a href="https://w3c.github.io/performance-timeline/#dfn-queu
|
|||
var filename = pathname.substring(pathname.lastIndexOf('/')+1);
|
||||
return pathname.substring(0, pathname.length - filename.length);
|
||||
}
|
||||
var gUniqueCounter = 0;
|
||||
function generateUniqueValues() {
|
||||
return Date.now() + "-" + (++gUniqueCounter);
|
||||
}
|
||||
var stored_entries = [];
|
||||
var img_location = document.location.origin + path(document.location.pathname)
|
||||
+ "resources/square.png?random=";
|
||||
var img1 = img_location + Math.floor(Math.random() * 100);
|
||||
var img2 = img_location + Math.floor(Math.random() * 1000);
|
||||
var img1 = img_location + generateUniqueValues();
|
||||
var img2 = img_location + generateUniqueValues();
|
||||
var observer = new PerformanceObserver(
|
||||
t.step_func(function (entryList, obs) {
|
||||
stored_entries =
|
||||
|
|
Загрузка…
Ссылка в новой задаче