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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/geometry-interface-dom-quad.html

Issue 2638413005: [GeometryInterface] add fromQuad function in DOMQuad. (Closed)
Patch Set: [WIP] formQuad 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/dom/geometry-interface-dom-quad.html
diff --git a/third_party/WebKit/LayoutTests/fast/dom/geometry-interface-dom-quad.html b/third_party/WebKit/LayoutTests/fast/dom/geometry-interface-dom-quad.html
index 4ab3e500f9e6d81e83997acfe9275911cc4a8200..7cf37815962694d075863945f5a6d2470fd3aa27 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/geometry-interface-dom-quad.html
+++ b/third_party/WebKit/LayoutTests/fast/dom/geometry-interface-dom-quad.html
@@ -8,7 +8,7 @@ test(() => {
var p2 = new DOMPoint(5, 6, 7, 8);
var p3 = new DOMPoint(9, 10, 11, 12);
var p4 = new DOMPoint(13, 14, 15, 16);
- var quad = new DOMQuad(p1, p2, p3, p4);
+ var quad = new DOMQuad(p1, p2, p3, p4);
assert_dom_point_equals(quad.p1, p1);
assert_dom_point_equals(quad.p2, p2);
assert_dom_point_equals(quad.p3, p3);
@@ -32,11 +32,38 @@ test(() => {
var expect_p2 = new DOMPoint(90, 20, 0, 1);
var expect_p3 = new DOMPoint(90, 70, 0, 1);
var expect_p4 = new DOMPoint(10, 70, 0, 1);
- var quad = DOMQuad.fromRect({x: 10, y: 20, width: 80, height: 50});
+ var quad = DOMQuad.fromRect({x: 10, y: 20, width: 80, height: 50});
assert_dom_point_equals(quad.p1, expect_p1, "p1");
assert_dom_point_equals(quad.p2, expect_p2, "p2");
assert_dom_point_equals(quad.p3, expect_p3, "p3");
assert_dom_point_equals(quad.p4, expect_p4, "p4");
}, "DOMQuad() fromRect");
+test(() => {
+ var expect_p1 = new DOMPoint(0, 1, 2, 3);
+ var expect_p2 = new DOMPoint(4, 5, 6, 7);
+ var expect_p3 = new DOMPoint(8, 9, 10, 11);
+ var expect_p4 = new DOMPoint(12, 13, 14, 15);
+ var quad = DOMQuad.fromQuad({p1: {x: 0, y: 1, z: 2, w: 3},
+ p2: {x: 4, y: 5, z: 6, w: 7},
+ p3: {x: 8, y: 9, z: 10, w: 11},
+ p4: {x: 12, y: 13, z: 14, w: 15}});
+ assert_dom_point_equals(quad.p1, expect_p1, "p1");
+ assert_dom_point_equals(quad.p2, expect_p2, "p2");
+ assert_dom_point_equals(quad.p3, expect_p3, "p3");
+ assert_dom_point_equals(quad.p4, expect_p4, "p4");
+}, "DOMQuad() fromQuad");
+
+test(() => {
+ var expect_p1 = new DOMPoint(0, 0, 0, 1);
+ var expect_p2 = new DOMPoint(0, 0, 0, 1);
+ var expect_p3 = new DOMPoint(0, 0, 0, 1);
+ var expect_p4 = new DOMPoint(0, 0, 0, 1);
+ var quad = DOMQuad.fromQuad({});
+ assert_dom_point_equals(quad.p1, expect_p1, "p1");
+ assert_dom_point_equals(quad.p2, expect_p2, "p2");
+ assert_dom_point_equals(quad.p3, expect_p3, "p3");
+ assert_dom_point_equals(quad.p4, expect_p4, "p4");
+}, "DOMQuad() fromQuad - parameter of fromQuad function does not have any point.");
+
</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698