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

Unified Diff: third_party/WebKit/LayoutTests/inspector/help/release-note-unit.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-unit.html
diff --git a/third_party/WebKit/LayoutTests/inspector/help/release-note-unit.html b/third_party/WebKit/LayoutTests/inspector/help/release-note-unit.html
new file mode 100644
index 0000000000000000000000000000000000000000..c942162367f896ecfac535dd5b553ce00214c4ab
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector/help/release-note-unit.html
@@ -0,0 +1,87 @@
+<html>
+<head>
+<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script>
+function test()
+{
+ Help.releaseNotesByVersion = [
+ {version: 3},
+ {version: 4},
+ {version: 5},
+ ];
+
+ function testMaybeShowInDrawer(lastSeenVersion, browserVersion) {
+ Help._latestReleaseNote = Help._getReleaseNoteByVersion(browserVersion);
+ InspectorTest.addResult(`Last seen version: ${lastSeenVersion}`);
+ InspectorTest.addResult(`Browser version: ${browserVersion}`);
+ const willShow = Help._showReleaseNoteIfNeeded(lastSeenVersion, browserVersion);
+ if (!willShow) {
+ InspectorTest.addResult('Did not show release note drawer');
+ return;
+ }
+ InspectorTest.addResult(`Showed release note in drawer - version: ${Help.latestReleaseNote().version}`);
+ }
+
+ function testGetReleaseNoteByVersion(version) {
+ InspectorTest.addResult(`Getting release note for browser version: ${version}`);
+ const releaseNote = Help._getReleaseNoteByVersion(version);
+ InspectorTest.addResult(`Received release note: ${releaseNote.version}`);
+ }
+
+ InspectorTest.runTestSuite([
+ function getValidReleaseNote(next) {
+ var browserVersion = 3;
+ var lastSeenVersion = 2;
+ testMaybeShowInDrawer(lastSeenVersion, browserVersion);
+ next();
+ },
+ function getAnotherValidReleaseNote(next) {
+ var browserVersion = 4;
+ var lastSeenVersion = 3;
+ testMaybeShowInDrawer(lastSeenVersion, browserVersion);
+ next();
+ },
+ function getReleaseNoteTwoVersionsAhead(next) {
+ var browserVersion = 5;
+ var lastSeenVersion = 3;
+ testMaybeShowInDrawer(lastSeenVersion, browserVersion);
+ next();
+ },
+ function alreadySeenReleaseNote(next) {
+ var browserVersion = 3;
+ var lastSeenVersion = 3;
+ testMaybeShowInDrawer(lastSeenVersion, browserVersion);
+ next();
+ },
+ function browserVersionAheadOfReleaseNote(next) {
+ var browserVersion = 6;
+ var lastSeenVersion = 5;
+ testMaybeShowInDrawer(lastSeenVersion, browserVersion);
+ next();
+ },
+ function getLatestReleaseNote(next) {
+ testGetReleaseNoteByVersion(5);
+ next();
+ },
+ function getReleaseNoteMatchingVersion(next) {
+ testGetReleaseNoteByVersion(4);
+ next();
+ },
+ function getMostRecentReleaseNote(next) {
+ testGetReleaseNoteByVersion(7);
+ next();
+ },
+ function getReleaseNoteFallback(next) {
+ testGetReleaseNoteByVersion(2);
+ next();
+ },
+ ]);
+}
+</script>
+</head>
+<body onload="runTest()">
+<p>
+ Unit test for release note
+</p>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698