Don't show url parsing errors when checking for preloaded plugins

Bug: Issue 9486
Change-Id: I24a99801fc291e96cee9b2bafffa98e8a045caba
This commit is contained in:
Viktar Donich
2018-07-26 10:33:11 -07:00
parent 79972960f1
commit 8948ca6ceb
3 changed files with 15 additions and 6 deletions

View File

@@ -412,6 +412,14 @@ limitations under the License.
element.EventType.ADMIN_MENU_LINKS);
});
test('Gerrit._isPluginPreloaded', () => {
Gerrit._preloadedPlugins = {baz: ()=>{}};
assert.isFalse(Gerrit._isPluginPreloaded('plugins/foo/bar'));
assert.isFalse(Gerrit._isPluginPreloaded('http://a.com/42'));
assert.isTrue(Gerrit._isPluginPreloaded('preloaded:baz'));
Gerrit._preloadedPlugins = null;
});
test('preloaded plugins are installed', () => {
const installStub = sandbox.stub();
Gerrit._preloadedPlugins = {foo: installStub};