Merge "Fix plugin counting for plugins with multiple UI plugins"
This commit is contained in:
		@@ -33,7 +33,7 @@ limitations under the License.
 | 
			
		||||
</test-fixture>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
  suite('gr-diff tests', () => {
 | 
			
		||||
  suite('gr-plugin-host tests', () => {
 | 
			
		||||
    let element;
 | 
			
		||||
    let sandbox;
 | 
			
		||||
    let url;
 | 
			
		||||
@@ -54,8 +54,8 @@ limitations under the License.
 | 
			
		||||
      sandbox.stub(Gerrit, '_setPluginsCount');
 | 
			
		||||
      element.config = {
 | 
			
		||||
        plugin: {
 | 
			
		||||
          html_resource_paths: ['foo/bar', 'baz'],
 | 
			
		||||
          js_resource_paths: ['42'],
 | 
			
		||||
          html_resource_paths: ['plugins/foo/bar', 'plugins/baz'],
 | 
			
		||||
          js_resource_paths: ['plugins/42'],
 | 
			
		||||
        },
 | 
			
		||||
      };
 | 
			
		||||
      assert.isTrue(Gerrit._setPluginsCount.calledWith(3));
 | 
			
		||||
 
 | 
			
		||||
@@ -351,6 +351,15 @@ limitations under the License.
 | 
			
		||||
      return Gerrit.awaitPluginsLoaded();
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    test('multiple ui plugins per java plugin', () => {
 | 
			
		||||
      const file1 = 'http://test.com/plugins/qaz/static/foo.nocache.js';
 | 
			
		||||
      const file2 = 'http://test.com/plugins/qaz/static/bar.js';
 | 
			
		||||
      Gerrit._setPluginsPending([file1, file2]);
 | 
			
		||||
      Gerrit.install(() => {}, '0.1', file1);
 | 
			
		||||
      Gerrit.install(() => {}, '0.1', file2);
 | 
			
		||||
      return Gerrit.awaitPluginsLoaded();
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    test('plugin install errors shows toasts', () => {
 | 
			
		||||
      const alertStub = sandbox.stub();
 | 
			
		||||
      document.addEventListener('show-alert', alertStub);
 | 
			
		||||
 
 | 
			
		||||
@@ -561,7 +561,7 @@
 | 
			
		||||
      o[getPluginNameFromUrl(url)] = url;
 | 
			
		||||
      return o;
 | 
			
		||||
    }, {});
 | 
			
		||||
    Gerrit._setPluginsCount(plugins.length);
 | 
			
		||||
    Gerrit._setPluginsCount(Object.keys(_pluginsPending).length);
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  Gerrit._setPluginsCount = function(count) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user