| OLD | NEW |
| (Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../http/tests/inspector/console-test.js"></script> |
| 5 <script> |
| 6 function test() { |
| 7 Runtime.experiments.enableForTest("releaseNote"); |
| 8 Help.ReleaseNoteManager._releaseNotesByVersion = [ |
| 9 { |
| 10 version: 99, |
| 11 highlights: [ |
| 12 { |
| 13 text: 'Re-designed Performance panel', |
| 14 link: 'https://google.com/', |
| 15 featured: true, |
| 16 }, |
| 17 { |
| 18 text: 'Inline breakpoints', |
| 19 link: 'https://google.com/', |
| 20 }, |
| 21 { |
| 22 text: 'Better async debugging', |
| 23 link: 'https://google.com/', |
| 24 }, |
| 25 { |
| 26 text: 'Node.js debugging is stable', |
| 27 link: 'https://google.com/', |
| 28 }, |
| 29 ], |
| 30 link: 'https://google.com/', |
| 31 image: { |
| 32 src: './resources/test.png', |
| 33 caption: 'Amazing color picker', |
| 34 }, |
| 35 } |
| 36 ]; |
| 37 |
| 38 const consoleView = Console.ConsoleView.instance(); |
| 39 const releaseNoteManager = consoleView._releaseNoteManager; |
| 40 releaseNoteManager._timeoutDuration = 1; |
| 41 releaseNoteManager._versionSetting.set(98); |
| 42 InspectorTest.addResult(`Last version of release note seen: ${releaseNoteMan
ager._versionSetting.get()}`); |
| 43 InspectorTest.addResult(`Browser user agent: ${navigator.userAgent}\n`); |
| 44 InspectorTest.addSniffer(Console.ConsoleView.prototype, "sawReleaseNote", on
SawReleaseNote); |
| 45 |
| 46 InspectorTest.addResult('Adding release note'); |
| 47 consoleView._addReleaseNote(); |
| 48 |
| 49 InspectorTest.addResult('Dump release note from console'); |
| 50 InspectorTest.dumpConsoleMessages(); |
| 51 |
| 52 function onSawReleaseNote() { |
| 53 InspectorTest.addResult(''); |
| 54 InspectorTest.addResult(`Last version of release note should be updated:
${releaseNoteManager._versionSetting.get()}\n`); |
| 55 const closeButton = self.document.querySelector('.close-release-note-mes
sage'); |
| 56 InspectorTest.addResult('Close release note\n'); |
| 57 closeButton.click(); |
| 58 InspectorTest.addResult('Console should no longer have release note'); |
| 59 InspectorTest.dumpConsoleMessages(); |
| 60 InspectorTest.completeTest(); |
| 61 } |
| 62 |
| 63 |
| 64 } |
| 65 |
| 66 </script> |
| 67 </head> |
| 68 <body onload="runTest()"> |
| 69 <p> |
| 70 Tests for release note |
| 71 </p> |
| 72 |
| 73 </body> |
| 74 </html> |
| OLD | NEW |