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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script>
5 function test() {
6 Help.releaseNotesByVersion = [
7 {
8 version: 99,
9 highlights: [
10 {
11 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.
12 link: 'https://google.com/',
13 featured: true,
14 },
15 {
16 text: 'Test bullet #2',
17 link: 'https://google.com/',
18 },
19 ],
20 link: 'https://google.com/',
21 image: {
22 src: './resources/test.png',
23 caption: 'Test image',
24 },
25 }
26 ];
27
28 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.
29 InspectorTest.addSniffer(UI.inspectorView, 'showPanel', onShowPanel);
30
31 InspectorTest.addResult(`Browser user agent: ${navigator.userAgent}\n`);
32 Help.showReleaseNoteIfNeeded();
33
34 function onShowPanel(...args) {
35 originalShowPanel(...args).then(() => onReleaseNoteShown());
36 }
37
38 function onReleaseNoteShown() {
39 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.
40 const releaseNoteElement = releaseNoteView[UI.View._widgetSymbol].conten tElement;
41 InspectorTest.addResult('Dumping release note text:');
42 InspectorTest.addResult(releaseNoteElement.innerText);
43 InspectorTest.addResult('Last version of release note seen should be upd ated:');
44 InspectorTest.addResult(Help.releaseNoteVersionSetting().get() + '\n');
45
46 InspectorTest.addSniffer(UI.InspectorView.prototype, 'closeDrawerTab', o nClose);
47 InspectorTest.addResult('Click on hide button');
48 const closeButton = releaseNoteElement.querySelector('.close-release-not e');
49 closeButton.click();
50 }
51
52 function onClose(view) {
53 InspectorTest.addResult(`Hiding view: ${view}`);
54 InspectorTest.completeTest();
55 }
56 }
57
58 </script>
59 </head>
60 <body onload="runTest()">
61 <p>
62 Test release note
63 </p>
64
65 </body>
66 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698