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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector/network/cached-resource-destroyed-too-big-discarded.html

Issue 1609973002: DevTools: promisify ContentProvider.requestContent and all its clients. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 years, 11 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
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../inspector-test.js"></script> 3 <script src="../inspector-test.js"></script>
4 <script src="../network-test.js"></script> 4 <script src="../network-test.js"></script>
5 <script> 5 <script>
6 var image; 6 var image;
7 7
8 function loadFirstImage() 8 function loadFirstImage()
9 { 9 {
10 image = new Image(); 10 image = new Image();
(...skipping 21 matching lines...) Expand all
32 { 32 {
33 var imageRequest; 33 var imageRequest;
34 InspectorTest.recordNetwork(); 34 InspectorTest.recordNetwork();
35 InspectorTest.addConsoleSniffer(step2); 35 InspectorTest.addConsoleSniffer(step2);
36 InspectorTest.NetworkAgent.setDataSizeLimitsForTest(100, 100); 36 InspectorTest.NetworkAgent.setDataSizeLimitsForTest(100, 100);
37 InspectorTest.evaluateInPage("loadFirstImage()"); 37 InspectorTest.evaluateInPage("loadFirstImage()");
38 38
39 function step2() 39 function step2()
40 { 40 {
41 imageRequest = InspectorTest.networkRequests().pop(); 41 imageRequest = InspectorTest.networkRequests().pop();
42 imageRequest.requestContent(step3); 42 imageRequest.requestContent().then(step3);
43 } 43 }
44 44
45 function step3() 45 function step3()
46 { 46 {
47 InspectorTest.addResult(imageRequest.url); 47 InspectorTest.addResult(imageRequest.url);
48 InspectorTest.addResult("request.type: " + imageRequest.resourceType()); 48 InspectorTest.addResult("request.type: " + imageRequest.resourceType());
49 InspectorTest.addResult("request.content.length after requesting content : " + imageRequest.content.length); 49 InspectorTest.addResult("request.content.length after requesting content : " + imageRequest.content.length);
50 InspectorTest.assertTrue(imageRequest.content.length > 0, "No content be fore destroying CachedResource."); 50 InspectorTest.assertTrue(imageRequest.content.length > 0, "No content be fore destroying CachedResource.");
51 51
52 InspectorTest.addResult("Releasing cached resource."); 52 InspectorTest.addResult("Releasing cached resource.");
(...skipping 12 matching lines...) Expand all
65 { 65 {
66 // In Oilpan, Resource objects are not destructed until GC. 66 // In Oilpan, Resource objects are not destructed until GC.
67 InspectorTest.evaluateInPage("GCController.collectAll()"); 67 InspectorTest.evaluateInPage("GCController.collectAll()");
68 InspectorTest.NetworkAgent.setCacheDisabled(false, step6); 68 InspectorTest.NetworkAgent.setCacheDisabled(false, step6);
69 } 69 }
70 70
71 function step6() 71 function step6()
72 { 72 {
73 // Re-request content now that CachedResource should have been destroyed . 73 // Re-request content now that CachedResource should have been destroyed .
74 delete imageRequest._content; 74 delete imageRequest._content;
75 imageRequest.requestContent(step7); 75 imageRequest.requestContent().then(step7);
76 } 76 }
77 77
78 function step7() 78 function step7()
79 { 79 {
80 InspectorTest.addResult("request.content after requesting content: " + i mageRequest.content); 80 InspectorTest.addResult("request.content after requesting content: " + i mageRequest.content);
81 InspectorTest.assertTrue(!imageRequest.content, "Content available after CachedResource was destroyed."); 81 InspectorTest.assertTrue(!imageRequest.content, "Content available after CachedResource was destroyed.");
82 InspectorTest.completeTest(); 82 InspectorTest.completeTest();
83 } 83 }
84 } 84 }
85 </script> 85 </script>
86 </head> 86 </head>
87 <body onload="runTest()"> 87 <body onload="runTest()">
88 <p>Tests cached resource content is discarded when cached resource is destroyed if content size is too big for the resource agent's data storage.</p> 88 <p>Tests cached resource content is discarded when cached resource is destroyed if content size is too big for the resource agent's data storage.</p>
89 <a href="https://bugs.webkit.org/show_bug.cgi?id=92108">Bug 92108</a> 89 <a href="https://bugs.webkit.org/show_bug.cgi?id=92108">Bug 92108</a>
90 </body> 90 </body>
91 </html> 91 </html>
92 92
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698