com.google.caja.plugin
Class CssValidatorTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by com.google.caja.util.CajaTestCase
              extended by com.google.caja.plugin.CssValidatorTest
All Implemented Interfaces:
junit.framework.Test

public final class CssValidatorTest
extends CajaTestCase

Author:
mikesamuel@gmail.com (Mike Samuel)

Field Summary
 
Fields inherited from class com.google.caja.util.CajaTestCase
is, mc, mq, SEED
 
Constructor Summary
CssValidatorTest()
           
 
Method Summary
private static
<T extends ParseTreeNode>
AncestorChain<T>
ac(T node)
           
private  void fails(java.lang.String css)
           
private static CssValidator makeCssValidator(MessageQueue mq)
           
private static void removeInvalidNodes(AncestorChain<? extends CssTree> t)
           
private  void runTest(java.lang.String css, java.lang.String golden, java.lang.String... warnings)
           
 void testAttrSelectorBadTag()
           
 void testAttrSelectorNesting()
           
 void testAttrSelectorNoTag()
           
 void testBackground()
           
 void testBackgroundPosition()
           
 void testClip()
           
 void testColorSubstitution()
           
 void testContent()
           
 void testDisallowedAttrs()
           
 void testFontFamily()
           
 void testFontSpecialization()
           
 void testHtmlStarHack()
           
 void testNegativeSpacing()
           
 void testOpacity()
           
 void testPositionSubstitution()
           
 void testProgId()
           
 void testSimpleAttrSelectorDashMatch()
           
 void testSimpleAttrSelectorEqual()
           
 void testSimpleAttrSelectorIncludes()
           
 void testSimpleAttrSelectorNoValue()
           
 void testStarHack()
           
 void testUnitlessLengths()
           
 void testUriSubstitution()
           
 void testValidateBorder()
           
 void testValidateColor()
           
 void testValidateFont()
           
 void testValidateUnquotedFamilyNames()
           
private  void warns(java.lang.String css)
           
 
Methods inherited from class com.google.caja.util.CajaTestCase
assertArrayEquals, assertCloneable, assertDeepEquals, assertMessage, assertMessage, assertMessagesLessSevereThan, assertNoErrors, assertNoMessage, assertNoWarnings, checkHeadless, css, css, cssDecls, cssDecls, dataFromResource, formatShort, fromResource, fromResource, fromString, fromString, fromString, html, htmlFragment, js, js, js, jsExpr, jsExpr, markup, markupFragment, minify, plain, quasi, render, render, renderProgram, runTest, setUp, tearDown, xml, xmlFragment
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CssValidatorTest

public CssValidatorTest()
Method Detail

testValidateColor

public final void testValidateColor()
                             throws java.lang.Exception
Throws:
java.lang.Exception

testValidateFont

public final void testValidateFont()
                            throws java.lang.Exception
Throws:
java.lang.Exception

testValidateUnquotedFamilyNames

public final void testValidateUnquotedFamilyNames()
                                           throws java.lang.Exception
Throws:
java.lang.Exception

testValidateBorder

public final void testValidateBorder()
                              throws java.lang.Exception
Throws:
java.lang.Exception

testClip

public final void testClip()
                    throws java.lang.Exception
Throws:
java.lang.Exception

testContent

public final void testContent()
                       throws java.lang.Exception
Throws:
java.lang.Exception

testBackground

public final void testBackground()
                          throws java.lang.Exception
Throws:
java.lang.Exception

testBackgroundPosition

public final void testBackgroundPosition()
                                  throws java.lang.Exception
Throws:
java.lang.Exception

testPositionSubstitution

public final void testPositionSubstitution()
                                    throws java.lang.Exception
Throws:
java.lang.Exception

testColorSubstitution

public final void testColorSubstitution()
                                 throws java.lang.Exception
Throws:
java.lang.Exception

testUriSubstitution

public final void testUriSubstitution()
                               throws java.lang.Exception
Throws:
java.lang.Exception

testFontFamily

public final void testFontFamily()
                          throws java.lang.Exception
Throws:
java.lang.Exception

testUnitlessLengths

public final void testUnitlessLengths()
                               throws java.lang.Exception
Throws:
java.lang.Exception

testNegativeSpacing

public final void testNegativeSpacing()
                               throws java.lang.Exception
Throws:
java.lang.Exception

testOpacity

public final void testOpacity()
                       throws java.lang.Exception
Throws:
java.lang.Exception

testProgId

public final void testProgId()
                      throws java.lang.Exception
Throws:
java.lang.Exception

testStarHack

public final void testStarHack()
                        throws java.lang.Exception
Throws:
java.lang.Exception

testHtmlStarHack

public final void testHtmlStarHack()
                            throws java.lang.Exception
Throws:
java.lang.Exception

testFontSpecialization

public final void testFontSpecialization()
                                  throws java.lang.Exception
Throws:
java.lang.Exception

testAttrSelectorNoTag

public final void testAttrSelectorNoTag()
                                 throws java.lang.Exception
Throws:
java.lang.Exception

testAttrSelectorBadTag

public final void testAttrSelectorBadTag()
                                  throws java.lang.Exception
Throws:
java.lang.Exception

testSimpleAttrSelectorNoValue

public final void testSimpleAttrSelectorNoValue()
                                         throws java.lang.Exception
Throws:
java.lang.Exception

testSimpleAttrSelectorEqual

public final void testSimpleAttrSelectorEqual()
                                       throws java.lang.Exception
Throws:
java.lang.Exception

testSimpleAttrSelectorIncludes

public final void testSimpleAttrSelectorIncludes()
                                          throws java.lang.Exception
Throws:
java.lang.Exception

testSimpleAttrSelectorDashMatch

public final void testSimpleAttrSelectorDashMatch()
                                           throws java.lang.Exception
Throws:
java.lang.Exception

testAttrSelectorNesting

public final void testAttrSelectorNesting()
                                   throws java.lang.Exception
Throws:
java.lang.Exception

testDisallowedAttrs

public final void testDisallowedAttrs()
                               throws java.lang.Exception
Throws:
java.lang.Exception

fails

private void fails(java.lang.String css)
            throws java.lang.Exception
Throws:
java.lang.Exception

warns

private void warns(java.lang.String css)
            throws java.lang.Exception
Throws:
java.lang.Exception

removeInvalidNodes

private static void removeInvalidNodes(AncestorChain<? extends CssTree> t)

runTest

private void runTest(java.lang.String css,
                     java.lang.String golden,
                     java.lang.String... warnings)
              throws java.lang.Exception
Throws:
java.lang.Exception

makeCssValidator

private static CssValidator makeCssValidator(MessageQueue mq)

ac

private static <T extends ParseTreeNode> AncestorChain<T> ac(T node)


Copyright (C) 2008 Google Inc.
Licensed under the Apache License, Version 2.0