Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <body> | |
| 4 <script src="../resources/js-test.js"></script> | |
|
mlamouri (slow - plz ping)
2015/04/28 08:00:25
Please use test-harness.js
| |
| 5 <script> | |
| 6 description("Test WakeLock API in a nested context."); | |
| 7 | |
| 8 if (!window.testRunner) | |
| 9 debug('This test cannot be run without the TestRunner'); | |
| 10 | |
| 11 gc(); | |
| 12 jsTestIsAsync = true; | |
| 13 | |
| 14 function callback(nestedDocument) { | |
| 15 if (nestedDocument.keepScreenAwake != false) | |
| 16 testFailed("On start keepScreenAwake should be false"); | |
| 17 debug('keepScreenAwake should be initialized to false in the nested context' ); | |
| 18 nestedDocument.keepScreenAwake = true; | |
| 19 if (nestedDocument.keepScreenAwake != true) | |
| 20 testFailed("keepScreenAwake should be save value"); | |
| 21 debug('keepScreenAwake save value in the nested context'); | |
| 22 setTimeout(finishJSTest, 0); | |
| 23 } | |
| 24 | |
| 25 // called from the nested context when it's loaded | |
| 26 function startTest(nested) { | |
| 27 nested.runTest(callback); | |
| 28 } | |
| 29 // set keepScreenAwake to true in main frame | |
| 30 document.keepScreenAwake = true; | |
| 31 | |
| 32 // Load the nested document | |
| 33 var iframe = document.createElement("iframe"); | |
| 34 document.body.appendChild(iframe); | |
| 35 iframe.src = "resources/nested-frame.html"; | |
| 36 | |
| 37 </script> | |
| 38 </body> | |
| 39 </html> | |
| OLD | NEW |