Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: LayoutTests/http/tests/misc/webtiming-resolution.html

Issue 1214063008: Reduce resolution of performance.now to prevent timing attacks (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/http/tests/misc/webtiming-resolution-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="/js-test-resources/js-test.js"></script>
4 </head>
5 <body>
6 <p id="description"></p>
7 <div id="console"></div>
8 <script>
9 description("Verifies the minimum resolution is 5 microseconds.");
10
11 var t0 = performance.now();
12 var t1 = performance.now();
13 while (t0 == t1) {
14 t1 = performance.now();
15 }
16
17 var expectedResolutionMilliseconds = 0.005;
18 var integerMultipleOfResolution = (t1 - t0) / expectedResolutionMilliseconds;
19 var shouldBeNearZeroOrOne = integerMultipleOfResolution % 1;
20 shouldBe("shouldBeNearZeroOrOne < 1e-10 || Math.abs(shouldBeNearZeroOrOne - 1) < 1e-10", "true");
21
22 </script>
23 </body>
24 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/misc/webtiming-resolution-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698