|
168 | 168 | // Keep the tests independent by resetting the internal cache. |
169 | 169 | resetRequestsCache(app); |
170 | 170 |
|
171 | | - app.addEventListener('app-resources-loaded', function() { |
| 171 | + app.addEventListener('app-localize-resources-loaded', function() { |
172 | 172 | assert.equal(app.language, 'en'); |
173 | 173 | assert.equal(app.$.output.innerHTML, 'hello'); |
174 | 174 |
|
|
188 | 188 | // Keep the tests independent by resetting the internal cache. |
189 | 189 | resetRequestsCache(app); |
190 | 190 |
|
191 | | - app.addEventListener('app-resources-loaded', function() { |
| 191 | + app.addEventListener('app-localize-resources-loaded', function() { |
192 | 192 | assert.equal(app.language, 'en'); |
193 | 193 | assert.equal(app.$.output.innerHTML, 'my name is batman. i have 3 cats.'); |
194 | 194 |
|
|
210 | 210 | resetRequestsCache(app1); |
211 | 211 | resetRequestsCache(app2); |
212 | 212 |
|
213 | | - app1.addEventListener('app-resources-loaded', function() { |
| 213 | + app1.addEventListener('app-localize-resources-loaded', function() { |
214 | 214 | assert.equal(app1.language, 'en'); |
215 | 215 | assert.equal(app2.language, 'en'); |
216 | 216 | assert.equal(app1.localize('greeting'), 'hello'); |
|
250 | 250 | assert.equal(0, Object.keys(getRequestsCache(app3)).length); |
251 | 251 |
|
252 | 252 | // Once the first file has been loaded, it should be the only thing in the cache. |
253 | | - app1.addEventListener('app-resources-loaded', function() { |
| 253 | + app1.addEventListener('app-localize-resources-loaded', function() { |
254 | 254 | assert.equal(1, Object.keys(getRequestsCache(app1)).length, 'there is 1 request cached in app1'); |
255 | 255 | assert.equal(1, Object.keys(getRequestsCache(app2)).length, 'there is 1 request cached in app2'); |
256 | 256 | assert.equal(1, Object.keys(getRequestsCache(app3)).length, 'there is 1 request cached in app3'); |
|
260 | 260 | assert.equal(app1.resources['fr']['greeting'], 'bonjour'); |
261 | 261 |
|
262 | 262 | // Loading the second file should not make an iron-ajax request, and re-use the one in the cache. |
263 | | - app2.addEventListener('app-resources-loaded', function() { |
| 263 | + app2.addEventListener('app-localize-resources-loaded', function() { |
264 | 264 | assert.equal(1, Object.keys(getRequestsCache(app1)).length, 'there is 1 request cached in app1'); |
265 | 265 | assert.equal(1, Object.keys(getRequestsCache(app2)).length, 'there is 1 request cached in app2'); |
266 | 266 | assert.equal(1, Object.keys(getRequestsCache(app3)).length, 'there is 1 request cached in app3'); |
|
270 | 270 | assert.equal(app2.resources['fr']['greeting'], 'bonjour'); |
271 | 271 |
|
272 | 272 | // Loading the third file should not make an iron-ajax request, and re-use the one in the cache. |
273 | | - app3.addEventListener('app-resources-loaded', function() { |
| 273 | + app3.addEventListener('app-localize-resources-loaded', function() { |
274 | 274 | assert.equal(1, Object.keys(getRequestsCache(app1)).length, 'there is 1 request cached in app1'); |
275 | 275 | assert.equal(1, Object.keys(getRequestsCache(app2)).length, 'there is 1 request cached in app2'); |
276 | 276 | assert.equal(1, Object.keys(getRequestsCache(app3)).length, 'there is 1 request cached in app3'); |
|
305 | 305 | var path2 = app1.resolveUrl('locales2.json'); |
306 | 306 |
|
307 | 307 | // Once the first file has been loaded, it should be the only thing in the cache. |
308 | | - app1.addEventListener('app-resources-loaded', function() { |
| 308 | + app1.addEventListener('app-localize-resources-loaded', function() { |
309 | 309 | assert.equal(1, Object.keys(getRequestsCache(app1)).length, 'there is 1 request cached in app1'); |
310 | 310 | assert.equal(1, Object.keys(getRequestsCache(app2)).length, 'there is 1 request cached in app2'); |
311 | 311 |
|
|
314 | 314 | assert.equal(app1.resources['fr']['greeting'], 'bonjour'); |
315 | 315 |
|
316 | 316 | // Loading a different file should make a different ajax request. |
317 | | - app2.addEventListener('app-resources-loaded', function() { |
| 317 | + app2.addEventListener('app-localize-resources-loaded', function() { |
318 | 318 | assert.equal(2, Object.keys(getRequestsCache(app1)).length, 'there are 2 requests cached in app1'); |
319 | 319 | assert.equal(2, Object.keys(getRequestsCache(app2)).length, 'there are 2 requests cached in app2'); |
320 | 320 |
|
|
0 commit comments