Revision fc7af09fb3eea0ef511a061e5734c1dc8e539b0d authored by Rob Buis on 12 April 2018, 16:14:10 UTC, committed by Blink WPT Bot on 12 April 2018, 16:51:35 UTC
Fix regression allowing text value for -webkit-background-origin that
was caused by r514365.

Code change implemented by Bugs Nash, testcase by Rob Buis.

Bug: 802256

Change-Id: I11e2b1b19a374e9f6b9c1091d82882ef526bc63c
Reviewed-on: https://chromium-review.googlesource.com/1008102
Commit-Queue: Rob Buis <rob.buis@samsung.com>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550221}
1 parent 56a257e
Raw File
callback-idle-periods.html
<!DOCTYPE html>
<title>window.requestIdleCallback callback behavior during idle periods.</title>
<link rel="author" title="Ross McIlroy" href="mailto:rmcilroy@chromium.org" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>

async_test(function() {
  // Check that if an idle callback calls requestIdleCallback, the new callback
  // doesn't get the same deadline (i.e., runs in a new idle period).
  var previous_deadline = undefined;
  var idle_callbacks_remaining = 10;
  var rIC = this.step_func(function(deadline) {
    var now = performance.now();
    var remaining = deadline.timeRemaining();
    var new_deadline = now + remaining;
    if (previous_deadline != undefined) {
      assert_true(new_deadline > previous_deadline, "A requestIdleCallback scheduled during an idle period should be called back with a deadline greater than that in the current idle period.");
    }

    // Schedule a new requestIdleCallback.
    if (--idle_callbacks_remaining > 0) {
      previous_deadline = new_deadline;
      requestIdleCallback(rIC);
    } else {
      this.done();
    }
  });

  // Spin an empty rAF loop to cause an idle period each frame.
  var idle_task_posted = false;
  requestAnimationFrame(function rAFLoop() {
    if (!idle_task_posted) {
      requestIdleCallback(rIC);
      idle_task_posted = true;
    }
    requestAnimationFrame(rAFLoop);
  });
}, 'Check that if an idle callback calls requestIdleCallback the new callback doesn\'t run in the current idle period.');
</script>
<h1>Test of requestIdleCallback idle period behavior</h1>
<p>This test validates that window.requestIdleCallback deals with callbacks during idle periods correctly.</p>
<div id="log"></div>
back to top