Bug 1318720 - Don't test if idle callbacks may execute in the same period. r=smaug
authorAndreas Farre <farre@mozilla.com>
Thu, 09 Mar 2017 17:45:27 +0100
changeset 348680 58d628a5c367c6c6f1b092988b6b3ee4054bf1f5
parent 348679 9ba17600e3c9ce1cd42eec7e95287293b7af0026
child 348681 c3caab4cb674f15d9138fe4817ab940ffc843f56
push id31533
push userkwierso@gmail.com
push dateTue, 21 Mar 2017 23:08:53 +0000
treeherdermozilla-central@8744e9f8eb99 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1318720
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1318720 - Don't test if idle callbacks may execute in the same period. r=smaug MozReview-Commit-ID: HKjU4R6BChT
testing/web-platform/tests/html/webappapis/idle-callbacks/callback-idle-periods.html
--- a/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-idle-periods.html
+++ b/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-idle-periods.html
@@ -1,48 +1,16 @@
 <!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 two separate calls to requestIdleCallbacks can run in the same
-  // idle period.
-  var callback_1_deadline;
-  var callback_1_has_run = false;
-  var callback_1 = function(deadline) {
-    callback_1_has_run = true;
-    var remaining = deadline.timeRemaining();
-    if (remaining >= 5) {
-      // Should be enough time to run the next callback in the current idle
-      // period.
-      callback_1_deadline = performance.now() + remaining;
-    }
-  };
-  var callback_2 = this.step_func(function(deadline) {
-    assert_true(callback_1_has_run, "Should run callbacks in order of posting if they don't have a timeout.");
-    if (callback_1_deadline != undefined) {
-      assert_true(performance.now() < callback_1_deadline, "Should be able to run both callbacks in the same idle period.");
-      this.done();
-    } else {
-      // Might not have had enough idle time, so try again.
-      callback_1_has_run = false;
-      setTimeout(function() {
-        requestIdleCallback(callback_1);
-        requestIdleCallback(callback_2);
-      }, 0);
-    }
-  });
-  requestIdleCallback(callback_1);
-  requestIdleCallback(callback_2);
-}, 'requestIdleCallback can run multiple different requestIdleCallback callbacks in the same idle period.');
-
-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;