| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013, Google Inc. All rights reserved. | 2 * Copyright (c) 2013, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "core/html/LinkRelAttribute.h" | 32 #include "core/html/LinkRelAttribute.h" |
| 33 | 33 |
| 34 #include "wtf/text/CString.h" |
| 34 #include <gtest/gtest.h> | 35 #include <gtest/gtest.h> |
| 35 | 36 |
| 36 using namespace WebCore; | 37 using namespace WebCore; |
| 37 | 38 |
| 38 namespace { | 39 namespace { |
| 39 | 40 |
| 40 static inline void testLinkRelAttribute(String value, bool isStyleSheet, IconTyp
e iconType, bool isAlternate, bool isDNSPrefetch, bool isLinkSubresource, bool i
sLinkPrerender, bool isImport = false) | 41 static inline void testLinkRelAttribute(String value, bool isStyleSheet, IconTyp
e iconType, bool isAlternate, bool isDNSPrefetch, bool isLinkSubresource, bool i
sLinkPrerender, bool isImport = false) |
| 41 { | 42 { |
| 42 LinkRelAttribute linkRelAttribute(value); | 43 LinkRelAttribute linkRelAttribute(value); |
| 43 ASSERT_EQ(isStyleSheet, linkRelAttribute.isStyleSheet()) << value.utf8().dat
a(); | 44 ASSERT_EQ(isStyleSheet, linkRelAttribute.isStyleSheet()) << value.utf8().dat
a(); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 testLinkRelAttribute("stylesheet icon prerender aLtErNaTe", true, Favicon, t
rue, false, false, true); | 79 testLinkRelAttribute("stylesheet icon prerender aLtErNaTe", true, Favicon, t
rue, false, false, true); |
| 79 testLinkRelAttribute("alternate subresource", false, InvalidIcon, true, fals
e, true, false); | 80 testLinkRelAttribute("alternate subresource", false, InvalidIcon, true, fals
e, true, false); |
| 80 testLinkRelAttribute("alternate icon stylesheet", true, Favicon, true, false
, false, false); | 81 testLinkRelAttribute("alternate icon stylesheet", true, Favicon, true, false
, false, false); |
| 81 | 82 |
| 82 testLinkRelAttribute("import", false, InvalidIcon, false, false, false, fals
e, true); | 83 testLinkRelAttribute("import", false, InvalidIcon, false, false, false, fals
e, true); |
| 83 // "import" is mutually exclusive and "stylesheet" wins when they conflict. | 84 // "import" is mutually exclusive and "stylesheet" wins when they conflict. |
| 84 testLinkRelAttribute("stylesheet import", true, InvalidIcon, false, false, f
alse, false, false); | 85 testLinkRelAttribute("stylesheet import", true, InvalidIcon, false, false, f
alse, false, false); |
| 85 } | 86 } |
| 86 | 87 |
| 87 } // namespace | 88 } // namespace |
| OLD | NEW |