Load plugins JS resources upon initial page rendering

Bug: Issue 3915
Change-Id: Ic2d1d96458ecb2cd09dcd1cd204f8a06f234dbb7
diff --git a/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-js-api-interface_test.html b/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-js-api-interface_test.html
index 2fede7c..1a6413f 100644
--- a/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-js-api-interface_test.html
+++ b/polygerrit-ui/app/elements/shared/gr-js-api-interface/gr-js-api-interface_test.html
@@ -35,7 +35,8 @@
 
     setup(function() {
       element = fixture('basic');
-      Gerrit.install(function(p) { plugin = p; });
+      Gerrit.install(function(p) { plugin = p; },
+          'http://test.com/plugins/testplugin/static/test.js');
     });
 
     teardown(function() {
@@ -43,6 +44,12 @@
       plugin = null;
     });
 
+    test('url', function() {
+      assert.equal(plugin.url(), 'http://test.com/plugins/testplugin/');
+      assert.equal(plugin.url('/static/test.js'),
+          'http://test.com/plugins/testplugin/static/test.js');
+    });
+
     test('history event', function(done) {
       plugin.on(element.EventType.HISTORY, function(path) {
         assert.equal(path, '/path/to/awesomesauce');
@@ -56,8 +63,8 @@
       var testChange = {
         _number: 42,
         revisions: {
-          def: { _number: 2 },
-          abc: { _number: 1 },
+          def: {_number: 2},
+          abc: {_number: 1},
         },
       };
       plugin.on(element.EventType.SHOW_CHANGE, function(change, revision) {