OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 EXPECT_TRUE( | 82 EXPECT_TRUE( |
83 equal(testStringImpl16.get(), | 83 equal(testStringImpl16.get(), |
84 StringImpl::create(testCapitalized, 4)->lowerASCII().get())); | 84 StringImpl::create(testCapitalized, 4)->lowerASCII().get())); |
85 | 85 |
86 static const UChar testWithNonASCII[3] = {0x0061, 0x00e1, 0}; // a\xE1 | 86 static const UChar testWithNonASCII[3] = {0x0061, 0x00e1, 0}; // a\xE1 |
87 static const UChar testWithNonASCIIComparison[3] = {0x0061, 0x00c1, | 87 static const UChar testWithNonASCIIComparison[3] = {0x0061, 0x00c1, |
88 0}; // a\xC1 | 88 0}; // a\xC1 |
89 static const UChar testWithNonASCIICapitalized[3] = {0x0041, 0x00e1, | 89 static const UChar testWithNonASCIICapitalized[3] = {0x0041, 0x00e1, |
90 0}; // A\xE1 | 90 0}; // A\xE1 |
91 | 91 |
| 92 // Make sure we support RefPtr<const StringImpl>. |
| 93 RefPtr<const StringImpl> constRef = testStringImpl->isolatedCopy(); |
| 94 DCHECK(constRef->hasOneRef()); |
92 EXPECT_TRUE(equal( | 95 EXPECT_TRUE(equal( |
93 StringImpl::create(testWithNonASCII, 2).get(), | 96 StringImpl::create(testWithNonASCII, 2).get(), |
94 StringImpl::create(testWithNonASCIICapitalized, 2)->lowerASCII().get())); | 97 StringImpl::create(testWithNonASCIICapitalized, 2)->lowerASCII().get())); |
95 EXPECT_FALSE(equal( | 98 EXPECT_FALSE(equal( |
96 StringImpl::create(testWithNonASCII, 2).get(), | 99 StringImpl::create(testWithNonASCII, 2).get(), |
97 StringImpl::create(testWithNonASCIIComparison, 2)->lowerASCII().get())); | 100 StringImpl::create(testWithNonASCIIComparison, 2)->lowerASCII().get())); |
98 } | 101 } |
99 | 102 |
100 } // namespace WTF | 103 } // namespace WTF |
OLD | NEW |