Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/timer-throttling-out-of-view-cross-origin-page.html

Issue 2468863002: scheduler: Re-enable timer throttling for hidden frames (Closed)
Patch Set: Rebased Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/dom/timer-throttling-out-of-view-cross-origin-page.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/timer-throttling-out-of-view-cross-origin-page.html b/third_party/WebKit/LayoutTests/fast/dom/timer-throttling-out-of-view-cross-origin-page.html
new file mode 100644
index 0000000000000000000000000000000000000000..137d52dc52d7b3e5a06d5906eb936da334263c7a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/dom/timer-throttling-out-of-view-cross-origin-page.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<style>
+#frame {
+ position: absolute;
+ top: -1000px;
+}
+</style>
+
+<iframe id="frame" sandbox="allow-scripts" src="resources/timer-throttling-frame.html"></iframe>
+
+<script>
+if (window.testRunner)
+ testRunner.dumpAsText();
+let throttlingTest = async_test("Test timer throttling in out-of-view cross origin frames");
+
+addEventListener('load', () => {
+ // Throttling only happens after the first layout, so start the test after
+ // that.
+ requestAnimationFrame(() => {
+ var frame = document.querySelector('#frame');
+ frame.contentWindow.postMessage(null, '*');
+ });
+});
+
+addEventListener('message', (e) => {
+ let timerDelay = e.data;
+ assert_greater_than(timerDelay, 900, "Timer interval")
+ throttlingTest.done();
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698