| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <body> | |
| 4 <script src="../resources/js-test.js"></script> | |
| 5 <script> | |
| 6 description('Tests that the lux value is rounded to avoid fingerprinting risk.')
; | |
| 7 | |
| 8 var mockLightFullPrecision = 10.123456789; | |
| 9 var mockLightRounded = 10; | |
| 10 | |
| 11 if (window.testRunner) | |
| 12 testRunner.setMockDeviceLight(mockLightFullPrecision); | |
| 13 else | |
| 14 debug('This test can not be run without the TestRunner'); | |
| 15 | |
| 16 var deviceLightEvent; | |
| 17 function checkLight(event) { | |
| 18 deviceLightEvent = event; | |
| 19 shouldBe('deviceLightEvent.value', 'mockLightRounded'); | |
| 20 } | |
| 21 | |
| 22 function listener(event) { | |
| 23 checkLight(event); | |
| 24 finishJSTest(); | |
| 25 } | |
| 26 | |
| 27 window.addEventListener('devicelight', listener); | |
| 28 window.jsTestIsAsync = true; | |
| 29 </script> | |
| 30 </body> | |
| 31 </html> | |
| OLD | NEW |