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

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/resources/geometry-interfaces-test-helpers.js

Issue 2611713002: Rewrite the layout test for DOMRect interface. (Closed)
Patch Set: Rewrite the layout test for DOMRect interface. 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 | « third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-rect-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/dom/resources/geometry-interfaces-test-helpers.js
diff --git a/third_party/WebKit/LayoutTests/fast/dom/resources/geometry-interfaces-test-helpers.js b/third_party/WebKit/LayoutTests/fast/dom/resources/geometry-interfaces-test-helpers.js
index 7665b4d97dddf4c1ee2c5b32e2593f7b4294a850..440a07442ac6551820e25cef32d80fa72c3bce16 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/resources/geometry-interfaces-test-helpers.js
+++ b/third_party/WebKit/LayoutTests/fast/dom/resources/geometry-interfaces-test-helpers.js
@@ -80,4 +80,30 @@ function assert_dom_point_equals(actual, expected) {
} else {
assert_unreached();
}
+}
+
+function assert_dom_rect_equals(actual, expected) {
+ assert_true(actual instanceof DOMRectReadOnly);
+ if(Array.isArray(expected)) {
+ assert_equals(expected.length, 8);
+ assert_equals(actual.x, expected[0], "rect equality: x differs");
+ assert_equals(actual.y, expected[1], "rect equality: y differs");
+ assert_equals(actual.width, expected[2], "rect equality: width differs");
+ assert_equals(actual.height, expected[3], "rect equality: height differs");
+ assert_equals(actual.top, expected[4], "rect equality: top differs");
+ assert_equals(actual.right, expected[5], "rect equality: right differs");
+ assert_equals(actual.bottom, expected[6], "rect equality: bottom differs");
+ assert_equals(actual.left, expected[7], "rect equality: left differs");
+ } else if(expected instanceof DOMRectReadOnly) {
+ assert_equals(actual.x, expected.x, "rect equality: x differs");
+ assert_equals(actual.y, expected.y, "rect equality: y differs");
+ assert_equals(actual.width, expected.width, "rect equality: width differs");
+ assert_equals(actual.height, expected.height, "rect equality: height differs");
+ assert_equals(actual.top, expected.top, "rect equality: top differs");
+ assert_equals(actual.right, expected.right, "rect equality: right differs");
+ assert_equals(actual.bottom, expected.bottom, "rect equality: bottom differs");
+ assert_equals(actual.left, expected.left, "poirectnt equality: left differs");
+ } else {
+ assert_unreached();
+ }
}
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/dom/geometry-interfaces-dom-rect-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698