1 // META: script=/common/get-host-info.sub.js
2 // META: script=./resources/common.js
6 function indexOfEmptyEntry(result) {
7 return result.breakdown.findIndex(isEmptyBreakdownEntry);
10 assert_true(self.crossOriginIsolated);
11 promise_test(async testCase => {
12 const initial = await performance.measureMemory();
13 let observed_different_order = false;
14 for (let i = 0; i < 100; ++i) {
15 const current = await performance.measureMemory();
16 if (indexOfEmptyEntry(initial) != indexOfEmptyEntry(current)) {
17 observed_different_order = true;
20 // The order of the breakdown entries must be randomized.
21 // A conforming implementation may fail the following assert with
22 // the probability of at most 2^-100 since there are at least two
23 // entries in the breakdown.
24 assert_true(observed_different_order);
25 }, 'Well-formed result of performance.measureMemory.');