<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<script>
function setFontFaceWeight(fontFace, weight) {
    fontFace.weight = weight;
    return fontFace.weight;
}

function setFontFaceStretch(fontFace, stretch) {
    fontFace.stretch = stretch;
    return fontFace.stretch;
}

function setFontFaceStyle(fontFace, style) {
    fontFace.style = style;
    return fontFace.style;
}

var fontFace = new FontFace("asdf", "url('notreal')");
shouldBeEqualToString("setFontFaceWeight(fontFace, '1')", "1");
shouldBeEqualToString("setFontFaceWeight(fontFace, '100')", "100");
shouldBeEqualToString("setFontFaceWeight(fontFace, '200')", "200");
shouldBeEqualToString("setFontFaceWeight(fontFace, '300')", "300");
shouldBeEqualToString("setFontFaceWeight(fontFace, '400')", "400");
shouldBeEqualToString("setFontFaceWeight(fontFace, 'normal')", "normal");
shouldBeEqualToString("setFontFaceWeight(fontFace, '500')", "500");
shouldBeEqualToString("setFontFaceWeight(fontFace, '600')", "600");
shouldBeEqualToString("setFontFaceWeight(fontFace, '700')", "700");
shouldBeEqualToString("setFontFaceWeight(fontFace, 'bold')", "bold");
shouldBeEqualToString("setFontFaceWeight(fontFace, '800')", "800");
shouldBeEqualToString("setFontFaceWeight(fontFace, '900')", "900");
shouldThrow("setFontFaceWeight(fontFace, 'garbage')");
shouldThrow("setFontFaceWeight(fontFace, 'initial')");
shouldBeEqualToString("setFontFaceWeight(fontFace, 'calc(3 + 4)')", "7");
shouldBeEqualToString("setFontFaceWeight(fontFace, 'calc(100 + 200)')", "300");
shouldBeEqualToString("setFontFaceWeight(fontFace, 'calc(150 + 50)')", "200");

shouldBeEqualToString("setFontFaceStretch(fontFace, '1%')", "1%");
shouldThrow("setFontFaceStretch(fontFace, '2')");
shouldBeEqualToString("setFontFaceStretch(fontFace, 'ultra-condensed')", "ultra-condensed");
shouldBeEqualToString("setFontFaceStretch(fontFace, 'extra-condensed')", "extra-condensed");
shouldBeEqualToString("setFontFaceStretch(fontFace, 'condensed')", "condensed");
shouldBeEqualToString("setFontFaceStretch(fontFace, 'semi-condensed')", "semi-condensed");
shouldBeEqualToString("setFontFaceStretch(fontFace, 'normal')", "normal");
shouldBeEqualToString("setFontFaceStretch(fontFace, 'semi-expanded')", "semi-expanded");
shouldBeEqualToString("setFontFaceStretch(fontFace, 'expanded')", "expanded");
shouldBeEqualToString("setFontFaceStretch(fontFace, 'extra-expanded')", "extra-expanded");
shouldBeEqualToString("setFontFaceStretch(fontFace, 'ultra-expanded')", "ultra-expanded");
shouldThrow("setFontFaceStretch(fontFace, 'garbage')");
shouldThrow("setFontFaceStretch(fontFace, 'initial')");
shouldThrow("setFontFaceStretch(fontFace, 'calc(3 + 4)')");
shouldBeEqualToString("setFontFaceStretch(fontFace, 'calc(3% + 4%)')", "calc(7%)");

shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique 1deg')", "oblique 1deg");
shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique 20grad')", "oblique 20grad");
shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique 0.28318rad')", "oblique 0.28318rad");
shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique 0.04turn')", "oblique 0.04turn");
shouldThrow("setFontFaceStyle(fontFace, 'oblique 5')");
shouldThrow("setFontFaceStyle(fontFace, 'oblique 20')");
shouldBeEqualToString("setFontFaceStyle(fontFace, 'italic')", "italic");
shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique')", "oblique");
shouldBeEqualToString("setFontFaceStyle(fontFace, 'normal')", "normal");
shouldThrow("setFontFaceStyle(fontFace, 'garbage')");
shouldThrow("setFontFaceStyle(fontFace, 'initial')");
shouldThrow("setFontFaceStyle(fontFace, 'oblique calc(3 + 4)')");
shouldBeEqualToString("setFontFaceStyle(fontFace, 'oblique calc(0.04turn + 1deg)')", "oblique calc(15.4deg)");
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>
