Skip to next file with comments goes to change view if there are none

The command to view the next file in the patch set with comments
navigates to the change view if there is no next file with comments. The
same behavior is applied to the previous file with comments shortcut.

A suite of tests is added for the skip methods.

Feature: Issue 5452
Change-Id: Iaa43e3a4ca1d1825fd0a205dd9b722b5f7cf59e4
diff --git a/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view.js b/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view.js
index 8c2954b..de9905a 100644
--- a/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view.js
+++ b/polygerrit-ui/app/elements/diff/gr-diff-view/gr-diff-view.js
@@ -307,17 +307,30 @@
     },
 
     _moveToPreviousFileWithComment() {
-      if (this._commentSkips && this._commentSkips.previous) {
-        Gerrit.Nav.navigateToDiff(this._change, this._commentSkips.previous,
-            this._patchRange.patchNum, this._patchRange.basePatchNum);
+      if (!this._commentSkips) { return; }
+
+      // If there is no previous diff with comments, then return to the change
+      // view.
+      if (!this._commentSkips.previous) {
+        this._navToChangeView();
+        return;
       }
+
+      Gerrit.Nav.navigateToDiff(this._change, this._commentSkips.previous,
+          this._patchRange.patchNum, this._patchRange.basePatchNum);
     },
 
     _moveToNextFileWithComment() {
-      if (this._commentSkips && this._commentSkips.next) {
-        Gerrit.Nav.navigateToDiff(this._change, this._commentSkips.next,
-            this._patchRange.patchNum, this._patchRange.basePatchNum);
+      if (!this._commentSkips) { return; }
+
+      // If there is no next diff with comments, then return to the change view.
+      if (!this._commentSkips.next) {
+        this._navToChangeView();
+        return;
       }
+
+      Gerrit.Nav.navigateToDiff(this._change, this._commentSkips.next,
+          this._patchRange.patchNum, this._patchRange.basePatchNum);
     },
 
     _handleCKey(e) {