Commit 7781b4c2 authored by Carlos Knippschild's avatar Carlos Knippschild Committed by Commit Bot

Revert "[idle] Assert idle detection works when page is not visible."

This reverts commit f82422b1.

Reason for revert: added test is failing on some Windows bots

Original change's description:
> [idle] Assert idle detection works when page is not visible.
> 
> Change-Id: I8227667c915f19a5e4d4e34b035846b78de1ac41
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1532476
> Commit-Queue: Sam Goto <goto@chromium.org>
> Reviewed-by: Reilly Grant <reillyg@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#642661}

TBR=reillyg@chromium.org,goto@chromium.org

Change-Id: I8a525830fd4a8d394871d8501fc6c78ab298edfc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 944359
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1533286Reviewed-by: default avatarCarlos Knippschild <carlosk@chromium.org>
Commit-Queue: Carlos Knippschild <carlosk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#642763}
parent 3fccf16e
<!DOCTYPE html>
<link rel="help" href="https://github.com/samuelgoto/idle-detection">
<title>Tests the Idle Detection API</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="/gen/layout_test_data/mojo/public/js/mojo_bindings.js"></script>
<script src="/gen/mojo/public/mojom/base/string16.mojom.js"></script>
<script src="/gen/mojo/public/mojom/base/time.mojom.js"></script>
<script src="/gen/third_party/blink/public/platform/modules/idle/idle_manager.mojom.js"></script>
<script src="../external/wpt/idle-detection/mock.js"></script>
<script>
'use strict';
promise_test(async t => {
let monitor;
expect(addMonitor).andReturn((threshold, monitorPtr) => {
monitor = monitorPtr;
return Promise.resolve({
state: {
user: UserIdleState.ACTIVE,
screen: ScreenIdleState.UNLOCKED
}
});
});
let detector = new IdleDetector({threshold: 10});
let watcher = new EventWatcher(t, detector, ["change"]);
await detector.start();
await watcher.wait_for("change");
assert_equals(detector.state.user, "active");
testRunner.setPageVisibility("hidden");
monitor.update({
user: UserIdleState.IDLE,
screen: ScreenIdleState.UNLOCKED
});
// Assert that the detector works while the page is not visible.
await watcher.wait_for("change");
assert_equals(detector.state.user, "idle");
testRunner.setPageVisibility("visible");
monitor.update({
user: UserIdleState.ACTIVE,
screen: ScreenIdleState.UNLOCKED
});
await watcher.wait_for("change");
assert_equals(detector.state.user, "active");
detector.stop();
}, 'Page visibility.');
</script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment