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

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: Initialise encoded_body_length for sync XHR to data: URLs 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="/misc/resources/run-async-tasks-promise.js"></script>
5 <script>
6 const url = '/misc/resources/gzip-content-encoding.php';
7 const uncompressedSize = 1250;
8
9 function checkResourceSizes() {
10 var absoluteUrl = new URL(url, location.href).href;
11 var entries = performance.getEntriesByName(absoluteUrl);
12 assert_equals(entries.length, 2, 'Wrong number of entries');
13 for (var entry of entries) {
14 if (entry.name === absoluteUrl) {
15 assert_between_exclusive(entry.encodedBodySize, 0, uncompressedSize,
16 'encodedBodySize');
17 assert_equals(entry.decodedBodySize, uncompressedSize);
18 }
19 }
20 }
21
22 promise_test(() => {
23 // Fetch twice to ensure at least one fetch comes from the cache.
24 var eatBody = response => response.arrayBuffer();
25 return fetch(url)
26 .then(eatBody)
27 .then(() => fetch(url))
28 .then(eatBody)
29 .then(runAsyncTasks)
30 .then(checkResourceSizes);
31 }, 'PerformanceResourceTiming sizes compressed content test');
32 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698