Remove backend support for HTML UI plugins

Frontend support was removed in change 299364. So there is no point for
the backend to send HTML plugins to be loaded to the frontend. :-)

Change-Id: I44cc0d15910937de7e1f9b9780a799d4b85b0673
diff --git a/Documentation/rest-api-config.txt b/Documentation/rest-api-config.txt
index a8d9b3d..6ca2b46 100644
--- a/Documentation/rest-api-config.txt
+++ b/Documentation/rest-api-config.txt
@@ -1941,6 +1941,9 @@
 |Field Name    ||Description
 |`has_avatars` |not set if `false`|
 Whether an avatar provider is registered.
+|`js_resource_paths`||
+A list of relative paths (strings). Each path points to a frontend plugin that
+should be loaded, e.g. `plugins/codemirror_editor/static/codemirror_editor.js`.
 |===========================
 
 [[receive-info]]
diff --git a/java/com/google/gerrit/extensions/common/PluginConfigInfo.java b/java/com/google/gerrit/extensions/common/PluginConfigInfo.java
index 13fc9ec..2d1d840 100644
--- a/java/com/google/gerrit/extensions/common/PluginConfigInfo.java
+++ b/java/com/google/gerrit/extensions/common/PluginConfigInfo.java
@@ -19,5 +19,4 @@
 public class PluginConfigInfo {
   public Boolean hasAvatars;
   public List<String> jsResourcePaths;
-  public List<String> htmlResourcePaths;
 }
diff --git a/java/com/google/gerrit/server/plugins/JsPlugin.java b/java/com/google/gerrit/server/plugins/JsPlugin.java
index 12028b60..c120cdd 100644
--- a/java/com/google/gerrit/server/plugins/JsPlugin.java
+++ b/java/com/google/gerrit/server/plugins/JsPlugin.java
@@ -40,8 +40,7 @@
     String fileName = getSrcFile().getFileName().toString();
     int firstDash = fileName.indexOf("-");
     if (firstDash > 0) {
-      int extension =
-          fileName.endsWith(".js") ? fileName.lastIndexOf(".js") : fileName.lastIndexOf(".html");
+      int extension = fileName.lastIndexOf(".js");
       if (extension > 0) {
         return fileName.substring(firstDash + 1, extension);
       }
diff --git a/java/com/google/gerrit/server/plugins/PluginLoader.java b/java/com/google/gerrit/server/plugins/PluginLoader.java
index c4f4a1f..0a06081 100644
--- a/java/com/google/gerrit/server/plugins/PluginLoader.java
+++ b/java/com/google/gerrit/server/plugins/PluginLoader.java
@@ -733,7 +733,7 @@
   }
 
   private boolean isUiPlugin(String name) {
-    return isPlugin(name, "js") || isPlugin(name, "html");
+    return isPlugin(name, "js");
   }
 
   private boolean isPlugin(String fileName, String ext) {
diff --git a/java/com/google/gerrit/server/restapi/config/GetServerInfo.java b/java/com/google/gerrit/server/restapi/config/GetServerInfo.java
index 0a5692e..c3dd1b5 100644
--- a/java/com/google/gerrit/server/restapi/config/GetServerInfo.java
+++ b/java/com/google/gerrit/server/restapi/config/GetServerInfo.java
@@ -320,17 +320,12 @@
     PluginConfigInfo info = new PluginConfigInfo();
     info.hasAvatars = toBoolean(avatar.hasImplementation());
     info.jsResourcePaths = new ArrayList<>();
-    info.htmlResourcePaths = new ArrayList<>();
     plugins.runEach(
         plugin -> {
           String path =
               String.format(
                   "plugins/%s/%s", plugin.getPluginName(), plugin.getJavaScriptResourcePath());
-          if (path.endsWith(".html")) {
-            info.htmlResourcePaths.add(path);
-          } else {
-            info.jsResourcePaths.add(path);
-          }
+          info.jsResourcePaths.add(path);
         });
     return info;
   }
diff --git a/javatests/com/google/gerrit/acceptance/api/plugin/PluginIT.java b/javatests/com/google/gerrit/acceptance/api/plugin/PluginIT.java
index 6838f8d..18eca27 100644
--- a/javatests/com/google/gerrit/acceptance/api/plugin/PluginIT.java
+++ b/javatests/com/google/gerrit/acceptance/api/plugin/PluginIT.java
@@ -48,18 +48,14 @@
 @NoHttpd
 public class PluginIT extends AbstractDaemonTest {
   private static final String JS_PLUGIN = "Gerrit.install(function(self){});\n";
-  private static final String HTML_PLUGIN =
-      String.format("<dom-module id=\"test\"><script>%s</script></dom-module>", JS_PLUGIN);
   private static final RawInput JS_PLUGIN_CONTENT = RawInputUtil.create(JS_PLUGIN.getBytes(UTF_8));
-  private static final RawInput HTML_PLUGIN_CONTENT =
-      RawInputUtil.create(HTML_PLUGIN.getBytes(UTF_8));
 
   private static final ImmutableList<String> PLUGINS =
       ImmutableList.of(
           "plugin-a.js",
-          "plugin-b.html",
+          "plugin-b.js",
           "plugin-c.js",
-          "plugin-d.html",
+          "plugin-d.js",
           "plugin-normal.jar",
           "plugin-empty.jar",
           "plugin-unset.jar",
@@ -97,7 +93,7 @@
     assertPlugins(list().start(1).limit(2).get(), PLUGINS.subList(1, 3));
 
     // With prefix
-    assertPlugins(list().prefix("plugin-b").get(), ImmutableList.of("plugin-b.html"));
+    assertPlugins(list().prefix("plugin-b").get(), ImmutableList.of("plugin-b.js"));
     assertPlugins(list().prefix("PLUGIN-").get(), ImmutableList.of());
 
     // With substring
@@ -105,7 +101,7 @@
     assertPlugins(list().substring("lugin-").start(1).limit(2).get(), PLUGINS.subList(1, 3));
 
     // With regex
-    assertPlugins(list().regex(".*in-b").get(), ImmutableList.of("plugin-b.html"));
+    assertPlugins(list().regex(".*in-b").get(), ImmutableList.of("plugin-b.js"));
     assertPlugins(list().regex("plugin-.*").get(), PLUGINS.subList(0, PLUGINS.size() - 1));
     assertPlugins(list().regex("plugin-.*").start(1).limit(2).get(), PLUGINS.subList(1, 3));
 
@@ -147,7 +143,7 @@
     com.google.gerrit.extensions.common.InstallPluginInput input =
         new com.google.gerrit.extensions.common.InstallPluginInput();
     input.raw = JS_PLUGIN_CONTENT;
-    gApi.plugins().install("legacy.html", input);
+    gApi.plugins().install("legacy.js", input);
     gApi.plugins().name("legacy").get();
   }
 
@@ -198,9 +194,6 @@
     if (plugin.endsWith(".js")) {
       return JS_PLUGIN_CONTENT;
     }
-    if (plugin.endsWith(".html")) {
-      return HTML_PLUGIN_CONTENT;
-    }
     assertThat(plugin).endsWith(".jar");
     return pluginJarContent(plugin);
   }