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

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

Issue 16818023: DOMException toString is not correct (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 description("This tests that the methods on CSSPrimitiveValue throw exceptions " ); 1 description("This tests that the methods on CSSPrimitiveValue throw exceptions " );
2 2
3 div = document.createElement('div'); 3 div = document.createElement('div');
4 div.style.width = "10px"; 4 div.style.width = "10px";
5 div.style.height = "90%"; 5 div.style.height = "90%";
6 div.style.content = "counter(dummy, square)"; 6 div.style.content = "counter(dummy, square)";
7 div.style.clip = "rect(0, 0, 1, 1)"; 7 div.style.clip = "rect(0, 0, 1, 1)";
8 div.style.color = "rgb(0, 0, 0)"; 8 div.style.color = "rgb(0, 0, 0)";
9 9
10 var invalidAccessError = "Error: InvalidAccessError: DOM Exception 15"; 10 var invalidAccessError = "InvalidAccessError: A parameter or an operation was no t supported by the underlying object.";
11 11
12 // Test passing invalid unit to getFloatValue 12 // Test passing invalid unit to getFloatValue
13 shouldThrow("div.style.getPropertyCSSValue('width').getFloatValue(CSSPrimitiveVa lue.CSS_UNKNOWN)", "invalidAccessError"); 13 shouldThrow("div.style.getPropertyCSSValue('width').getFloatValue(CSSPrimitiveVa lue.CSS_UNKNOWN)", "invalidAccessError");
14 shouldThrow("div.style.getPropertyCSSValue('width').getFloatValue(CSSPrimitiveVa lue.CSS_STRING)", "invalidAccessError"); 14 shouldThrow("div.style.getPropertyCSSValue('width').getFloatValue(CSSPrimitiveVa lue.CSS_STRING)", "invalidAccessError");
15 15
16 // Test invalid unit conversions in getFloatValue 16 // Test invalid unit conversions in getFloatValue
17 shouldThrow("div.style.getPropertyCSSValue('width').getFloatValue(CSSPrimitiveVa lue.CSS_HZ)", "invalidAccessError"); 17 shouldThrow("div.style.getPropertyCSSValue('width').getFloatValue(CSSPrimitiveVa lue.CSS_HZ)", "invalidAccessError");
18 shouldThrow("div.style.getPropertyCSSValue('width').getFloatValue(CSSPrimitiveVa lue.CSS_S)", "invalidAccessError"); 18 shouldThrow("div.style.getPropertyCSSValue('width').getFloatValue(CSSPrimitiveVa lue.CSS_S)", "invalidAccessError");
19 shouldThrow("div.style.getPropertyCSSValue('width').getFloatValue(CSSPrimitiveVa lue.CSS_RAD)", "invalidAccessError"); 19 shouldThrow("div.style.getPropertyCSSValue('width').getFloatValue(CSSPrimitiveVa lue.CSS_RAD)", "invalidAccessError");
20 shouldThrow("div.style.getPropertyCSSValue('width').getFloatValue(CSSPrimitiveVa lue.CSS_PERCENTAGE)", "invalidAccessError"); 20 shouldThrow("div.style.getPropertyCSSValue('width').getFloatValue(CSSPrimitiveVa lue.CSS_PERCENTAGE)", "invalidAccessError");
21 shouldThrow("div.style.getPropertyCSSValue('height').getFloatValue(CSSPrimitiveV alue.CSS_PX)", "invalidAccessError"); 21 shouldThrow("div.style.getPropertyCSSValue('height').getFloatValue(CSSPrimitiveV alue.CSS_PX)", "invalidAccessError");
22 shouldThrow("div.style.getPropertyCSSValue('height').getFloatValue(CSSPrimitiveV alue.CSS_DEG)", "invalidAccessError"); 22 shouldThrow("div.style.getPropertyCSSValue('height').getFloatValue(CSSPrimitiveV alue.CSS_DEG)", "invalidAccessError");
23 23
24 // Test calling get*Value for CSSPrimitiveValue of the wrong type 24 // Test calling get*Value for CSSPrimitiveValue of the wrong type
25 shouldBe("div.style.getPropertyCSSValue('clip').primitiveType", "CSSPrimitiveVal ue.CSS_RECT"); 25 shouldBe("div.style.getPropertyCSSValue('clip').primitiveType", "CSSPrimitiveVal ue.CSS_RECT");
26 shouldThrow("div.style.getPropertyCSSValue('clip').getFloatValue(CSSPrimitiveVal ue.CSS_PX)", "invalidAccessError"); 26 shouldThrow("div.style.getPropertyCSSValue('clip').getFloatValue(CSSPrimitiveVal ue.CSS_PX)", "invalidAccessError");
27 shouldThrow("div.style.getPropertyCSSValue('clip').getStringValue()", "invalidAc cessError"); 27 shouldThrow("div.style.getPropertyCSSValue('clip').getStringValue()", "invalidAc cessError");
28 shouldThrow("div.style.getPropertyCSSValue('clip').getCounterValue()", "invalidA ccessError"); 28 shouldThrow("div.style.getPropertyCSSValue('clip').getCounterValue()", "invalidA ccessError");
29 shouldThrow("div.style.getPropertyCSSValue('clip').getRGBColorValue()", "invalid AccessError"); 29 shouldThrow("div.style.getPropertyCSSValue('clip').getRGBColorValue()", "invalid AccessError");
30 30
31 shouldBe("div.style.getPropertyCSSValue('color').primitiveType", "CSSPrimitiveVa lue.CSS_RGBCOLOR"); 31 shouldBe("div.style.getPropertyCSSValue('color').primitiveType", "CSSPrimitiveVa lue.CSS_RGBCOLOR");
32 shouldThrow("div.style.getPropertyCSSValue('color').getFloatValue(CSSPrimitiveVa lue.CSS_PX)", "invalidAccessError"); 32 shouldThrow("div.style.getPropertyCSSValue('color').getFloatValue(CSSPrimitiveVa lue.CSS_PX)", "invalidAccessError");
33 shouldThrow("div.style.getPropertyCSSValue('color').getStringValue()", "invalidA ccessError"); 33 shouldThrow("div.style.getPropertyCSSValue('color').getStringValue()", "invalidA ccessError");
34 shouldThrow("div.style.getPropertyCSSValue('color').getCounterValue()", "invalid AccessError"); 34 shouldThrow("div.style.getPropertyCSSValue('color').getCounterValue()", "invalid AccessError");
35 shouldThrow("div.style.getPropertyCSSValue('color').getRectValue()", "invalidAcc essError"); 35 shouldThrow("div.style.getPropertyCSSValue('color').getRectValue()", "invalidAcc essError");
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/getFloatValueForUnit-expected.txt ('k') | LayoutTests/fast/dom/DOMException/XPathException-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698