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

Unified Diff: third_party/WebKit/LayoutTests/typedcssom/cssCalcLength.html

Issue 2867883003: [CSS Typed OM] Delete obsolete number and length classes from Typed OM (Closed)
Patch Set: rebase Created 3 years, 7 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
Index: third_party/WebKit/LayoutTests/typedcssom/cssCalcLength.html
diff --git a/third_party/WebKit/LayoutTests/typedcssom/cssCalcLength.html b/third_party/WebKit/LayoutTests/typedcssom/cssCalcLength.html
deleted file mode 100644
index 5a66c02799766df34226d8442427383e308d18b7..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/typedcssom/cssCalcLength.html
+++ /dev/null
@@ -1,81 +0,0 @@
-<!DOCTYPE html>
-<script src='../resources/testharness.js'></script>
-<script src='../resources/testharnessreport.js'></script>
-
-<script>
-test(function() {
- assert_throws(null, function() { new CSSCalcLength(); });
- assert_throws(null, function() { new CSSCalcLength({}); });
- assert_throws(null, function() { new CSSCalcLength({foo: 1}); });
-}, 'Passing invalid arguments to CSSCalcLength throws an exception.');
-
-test(function() {
- var calcLength1 = new CSSCalcLength({px: 1, percent: 2.2});
- var calcLength2 = new CSSCalcLength({px: 3, percent: 4.3});
-
- var result = calcLength1.add(calcLength2);
-
- assert_not_equals(calcLength1, result);
- assert_not_equals(calcLength2, result);
- assert_equals(result.constructor.name, CSSCalcLength.name);
- assert_equals(result.px, 4);
- assert_equals(result.percent, 6.5);
-}, 'Adding two CSSCalcLengths produces a new CSSCalcLength with the correct value.');
-
-test(function() {
- var calcLength1 = new CSSCalcLength({px: 1, percent: 2.2});
- var calcLength2 = new CSSCalcLength({px: 3, percent: 4.3});
-
- var result = calcLength1.subtract(calcLength2);
-
- assert_not_equals(calcLength1, result);
- assert_not_equals(calcLength2, result);
- assert_equals(result.constructor.name, CSSCalcLength.name);
- assert_equals(result.px, -2);
- assert_approx_equals(result.percent, -2.1, 0.000001);
-}, 'Subtracting two CSSCalcLengths produces a new CSSCalcLength with the correct values.');
-
-test(function() {
- var calcLength = new CSSCalcLength({px: 1, percent: 5.2});
- var result = calcLength.multiply(3);
-
- assert_not_equals(calcLength, result);
- assert_equals(result.px, 3);
- assert_approx_equals(result.percent, 15.6, 0.000001);
-}, 'Multiplying a CSSCalcLength produces a new CSSCalcLength with the correct values.');
-
-test(function() {
- var calcLength = new CSSCalcLength({px: 3, percent: 15.6});
- var result = calcLength.divide(3);
-
- assert_not_equals(calcLength, result);
- assert_equals(result.px, 1);
- assert_equals(result.percent, 5.2);
-}, 'Dividing a CSSCalcLength produces a new CSSCalcLength with the correct values.');
-
-test(function() {
- var calcLength = new CSSCalcLength({px: 4, percent: 1});
- assert_throws(new RangeError(), function() { calcLength.divide(0); });
-}, 'Dividing by zero throws a RangeError');
-
-test(function() {
- var values = [
- {input: new CSSCalcLength({px: 1}), cssText: 'calc(1px)'},
- {input: new CSSCalcLength({px: -1}), cssText: 'calc(-1px)'},
- {input: new CSSCalcLength({px: 1, percent: 15.6}), cssText: 'calc(15.6% + 1px)'},
- {input: new CSSCalcLength({px: 1, percent: -15.6}), cssText: 'calc(-15.6% + 1px)'},
- {input: new CSSCalcLength({px: -1, percent: -15.6}), cssText: 'calc(-15.6% - 1px)'},
- {input: new CSSCalcLength({px: -1, percent: -15.6, vw: 5}), cssText: 'calc((-15.6% - 1px) + 5vw)'},
- {input: new CSSCalcLength({px: -1, percent: -15.6, vw: -5}), cssText: 'calc((-15.6% - 1px) - 5vw)'},
- ];
-
- for (var i = 0; i < values.length; ++i) {
- assert_equals(values[i].input.cssText, values[i].cssText);
- }
-
-}, 'cssText produces the correct string');
-
-</script>
-
-<body>
-</body>

Powered by Google App Engine
This is Rietveld 408576698