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 22 matching lines...) Expand all Loading... |
33 #include "platform/RuntimeEnabledFeatures.h" | 33 #include "platform/RuntimeEnabledFeatures.h" |
34 #include "testing/gtest/include/gtest/gtest.h" | 34 #include "testing/gtest/include/gtest/gtest.h" |
35 #include "wtf/text/CString.h" | 35 #include "wtf/text/CString.h" |
36 | 36 |
37 namespace blink { | 37 namespace blink { |
38 | 38 |
39 static inline void testLinkRelAttribute(String value, bool isStyleSheet, IconTyp
e iconType, bool isAlternate, bool isDNSPrefetch, bool isLinkPrerender, bool isI
mport = false, bool isPreconnect = false) | 39 static inline void testLinkRelAttribute(String value, bool isStyleSheet, IconTyp
e iconType, bool isAlternate, bool isDNSPrefetch, bool isLinkPrerender, bool isI
mport = false, bool isPreconnect = false) |
40 { | 40 { |
41 LinkRelAttribute linkRelAttribute(value); | 41 LinkRelAttribute linkRelAttribute(value); |
42 ASSERT_EQ(isStyleSheet, linkRelAttribute.isStyleSheet()) << value.utf8().dat
a(); | 42 ASSERT_EQ(isStyleSheet, linkRelAttribute.isStyleSheet()) << value.utf8().dat
a(); |
43 ASSERT_EQ(iconType, linkRelAttribute.iconType()) << value.utf8().data(); | 43 ASSERT_EQ(iconType, linkRelAttribute.getIconType()) << value.utf8().data(); |
44 ASSERT_EQ(isAlternate, linkRelAttribute.isAlternate()) << value.utf8().data(
); | 44 ASSERT_EQ(isAlternate, linkRelAttribute.isAlternate()) << value.utf8().data(
); |
45 ASSERT_EQ(isDNSPrefetch, linkRelAttribute.isDNSPrefetch()) << value.utf8().d
ata(); | 45 ASSERT_EQ(isDNSPrefetch, linkRelAttribute.isDNSPrefetch()) << value.utf8().d
ata(); |
46 ASSERT_EQ(isLinkPrerender, linkRelAttribute.isLinkPrerender()) << value.utf8
().data(); | 46 ASSERT_EQ(isLinkPrerender, linkRelAttribute.isLinkPrerender()) << value.utf8
().data(); |
47 ASSERT_EQ(isImport, linkRelAttribute.isImport()) << value.utf8().data(); | 47 ASSERT_EQ(isImport, linkRelAttribute.isImport()) << value.utf8().data(); |
48 ASSERT_EQ(isPreconnect, linkRelAttribute.isPreconnect()) << value.utf8().dat
a(); | 48 ASSERT_EQ(isPreconnect, linkRelAttribute.isPreconnect()) << value.utf8().dat
a(); |
49 } | 49 } |
50 | 50 |
51 TEST(LinkRelAttributeTest, Constructor) | 51 TEST(LinkRelAttributeTest, Constructor) |
52 { | 52 { |
53 testLinkRelAttribute("stylesheet", true, InvalidIcon, false, false, false); | 53 testLinkRelAttribute("stylesheet", true, InvalidIcon, false, false, false); |
(...skipping 23 matching lines...) Expand all Loading... |
77 | 77 |
78 testLinkRelAttribute("import", false, InvalidIcon, false, false, false, true
); | 78 testLinkRelAttribute("import", false, InvalidIcon, false, false, false, true
); |
79 testLinkRelAttribute("alternate import", false, InvalidIcon, true, false, fa
lse, true); | 79 testLinkRelAttribute("alternate import", false, InvalidIcon, true, false, fa
lse, true); |
80 testLinkRelAttribute("stylesheet import", true, InvalidIcon, false, false, f
alse, false); | 80 testLinkRelAttribute("stylesheet import", true, InvalidIcon, false, false, f
alse, false); |
81 | 81 |
82 testLinkRelAttribute("preconnect", false, InvalidIcon, false, false, false,
false, true); | 82 testLinkRelAttribute("preconnect", false, InvalidIcon, false, false, false,
false, true); |
83 testLinkRelAttribute("pReCoNnEcT", false, InvalidIcon, false, false, false,
false, true); | 83 testLinkRelAttribute("pReCoNnEcT", false, InvalidIcon, false, false, false,
false, true); |
84 } | 84 } |
85 | 85 |
86 } // namespace blink | 86 } // namespace blink |
OLD | NEW |