Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/inspector/help/release-note.html |
| diff --git a/third_party/WebKit/LayoutTests/inspector/help/release-note.html b/third_party/WebKit/LayoutTests/inspector/help/release-note.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..aec782d32067812622239b5b5a56fe8b122d22d5 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/inspector/help/release-note.html |
| @@ -0,0 +1,66 @@ |
| +<html> |
| +<head> |
| +<script src="../../http/tests/inspector/inspector-test.js"></script> |
| +<script> |
| +function test() { |
| + Help.releaseNotesByVersion = [ |
| + { |
| + version: 99, |
| + highlights: [ |
| + { |
| + text: 'Test bullet #1', |
|
alph
2017/02/21 23:19:42
We use double quotes in tests.
chenwilliam
2017/02/22 02:36:38
Done.
|
| + link: 'https://google.com/', |
| + featured: true, |
| + }, |
| + { |
| + text: 'Test bullet #2', |
| + link: 'https://google.com/', |
| + }, |
| + ], |
| + link: 'https://google.com/', |
| + image: { |
| + src: './resources/test.png', |
| + caption: 'Test image', |
| + }, |
| + } |
| + ]; |
| + |
| + const originalShowPanel = UI.inspectorView.showPanel.bind(UI.inspectorView); |
|
alph
2017/02/21 23:19:42
Why do you need original one? the sniffer will do
chenwilliam
2017/02/22 02:36:38
Done. I misunderstood how the sniffer worked.
|
| + InspectorTest.addSniffer(UI.inspectorView, 'showPanel', onShowPanel); |
| + |
| + InspectorTest.addResult(`Browser user agent: ${navigator.userAgent}\n`); |
| + Help.showReleaseNoteIfNeeded(); |
| + |
| + function onShowPanel(...args) { |
| + originalShowPanel(...args).then(() => onReleaseNoteShown()); |
| + } |
| + |
| + function onReleaseNoteShown() { |
| + const releaseNoteView = UI.viewManager.view('release-note'); |
|
alph
2017/02/21 23:19:42
We don't use const. It turned out to be slow.
chenwilliam
2017/02/22 02:36:38
Done.
|
| + const releaseNoteElement = releaseNoteView[UI.View._widgetSymbol].contentElement; |
| + InspectorTest.addResult('Dumping release note text:'); |
| + InspectorTest.addResult(releaseNoteElement.innerText); |
| + InspectorTest.addResult('Last version of release note seen should be updated:'); |
| + InspectorTest.addResult(Help.releaseNoteVersionSetting().get() + '\n'); |
| + |
| + InspectorTest.addSniffer(UI.InspectorView.prototype, 'closeDrawerTab', onClose); |
| + InspectorTest.addResult('Click on hide button'); |
| + const closeButton = releaseNoteElement.querySelector('.close-release-note'); |
| + closeButton.click(); |
| + } |
| + |
| + function onClose(view) { |
| + InspectorTest.addResult(`Hiding view: ${view}`); |
| + InspectorTest.completeTest(); |
| + } |
| +} |
| + |
| +</script> |
| +</head> |
| +<body onload="runTest()"> |
| +<p> |
| +Test release note |
| +</p> |
| + |
| +</body> |
| +</html> |