Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <body> | |
| 4 <script src="../resources/testharness.js"></script> | |
| 5 <script src="../resources/testharnessreport.js"></script> | |
| 6 <script> | |
| 7 | |
| 8 test(function() { | |
| 9 assert_true('keepScreenAwake' in window.document); | |
|
mlamouri (slow - plz ping)
2015/04/28 08:00:25
There are methods that are meant to check if somet
| |
| 10 assert_true(typeof document.keepScreenAwake !== 'undefined'); | |
| 11 assert_true(typeof document.keepScreenAwake === 'boolean'); | |
|
mlamouri (slow - plz ping)
2015/04/28 08:00:25
No need to test !== undefined and === boolean.
| |
| 12 assert_equals(typeof document.keepScreenAwake, 'boolean'); | |
| 13 }, 'Test that the WakeLock API is present.') | |
| 14 | |
| 15 test(function() { | |
| 16 var caught = false; | |
| 17 try { | |
| 18 document.keepScreenAwake = false; | |
| 19 document.keepScreenAwake = true; | |
| 20 } catch (e) { | |
| 21 caught = true; | |
| 22 } | |
| 23 | |
| 24 assert_false(caught); | |
| 25 }, 'Test that document.keepScreenAwake doesn\'t throw when set the value'); | |
|
mlamouri (slow - plz ping)
2015/04/28 08:00:25
You can remove that test. If it were to throw, the
| |
| 26 | |
| 27 test(function() { | |
| 28 document.keepScreenAwake = true; | |
| 29 assert_true(document.keepScreenAwake); | |
| 30 | |
| 31 document.keepScreenAwake = false; | |
| 32 assert_false(document.keepScreenAwake); | |
| 33 }, 'Test that document.keepScreenAwake save value'); | |
| 34 | |
| 35 </script> | |
| 36 </body> | |
| 37 </html> | |
| OLD | NEW |