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

Unified Diff: third_party/WebKit/LayoutTests/inspector/help/release-note.html

Issue 2649023007: DevTools: implement release note behind an experiment (Closed)
Patch Set: address CL comments Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698