https://github.com/web-platform-tests/wpt
Revision 8ec345bcd24282ce94960fc0b11ca057bec393be authored by Ian Kilpatrick on 27 March 2018, 05:07:50 UTC, committed by Blink WPT Bot on 27 March 2018, 05:15:10 UTC
This implements the LayoutFragment.inlineOffset and
LayoutFragment.blockOffset attributes.

The tests added simply re-create the reference by setting these two
attributes in different text directions and writing modes.

Change-Id: I1865403ca12e3b174738ee93320eae5ba16ac292
Bug: 726125
Reviewed-on: https://chromium-review.googlesource.com/971832
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Reviewed-by: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/master@{#546018}
1 parent c32afde
Raw File
Tip revision: 8ec345bcd24282ce94960fc0b11ca057bec393be authored by Ian Kilpatrick on 27 March 2018, 05:07:50 UTC
[css-layout-api] Allow developers to position fragments.
Tip revision: 8ec345b
payment-request-id-attribute.https.html
<!DOCTYPE html>
<!-- Copyright © 2017 Chromium authors and World Wide Web Consortium, (Massachusetts Institute of Technology, ERCIM, Keio University, Beihang). -->
<meta charset="utf-8">
<title>Test for PaymentRequest id attribute</title>
<link rel="help" href="https://w3c.github.io/payment-request/#constructor">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
const methods = [{ supportedMethods: "foo" }];
const total = { label: "label", amount: { currency: "USD", value: "5.00" } };

test(() => {
  const request1 = new PaymentRequest(methods, {
    id: "pass",
    total,
  });
  assert_idl_attribute(request1, "id");
  assert_equals(request1.id, "pass", "Expected PaymentRequest.id to be 'pass'");
}, "PaymentRequest's id attribute's value can be set via PaymentDetailsInit dictionary");

// Test for https://github.com/w3c/payment-request/pull/665
test(() => {
  const uuidRegExp = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-4][0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
  const request1 = new PaymentRequest(methods, {
    total,
  });
  const request2 = new PaymentRequest(methods, {
    total,
  });
  assert_true(
    uuidRegExp.test(request1.id) && uuidRegExp.test(request2.id) ,
    "Expected PaymentRequest.id be a UUID"
  );
  assert_not_equals(
    request1.id, request2.id,
    "Expected PaymentRequest.id be unique per instance"
  );
}, "PaymentRequest's id attribute must be a UUID when PaymentDetailsInit.id is missing");
</script>
back to top