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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/timer-throttling-hidden-page.html

Issue 2620743002: Don't throttle web views until they've been in the background for 10s (Closed)
Patch Set: Remove tricky to fix but redundant layout test Created 3 years, 11 months 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-hidden-page.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/timer-throttling-hidden-page.html b/third_party/WebKit/LayoutTests/fast/dom/timer-throttling-hidden-page.html
deleted file mode 100644
index 7b652ff1f1e024dae9540c7615c7db3eddd4ca47..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/fast/dom/timer-throttling-hidden-page.html
+++ /dev/null
@@ -1,84 +0,0 @@
-<html>
-<head>
- <script src="../../resources/js-test.js"></script>
- <script>
- description('<a href="https://bugs.webkit.org/show_bug.cgi?id=98474">Bug 98474</a>: Throttle DOM timers on hidden pages and <a href="http://crbug.com/400343">bug 400343</a> prerender pages.');
-
- var jsTestIsAsync = true;
- var previousTime = 0;
- var timerCount = 0;
- var firstTimerWhileNotVisible = true;
- var isPageVisible = true;
- var timeoutInterval = 100;
- var tolerance = 20;
- var timerAlignmentInterval = 1000;
-
- function testTimer()
- {
- var time = Date.now();
- if (!isPageVisible) {
- if (firstTimerWhileNotVisible) {
- firstTimerIntervalWhilePageNotVisible = time - previousTime;
- var minValue = timeoutInterval - tolerance;
- shouldBeGreaterThanOrEqual("firstTimerIntervalWhilePageNotVisible", minValue.toString());
- var maxValue = timeoutInterval + timerAlignmentInterval + tolerance;
- shouldBeTrue("firstTimerIntervalWhilePageNotVisible <= " + maxValue);
- firstTimerWhileNotVisible = false;
- } else {
- timerIntervalWhilePageNotVisible = time - previousTime;
- shouldBeCloseTo("timerIntervalWhilePageNotVisible", timerAlignmentInterval, tolerance);
- }
- } else {
- timerIntervalWhilePageVisible = time - previousTime;
- shouldBeCloseTo("timerIntervalWhilePageVisible", timeoutInterval, tolerance);
- }
-
- timerCount++;
- previousTime = time;
-
- if (timerCount == 1) {
- testRunner.setPageVisibility("hidden");
- isPageVisible = false;
- } else if (timerCount == 3) {
- testRunner.setPageVisibility("visible");
- isPageVisible = true;
- } else if (timerCount == 5) {
- testRunner.setPageVisibility("prerender");
- isPageVisible = false;
- firstTimerWhileNotVisible = true;
- } else if (timerCount == 7) {
- testRunner.setPageVisibility("visible");
- isPageVisible = true;
- } else if (timerCount >= 8){
- finishJSTest();
- return;
- }
- previousTime = Date.now();
- setTimeout(testTimer, timeoutInterval);
- }
-
- function runTest()
- {
- if (!window.testRunner) {
- debug('This test requires testRunner');
- return;
- }
-
- var timeoutIntervalSpans = document.getElementsByClassName('timeoutInterval');
- for (var i = 0; i < timeoutIntervalSpans.length; i++)
- timeoutIntervalSpans[i].innerText = timeoutInterval;
-
- document.getElementById('alignmentInterval').innerText = timerAlignmentInterval / 1000;
-
- testRunner.dumpAsText();
- previousTime = Date.now();
- setTimeout(testTimer, timeoutInterval);
- }
- </script>
-</head>
-<body onload="runTest()">
- <p>
- This test measures the time taken to fire a <span class="timeoutInterval"></span>ms DOM Timer when the page visibility is set to "visible", "hidden", "visible", "prerender" and then back to "visible". Due to page timer throttling, the timer should fire close to <span id="alignmentInterval"></span>s when page is hidden or prerender. And it should fire close to <span class="timeoutInterval"></span>ms, when the page is visible.
- </p>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698