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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector/network/long-script-content.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 src="../debugger-test.js"></script> 5 <script src="../debugger-test.js"></script>
6 <script> 6 <script>
7 7
8 var scriptElement; 8 var scriptElement;
9 function loadScript() 9 function loadScript()
10 { 10 {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 InspectorTest.waitForScriptSource("long_script.cgi", step4); 45 InspectorTest.waitForScriptSource("long_script.cgi", step4);
46 } 46 }
47 47
48 function step4(uiSourceCode) 48 function step4(uiSourceCode)
49 { 49 {
50 InspectorTest.evaluateInPage("gc()", step5.bind(null, uiSourceCode)); 50 InspectorTest.evaluateInPage("gc()", step5.bind(null, uiSourceCode));
51 } 51 }
52 52
53 function step5(uiSourceCode) 53 function step5(uiSourceCode)
54 { 54 {
55 uiSourceCode.requestContent(step6); 55 uiSourceCode.requestContent().then(step6);
56 } 56 }
57 57
58 function step6(loadedScript) 58 function step6(loadedScript)
59 { 59 {
60 var expected = "console.log('finished');\n"; 60 var expected = "console.log('finished');\n";
61 InspectorTest.assertTrue(!!loadedScript, "No script content"); 61 InspectorTest.assertTrue(!!loadedScript, "No script content");
62 loadedScript = loadedScript.replace(/\r\n/g, '\n'); // on windows we re ceive additional symbol \r at line end. 62 loadedScript = loadedScript.replace(/\r\n/g, '\n'); // on windows we re ceive additional symbol \r at line end.
63 InspectorTest.assertEquals(1024 * 10240 + expected.length, loadedScript. length, "Loaded script length mismatch"); 63 InspectorTest.assertEquals(1024 * 10240 + expected.length, loadedScript. length, "Loaded script length mismatch");
64 var actual = loadedScript.substring(loadedScript.length - expected.lengt h); 64 var actual = loadedScript.substring(loadedScript.length - expected.lengt h);
65 InspectorTest.assertEquals(expected, actual, "Loaded script is corrupted "); 65 InspectorTest.assertEquals(expected, actual, "Loaded script is corrupted ");
66 66
67 InspectorTest.completeTest(); 67 InspectorTest.completeTest();
68 } 68 }
69 } 69 }
70 </script> 70 </script>
71 </head> 71 </head>
72 <body onload="runTest()"> 72 <body onload="runTest()">
73 <p> Tests long script content is correctly shown in source panel after page reload.</p> 73 <p> Tests long script content is correctly shown in source panel after page reload.</p>
74 </body> 74 </body>
75 </html> 75 </html>
76 76
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698