| OLD | NEW |
| 1 (function() | 1 (function() |
| 2 { | 2 { |
| 3 let testRunner = null; | 3 let testRunner = null; |
| 4 let randomResult = 0.5; | 4 let randomResult = 0.5; |
| 5 | 5 |
| 6 let originalInfo; | 6 let originalInfo; |
| 7 let info = require("info"); | 7 let info = require("info"); |
| 8 | 8 |
| 9 module("Notification handling", | 9 module("Notification handling", |
| 10 { | 10 { |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 let responseText = JSON.stringify({ | 341 let responseText = JSON.stringify({ |
| 342 notifications: [severityNotification] | 342 notifications: [severityNotification] |
| 343 }); | 343 }); |
| 344 Notification._onDownloadSuccess({}, responseText, function() {}, function()
{}); | 344 Notification._onDownloadSuccess({}, responseText, function() {}, function()
{}); |
| 345 }); | 345 }); |
| 346 | 346 |
| 347 test("URL-specific notification", function() | 347 test("URL-specific notification", function() |
| 348 { | 348 { |
| 349 let withURLFilterFoo = fixConstructors({ | 349 let withURLFilterFoo = fixConstructors({ |
| 350 id: 1, | 350 id: 1, |
| 351 urlFilters: ["foo.com"] | 351 urlFilters: ["foo.com$document"] |
| 352 }); | 352 }); |
| 353 let withoutURLFilter = fixConstructors({ | 353 let withoutURLFilter = fixConstructors({ |
| 354 id: 2 | 354 id: 2 |
| 355 }); | 355 }); |
| 356 let withURLFilterBar = fixConstructors({ | 356 let withURLFilterBar = fixConstructors({ |
| 357 id: 3, | 357 id: 3, |
| 358 urlFilters: ["bar.com"] | 358 urlFilters: ["bar.com$document"] |
| 359 }); | 359 }); |
| 360 let subdomainURLFilter = fixConstructors({ | 360 let subdomainURLFilter = fixConstructors({ |
| 361 id: 4, | 361 id: 4, |
| 362 urlFilters: ["||example.com"] | 362 urlFilters: ["||example.com$document"] |
| 363 }); | 363 }); |
| 364 | 364 |
| 365 registerHandler([ | 365 registerHandler([ |
| 366 withURLFilterFoo, | 366 withURLFilterFoo, |
| 367 withoutURLFilter, | 367 withoutURLFilter, |
| 368 withURLFilterBar, | 368 withURLFilterBar, |
| 369 subdomainURLFilter | 369 subdomainURLFilter |
| 370 ]); | 370 ]); |
| 371 testRunner.runScheduledTasks(1); | 371 testRunner.runScheduledTasks(1); |
| 372 | 372 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 403 equal(texts.message, "fr"); | 403 equal(texts.message, "fr"); |
| 404 }); | 404 }); |
| 405 | 405 |
| 406 test("Missing translation", function() | 406 test("Missing translation", function() |
| 407 { | 407 { |
| 408 let notification = {message: {"en-US": "en-US"}}; | 408 let notification = {message: {"en-US": "en-US"}}; |
| 409 let texts = Notification.getLocalizedTexts(notification, "fr"); | 409 let texts = Notification.getLocalizedTexts(notification, "fr"); |
| 410 equal(texts.message, "en-US"); | 410 equal(texts.message, "en-US"); |
| 411 }); | 411 }); |
| 412 })(); | 412 })(); |
| OLD | NEW |