Revision d69705f5a534514e324ea8843417d4ced1b6a951 authored by Darren Shen on 14 March 2018, 04:38:38 UTC, committed by Blink WPT Bot on 14 March 2018, 04:47:19 UTC
This patch adds support for scroll-margin-* and adds relevant tests.

Spec: https://drafts.csswg.org/css-scroll-snap-1/#margin-longhands-physical

Bug: 820299
Change-Id: I46f8482c88c237de2a9d263b3a334ac9c03f4fca
Reviewed-on: https://chromium-review.googlesource.com/958755
Reviewed-by: nainar <nainar@chromium.org>
Commit-Queue: Darren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543004}
1 parent a0a4cfa
Raw File
cancel-watch-availability.html
<!DOCTYPE html>
<html>
<title>Tests various ways to call cancelWatchAvailability()</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/media.js"></script>
<script>
async_test(t => {
  var v = document.createElement('video');
  v.src = getVideoURI('movie_5');

  v.remote.watchAvailability(function() {})
    .then(t.step_func(id => {
      v.remote.cancelWatchAvailability(id).then(t.step_func(function() {
        v.remote.cancelWatchAvailability(id).then(
          t.unreached_func(), t.step_func_done(e => {
            assert_equals(e.name, 'NotFoundError');
          })
        );
      }), t.unreached_func());
    }), t.unreached_func());
}, 'Test that calling cancelWatchAvailability() with an id does remove the callback.');

async_test(t => {
  var v = document.createElement('video');
  v.src = getVideoURI('movie_5');

  Promise.all([
      v.remote.watchAvailability(function() {}),
      v.remote.watchAvailability(function() {})
  ]).then(t.step_func(ids => {
    v.remote.cancelWatchAvailability().then(t.step_func(function() {
      v.remote.cancelWatchAvailability(ids[0]).then(t.unreached_func(), t.step_func(function(e) {
        assert_equals(e.name, 'NotFoundError');
        v.remote.cancelWatchAvailability(ids[1])
          .then(t.unreached_func(), t.step_func_done(function(e) {
            assert_equals(e.name, 'NotFoundError');
          }));
      }));
    }), t.unreached_func());
  }), t.unreached_func());
}, 'Test that calling cancelWatchAvailability() without an id removes all the callbacks.');
</script>
</html>
back to top