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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/script-snippet-checkContent.html

Issue 1609973002: DevTools: promisify ContentProvider.requestContent and all its clients. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaseline 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="../../../http/tests/inspector/inspector-test.js"></script> 3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/debugger-test.js"></script> 4 <script src="../../../http/tests/inspector/debugger-test.js"></script>
5 <script> 5 <script>
6 function startWorker() 6 function startWorker()
7 { 7 {
8 var workerScript = "postMessage('Done.');"; 8 var workerScript = "postMessage('Done.');";
9 var blob = new Blob([workerScript], { type: "text/javascript" }); 9 var blob = new Blob([workerScript], { type: "text/javascript" });
10 var worker = new Worker(URL.createObjectURL(blob)); 10 var worker = new Worker(URL.createObjectURL(blob));
11 } 11 }
12 12
13 function test() 13 function test()
14 { 14 {
15 var uiSourceCode; 15 var uiSourceCode;
16 16
17 window.confirm = confirmOverride; 17 window.confirm = confirmOverride;
18 18
19 WebInspector.scriptSnippetModel.project().createFile("", null, "", onCreated .bind(this)); 19 WebInspector.scriptSnippetModel.project().createFile("", null, "", onCreated .bind(this));
20 function onCreated(usc) 20 function onCreated(usc)
21 { 21 {
22 uiSourceCode = usc; 22 uiSourceCode = usc;
23 uiSourceCode.requestContent(onContentAvailable); 23 uiSourceCode.requestContent().then(onContentAvailable);
24 } 24 }
25 25
26 function onContentAvailable() 26 function onContentAvailable()
27 { 27 {
28 uiSourceCode.setWorkingCopy("var a = 0;"); 28 uiSourceCode.setWorkingCopy("var a = 0;");
29 uiSourceCode.checkContentUpdated(true, onUpdated); 29 uiSourceCode.checkContentUpdated(true, onUpdated);
30 } 30 }
31 31
32 function confirmOverride() 32 function confirmOverride()
33 { 33 {
34 InspectorTest.addResult("FAILED: confirmation dialog appeared"); 34 InspectorTest.addResult("FAILED: confirmation dialog appeared");
35 } 35 }
36 36
37 function onUpdated() 37 function onUpdated()
38 { 38 {
39 InspectorTest.completeTest(); 39 InspectorTest.completeTest();
40 } 40 }
41 } 41 }
42 </script> 42 </script>
43 </head> 43 </head>
44 <body onload="runTest()"> 44 <body onload="runTest()">
45 <p>Tests that checking content on the dirty snippet does not wipe it out.</p> 45 <p>Tests that checking content on the dirty snippet does not wipe it out.</p>
46 </body> 46 </body>
47 </html> 47 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698