Chromium Code Reviews| Index: LayoutTests/wake_lock/wakelock-in-nested-frame.html |
| diff --git a/LayoutTests/wake_lock/wakelock-in-nested-frame.html b/LayoutTests/wake_lock/wakelock-in-nested-frame.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..dd765f366c6674a720cc593a34399b0b04b69f89 |
| --- /dev/null |
| +++ b/LayoutTests/wake_lock/wakelock-in-nested-frame.html |
| @@ -0,0 +1,39 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<body> |
| +<script src="../resources/js-test.js"></script> |
|
mlamouri (slow - plz ping)
2015/04/28 08:00:25
Please use test-harness.js
|
| +<script> |
| +description("Test WakeLock API in a nested context."); |
| + |
| +if (!window.testRunner) |
| + debug('This test cannot be run without the TestRunner'); |
| + |
| +gc(); |
| +jsTestIsAsync = true; |
| + |
| +function callback(nestedDocument) { |
| + if (nestedDocument.keepScreenAwake != false) |
| + testFailed("On start keepScreenAwake should be false"); |
| + debug('keepScreenAwake should be initialized to false in the nested context'); |
| + nestedDocument.keepScreenAwake = true; |
| + if (nestedDocument.keepScreenAwake != true) |
| + testFailed("keepScreenAwake should be save value"); |
| + debug('keepScreenAwake save value in the nested context'); |
| + setTimeout(finishJSTest, 0); |
| +} |
| + |
| +// called from the nested context when it's loaded |
| +function startTest(nested) { |
| + nested.runTest(callback); |
| +} |
| +// set keepScreenAwake to true in main frame |
| +document.keepScreenAwake = true; |
| + |
| +// Load the nested document |
| +var iframe = document.createElement("iframe"); |
| +document.body.appendChild(iframe); |
| +iframe.src = "resources/nested-frame.html"; |
| + |
| +</script> |
| +</body> |
| +</html> |