OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013, Google Inc. All rights reserved. | 2 * Copyright 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 TEST(CSSParserValuesTest, InitWithEmpty16BitsString) | 49 TEST(CSSParserValuesTest, InitWithEmpty16BitsString) |
50 { | 50 { |
51 String string16bit("a"); | 51 String string16bit("a"); |
52 string16bit.ensure16Bit(); | 52 string16bit.ensure16Bit(); |
53 | 53 |
54 CSSParserString cssParserString; | 54 CSSParserString cssParserString; |
55 cssParserString.init(string16bit, 1, 0); | 55 cssParserString.init(string16bit, 1, 0); |
56 ASSERT_EQ(0u, cssParserString.length()); | 56 ASSERT_EQ(0u, cssParserString.length()); |
57 } | 57 } |
58 | 58 |
| 59 TEST(CSSParserValuesTest, EqualIgnoringCase8BitsString) |
| 60 { |
| 61 CSSParserString cssParserString; |
| 62 String string8bit("sHaDOw"); |
| 63 cssParserString.init(string8bit, 0, string8bit.length()); |
| 64 |
| 65 ASSERT_TRUE(cssParserString.equalIgnoringCase("shadow")); |
| 66 ASSERT_TRUE(cssParserString.equalIgnoringCase("ShaDow")); |
| 67 ASSERT_FALSE(cssParserString.equalIgnoringCase("shadow-all")); |
| 68 ASSERT_FALSE(cssParserString.equalIgnoringCase("sha")); |
| 69 ASSERT_FALSE(cssParserString.equalIgnoringCase("abCD")); |
| 70 } |
| 71 |
| 72 TEST(CSSParserValuesTest, EqualIgnoringCase16BitsString) |
| 73 { |
| 74 String string16bit("sHaDOw"); |
| 75 string16bit.ensure16Bit(); |
| 76 |
| 77 CSSParserString cssParserString; |
| 78 cssParserString.init(string16bit, 0, string16bit.length()); |
| 79 |
| 80 ASSERT_TRUE(cssParserString.equalIgnoringCase("shadow")); |
| 81 ASSERT_TRUE(cssParserString.equalIgnoringCase("ShaDow")); |
| 82 ASSERT_FALSE(cssParserString.equalIgnoringCase("shadow-all")); |
| 83 ASSERT_FALSE(cssParserString.equalIgnoringCase("sha")); |
| 84 ASSERT_FALSE(cssParserString.equalIgnoringCase("abCD")); |
| 85 } |
| 86 |
59 } // namespace | 87 } // namespace |
OLD | NEW |