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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/misc/resource-timing-sizes-content-encoding.html

Issue 2105713002: Render process changes for ResourceTiming sizes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@resource_timing_sizes_browser_process
Patch Set: Fix variable name style. Created 4 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="/resources/testharness.js"></script>
3 <script src="/resources/testharnessreport.js"></script>
4 <script src="/resources/get-host-info.js?pipe=sub"></script>
Kunihiko Sakamoto 2016/07/07 09:56:51 Is this necessary?
Adam Rice 2016/07/07 11:21:12 Removed, thanks.
5 <script src="/misc/resources/run-async-tasks-promise.js"></script>
6 <script>
7 const url = '/misc/resources/gzip-content-encoding.php';
8 const uncompressedSize = 1250;
9
10 var seenCount = 0;
11
12 function checkResourceSizes() {
13 var entries = performance.getEntriesByType('resource');
14 var absoluteUrl = new URL(url, location.href).href;
15 for (var entry of entries) {
16 if (entry.name === absoluteUrl) {
Kunihiko Sakamoto 2016/07/07 09:56:50 You can use performance.getEntriesByName(absoluteU
Adam Rice 2016/07/07 11:21:12 That's better, thank you.
17 assert_between_exclusive(entry.encodedBodySize, 0, uncompressedSize,
18 'encodedBodySize');
19 assert_equals(entry.decodedBodySize, uncompressedSize);
20 ++seenCount;
21 }
22 }
23 assert_equals(seenCount, 2, 'seenCount');
24 }
25
26 promise_test(() => {
27 // Fetch twice to ensure at least one fetch comes from the cache.
28 var eatBody = response => response.arrayBuffer();
29 return fetch(url)
30 .then(eatBody)
31 .then(() => fetch(url))
32 .then(eatBody)
33 .then(runAsyncTasks)
34 .then(checkResourceSizes);
35 }, 'PerformanceResourceTiming sizes compressed content test');
36 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698