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

Side by Side Diff: LayoutTests/fast/css/resources/CSSPrimitiveValue-exceptions.js

Issue 689323002: Remove tests which are only testing getPropertyCSSValue, etc. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
(Empty)
1 description("This tests that the methods on CSSPrimitiveValue throw exceptions " );
2
3 div = document.createElement('div');
4 div.style.width = "10px";
5 div.style.height = "90%";
6 div.style.content = "counter(dummy, square)";
7 div.style.clip = "rect(0, 0, 1, 1)";
8 div.style.color = "rgb(0, 0, 0)";
9
10 // Test passing invalid unit to getFloatValue
11 shouldThrow("div.style.getPropertyCSSValue('width').getFloatValue(CSSPrimitiveVa lue.CSS_UNKNOWN)");
12 shouldThrow("div.style.getPropertyCSSValue('width').getFloatValue(CSSPrimitiveVa lue.CSS_STRING)");
13
14 // Test invalid unit conversions in getFloatValue
15 shouldThrow("div.style.getPropertyCSSValue('width').getFloatValue(CSSPrimitiveVa lue.CSS_HZ)");
16 shouldThrow("div.style.getPropertyCSSValue('width').getFloatValue(CSSPrimitiveVa lue.CSS_S)");
17 shouldThrow("div.style.getPropertyCSSValue('width').getFloatValue(CSSPrimitiveVa lue.CSS_RAD)");
18 shouldThrow("div.style.getPropertyCSSValue('width').getFloatValue(CSSPrimitiveVa lue.CSS_PERCENTAGE)");
19 shouldThrow("div.style.getPropertyCSSValue('height').getFloatValue(CSSPrimitiveV alue.CSS_PX)");
20 shouldThrow("div.style.getPropertyCSSValue('height').getFloatValue(CSSPrimitiveV alue.CSS_DEG)");
21
22 // Test calling get*Value for CSSPrimitiveValue of the wrong type
23 shouldBe("div.style.getPropertyCSSValue('clip').primitiveType", "CSSPrimitiveVal ue.CSS_RECT");
24 shouldThrow("div.style.getPropertyCSSValue('clip').getFloatValue(CSSPrimitiveVal ue.CSS_PX)");
25 shouldThrow("div.style.getPropertyCSSValue('clip').getStringValue()");
26 shouldThrow("div.style.getPropertyCSSValue('clip').getCounterValue()");
27 shouldThrow("div.style.getPropertyCSSValue('clip').getRGBColorValue()");
28
29 shouldBe("div.style.getPropertyCSSValue('color').primitiveType", "CSSPrimitiveVa lue.CSS_RGBCOLOR");
30 shouldThrow("div.style.getPropertyCSSValue('color').getFloatValue(CSSPrimitiveVa lue.CSS_PX)");
31 shouldThrow("div.style.getPropertyCSSValue('color').getStringValue()");
32 shouldThrow("div.style.getPropertyCSSValue('color').getCounterValue()");
33 shouldThrow("div.style.getPropertyCSSValue('color').getRectValue()");
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/image-value-type-expected.txt ('k') | LayoutTests/fast/css/value-list-out-of-bounds-crash.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698