OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="../inspector-test.js"></script> |
| 4 <script src="../debugger-test.js"></script> |
| 5 <script src="../isolated-filesystem-test.js"></script> |
| 6 <script src="./automapping-test.js"></script> |
| 7 <script> |
| 8 |
| 9 async function test() |
| 10 { |
| 11 var foo_js = { |
| 12 content: "console.log('foo.js!');", |
| 13 time: null |
| 14 }; |
| 15 |
| 16 var fs = new InspectorTest.TestFileSystem("file:///var/www"); |
| 17 InspectorTest.addFiles(fs, { |
| 18 "scripts/foo.js": foo_js, |
| 19 }); |
| 20 await new Promise(fulfill => fs.reportCreated(fulfill)); |
| 21 InspectorTest.markStep('Open foo.js editor'); |
| 22 var fileUISourceCode = await InspectorTest.waitForUISourceCode('foo.js', Wor
kspace.projectTypes.FileSystem); |
| 23 await dumpEditorMimeType(); |
| 24 |
| 25 InspectorTest.markStep('Rename foo.js => foo.css'); |
| 26 await fileUISourceCode.rename('foo.css'); |
| 27 await dumpEditorMimeType(); |
| 28 |
| 29 InspectorTest.completeTest(); |
| 30 |
| 31 async function dumpEditorMimeType() { |
| 32 var sourceFrame = await InspectorTest.showUISourceCodePromise(fileUISour
ceCode); |
| 33 var textEditor = sourceFrame.textEditor; |
| 34 InspectorTest.addResult('Text editor mimeType: ' + textEditor.mimeType()
); |
| 35 } |
| 36 } |
| 37 </script> |
| 38 </head> |
| 39 <body onload="runTest()"> |
| 40 <p>Verify that text editor's mimeType gets changed as UISourceCode gets renamed.
</p> |
| 41 </body> |
| 42 </html> |
OLD | NEW |