WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-92940-20120801223852.patch (text/plain), 18.58 KB, created by
Benjamin Poulain
on 2012-08-01 22:39:10 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Benjamin Poulain
Created:
2012-08-01 22:39:10 PDT
Size:
18.58 KB
patch
obsolete
>Subversion Revision: 124354 >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index 7b18befd47012b5bfb3be263fa32617e918af8ae..7a0e1d57c6800789119c0837e8369318223162e3 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,23 @@ >+2012-08-01 Benjamin Poulain <benjamin@webkit.org> >+ >+ StringImpl created from literal should be BufferInternal >+ https://bugs.webkit.org/show_bug.cgi?id=92940 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ The ownership of string created from literal should be BufferInternal so that >+ StringImpl never tries to delete the characters. >+ >+ The ownership was accidentaly set to BufferOwned in r123689. >+ >+ * wtf/text/StringImpl.cpp: >+ (WTF::StringImpl::createFromLiteral): Update to use the new constructor. >+ * wtf/text/StringImpl.h: >+ (WTF::StringImpl::StringImpl): >+ Add a new constructor making the construction from literal explicit. >+ Add the flag s_hashFlagHasTerminatingNullCharacter since the data has the terminating >+ null character. >+ > 2012-08-01 Patrick Gansterer <paroga@webkit.org> > > Export StringImpl::sizeInBytes() with WTF_EXPORT_STRING_API >diff --git a/Source/WTF/wtf/text/StringImpl.cpp b/Source/WTF/wtf/text/StringImpl.cpp >index 425e773eeba2e66e0e7551419a794f4776c022f6..e1064b3b369c08f36b4d6402ae30bab79e38228b 100644 >--- a/Source/WTF/wtf/text/StringImpl.cpp >+++ b/Source/WTF/wtf/text/StringImpl.cpp >@@ -85,7 +85,7 @@ StringImpl::~StringImpl() > PassRefPtr<StringImpl> StringImpl::createFromLiteral(const LChar* characters, unsigned length) > { > ASSERT(charactersAreAllASCII<LChar>(characters, length)); >- return adoptRef(new StringImpl(characters, length)); >+ return adoptRef(new StringImpl(characters, length, ConstructFromLiteral)); > } > > PassRefPtr<StringImpl> StringImpl::createUninitialized(unsigned length, LChar*& data) >diff --git a/Source/WTF/wtf/text/StringImpl.h b/Source/WTF/wtf/text/StringImpl.h >index d7bd52ecf0c4bcdfda805d822eb7e199025ddd2d..e709869860e47b5ab4265d9d6c1c313ae6919402 100644 >--- a/Source/WTF/wtf/text/StringImpl.h >+++ b/Source/WTF/wtf/text/StringImpl.h >@@ -165,6 +165,19 @@ private: > ASSERT(m_length); > } > >+ enum ConstructFromLiteralTag { ConstructFromLiteral }; >+ StringImpl(const LChar* characters, unsigned length, ConstructFromLiteralTag) >+ : m_refCount(s_refCountIncrement) >+ , m_length(length) >+ , m_data8(characters) >+ , m_buffer(0) >+ , m_hashAndFlags(s_hashFlag8BitBuffer | BufferInternal | s_hashFlagHasTerminatingNullCharacter) >+ { >+ ASSERT(m_data8); >+ ASSERT(m_length); >+ ASSERT(!characters[length]); >+ } >+ > // Create a StringImpl adopting ownership of the provided buffer (BufferOwned) > StringImpl(const UChar* characters, unsigned length) > : m_refCount(s_refCountIncrement) >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 1338653f07237cff6030a8eaddc41d97aeb93d40..feadf548c4126d2b04576554c675adf33e02aa90 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,20 @@ >+2012-08-01 Benjamin Poulain <benjamin@webkit.org> >+ >+ StringImpl created from literal should be BufferInternal >+ https://bugs.webkit.org/show_bug.cgi?id=92940 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add tests for the contruction of strings from literal. >+ >+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: >+ * TestWebKitAPI/Tests/WTF/AtomicString.cpp: Added. >+ (TestWebKitAPI): >+ (TestWebKitAPI::TEST): >+ * TestWebKitAPI/Tests/WTF/StringImpl.cpp: Added. >+ (TestWebKitAPI): >+ (TestWebKitAPI::TEST): >+ > 2012-08-01 Sheriff Bot <webkit.review.bot@gmail.com> > > Unreviewed, rolling out r123865. >diff --git a/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj b/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj >index d3664a129dd59dd15cf2c958f99c1c168911c2c3..2d72af4c50533b8b19ef8826a30336d9b8861fd0 100644 >--- a/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj >+++ b/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj >@@ -25,6 +25,8 @@ > 26B2DFF915BDE599004F691D /* HashSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26B2DFF815BDE599004F691D /* HashSet.cpp */; }; > 26DF5A5E15A29BAA003689C2 /* CancelLoadFromResourceLoadDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 26DF5A5D15A29BAA003689C2 /* CancelLoadFromResourceLoadDelegate.mm */; }; > 26DF5A6315A2A27E003689C2 /* CancelLoadFromResourceLoadDelegate.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 26DF5A6115A2A22B003689C2 /* CancelLoadFromResourceLoadDelegate.html */; }; >+ 26F1B44415CA434F00D1E4BF /* AtomicString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F1B44215CA434F00D1E4BF /* AtomicString.cpp */; }; >+ 26F1B44515CA434F00D1E4BF /* StringImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F1B44315CA434F00D1E4BF /* StringImpl.cpp */; }; > 333B9CE21277F23100FEFCE3 /* PreventEmptyUserAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 333B9CE11277F23100FEFCE3 /* PreventEmptyUserAgent.cpp */; }; > 33BE5AF5137B5A6C00705813 /* MouseMoveAfterCrash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33BE5AF4137B5A6C00705813 /* MouseMoveAfterCrash.cpp */; }; > 33BE5AF9137B5AAE00705813 /* MouseMoveAfterCrash_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33BE5AF8137B5AAE00705813 /* MouseMoveAfterCrash_Bundle.cpp */; }; >@@ -156,9 +158,9 @@ > C507E8A714C6545B005D6B3B /* InspectorBar.mm in Sources */ = {isa = PBXBuildFile; fileRef = C507E8A614C6545B005D6B3B /* InspectorBar.mm */; }; > C540F776152E4DA000A40C8C /* SimplifyMarkup.mm in Sources */ = {isa = PBXBuildFile; fileRef = C540F775152E4DA000A40C8C /* SimplifyMarkup.mm */; }; > C540F784152E5A9A00A40C8C /* verboseMarkup.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C540F783152E5A7800A40C8C /* verboseMarkup.html */; }; >+ CD5497B415857F0C00B5BC30 /* MediaTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD5497B315857F0C00B5BC30 /* MediaTime.cpp */; }; > E1220DA0155B25480013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = E1220D9F155B25480013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.mm */; }; > E1220DCA155B28AA0013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = E1220DC9155B287D0013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.html */; }; >- CD5497B415857F0C00B5BC30 /* MediaTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD5497B315857F0C00B5BC30 /* MediaTime.cpp */; }; > E490296814E2E3A4002BEDD1 /* TypingStyleCrash.mm in Sources */ = {isa = PBXBuildFile; fileRef = E490296714E2E3A4002BEDD1 /* TypingStyleCrash.mm */; }; > F3FC3EE313678B7300126A65 /* libgtest.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F3FC3EE213678B7300126A65 /* libgtest.a */; }; > F660AA0D15A5F061003A1243 /* GetInjectedBundleInitializationUserDataCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F660AA0C15A5F061003A1243 /* GetInjectedBundleInitializationUserDataCallback.cpp */; }; >@@ -252,6 +254,8 @@ > 26B2DFF815BDE599004F691D /* HashSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HashSet.cpp; path = WTF/HashSet.cpp; sourceTree = "<group>"; }; > 26DF5A5D15A29BAA003689C2 /* CancelLoadFromResourceLoadDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CancelLoadFromResourceLoadDelegate.mm; sourceTree = "<group>"; }; > 26DF5A6115A2A22B003689C2 /* CancelLoadFromResourceLoadDelegate.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = CancelLoadFromResourceLoadDelegate.html; sourceTree = "<group>"; }; >+ 26F1B44215CA434F00D1E4BF /* AtomicString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AtomicString.cpp; path = WTF/AtomicString.cpp; sourceTree = "<group>"; }; >+ 26F1B44315CA434F00D1E4BF /* StringImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringImpl.cpp; path = WTF/StringImpl.cpp; sourceTree = "<group>"; }; > 333B9CE11277F23100FEFCE3 /* PreventEmptyUserAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PreventEmptyUserAgent.cpp; sourceTree = "<group>"; }; > 33BE5AF4137B5A6C00705813 /* MouseMoveAfterCrash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MouseMoveAfterCrash.cpp; sourceTree = "<group>"; }; > 33BE5AF8137B5AAE00705813 /* MouseMoveAfterCrash_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MouseMoveAfterCrash_Bundle.cpp; sourceTree = "<group>"; }; >@@ -399,9 +403,9 @@ > C507E8A614C6545B005D6B3B /* InspectorBar.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = InspectorBar.mm; sourceTree = "<group>"; }; > C540F775152E4DA000A40C8C /* SimplifyMarkup.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SimplifyMarkup.mm; sourceTree = "<group>"; }; > C540F783152E5A7800A40C8C /* verboseMarkup.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = verboseMarkup.html; sourceTree = "<group>"; }; >+ CD5497B315857F0C00B5BC30 /* MediaTime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MediaTime.cpp; path = WTF/MediaTime.cpp; sourceTree = "<group>"; }; > E1220D9F155B25480013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MemoryCacheDisableWithinResourceLoadDelegate.mm; sourceTree = "<group>"; }; > E1220DC9155B287D0013E2FC /* MemoryCacheDisableWithinResourceLoadDelegate.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = MemoryCacheDisableWithinResourceLoadDelegate.html; sourceTree = "<group>"; }; >- CD5497B315857F0C00B5BC30 /* MediaTime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MediaTime.cpp; path = WTF/MediaTime.cpp; sourceTree = "<group>"; }; > E490296714E2E3A4002BEDD1 /* TypingStyleCrash.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TypingStyleCrash.mm; sourceTree = "<group>"; }; > F3FC3EE213678B7300126A65 /* libgtest.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libgtest.a; sourceTree = BUILT_PRODUCTS_DIR; }; > F660AA0C15A5F061003A1243 /* GetInjectedBundleInitializationUserDataCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetInjectedBundleInitializationUserDataCallback.cpp; sourceTree = "<group>"; }; >@@ -621,6 +625,7 @@ > children = ( > BC029B1A1486B23800817DA9 /* ns */, > C0991C4F143C7D68007998F2 /* cf */, >+ 26F1B44215CA434F00D1E4BF /* AtomicString.cpp */, > CD5497B315857F0C00B5BC30 /* MediaTime.cpp */, > 0FC6C4CE141034AD005B7F0C /* MetaAllocator.cpp */, > 0FC6C4CB141027E0005B7F0C /* RedBlackTree.cpp */, >@@ -629,6 +634,7 @@ > 0BCD833414857CE400EA2003 /* HashMap.cpp */, > 26B2DFF815BDE599004F691D /* HashSet.cpp */, > 81B50192140F232300D9EB58 /* StringBuilder.cpp */, >+ 26F1B44315CA434F00D1E4BF /* StringImpl.cpp */, > C01363C713C3997300EF3964 /* StringOperators.cpp */, > 0BCD85691485C98B00EA2003 /* TemporaryChange.cpp */, > BC55F5F814AD78EE00484BE1 /* Vector.cpp */, >@@ -861,6 +867,7 @@ > isa = PBXSourcesBuildPhase; > buildActionMask = 2147483647; > files = ( >+ 26F1B44415CA434F00D1E4BF /* AtomicString.cpp in Sources */, > BC131885117114B600B69727 /* PlatformUtilitiesMac.mm in Sources */, > BC131A9B1171316900B69727 /* main.mm in Sources */, > BC131AA9117131FC00B69727 /* TestsController.cpp in Sources */, >@@ -901,6 +908,7 @@ > C085880013FEC3A6001EF4E5 /* InstanceMethodSwizzler.mm in Sources */, > 37DC678D140D7C5000ABCCDB /* DOMRangeOfString.mm in Sources */, > 81B50193140F232300D9EB58 /* StringBuilder.cpp in Sources */, >+ 26F1B44515CA434F00D1E4BF /* StringImpl.cpp in Sources */, > 0FC6C4CC141027E0005B7F0C /* RedBlackTree.cpp in Sources */, > 0FC6C4CF141034AD005B7F0C /* MetaAllocator.cpp in Sources */, > A7A966DB140ECCC8005EF9B4 /* CheckedArithmeticOperations.cpp in Sources */, >diff --git a/Tools/TestWebKitAPI/Tests/WTF/AtomicString.cpp b/Tools/TestWebKitAPI/Tests/WTF/AtomicString.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..bddf22c23c187203796d819fc18a3fdaf769f2d4 >--- /dev/null >+++ b/Tools/TestWebKitAPI/Tests/WTF/AtomicString.cpp >@@ -0,0 +1,59 @@ >+/* >+ * Copyright (C) 2012 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+ >+#include <wtf/text/AtomicString.h> >+ >+namespace TestWebKitAPI { >+ >+TEST(WTF, AtomicStringCreationFromLiteral) >+{ >+ AtomicString stringWithTemplate("Template Literal", AtomicString::ConstructFromLiteral); >+ ASSERT_EQ(strlen("Template Literal"), stringWithTemplate.length()); >+ ASSERT_TRUE(stringWithTemplate == "Template Literal"); >+ ASSERT_TRUE(stringWithTemplate.string().is8Bit()); >+ ASSERT_TRUE(stringWithTemplate.impl()->hasTerminatingNullCharacter()); >+ >+ const char* programmaticStringData = "Explicit Size Literal"; >+ AtomicString programmaticString(programmaticStringData, strlen(programmaticStringData), AtomicString::ConstructFromLiteral); >+ ASSERT_EQ(strlen(programmaticStringData), programmaticString.length()); >+ ASSERT_TRUE(programmaticStringData == programmaticStringData); >+ ASSERT_TRUE(programmaticString.string().is8Bit()); >+ ASSERT_TRUE(programmaticString.impl()->hasTerminatingNullCharacter()); >+ ASSERT_EQ(programmaticStringData, reinterpret_cast<const char*>(programmaticString.string().characters8())); >+} >+ >+TEST(WTF, AtomicStringCreationFromLiteralUniqueness) >+{ >+ AtomicString string1("Template Literal", AtomicString::ConstructFromLiteral); >+ AtomicString string2("Template Literal", AtomicString::ConstructFromLiteral); >+ ASSERT_EQ(string1.impl(), string2.impl()); >+ >+ AtomicString string3("Template Literal"); >+ ASSERT_EQ(string1.impl(), string3.impl()); >+} >+ >+} // namespace TestWebKitAPI >diff --git a/Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp b/Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..61bb06cc40e595addcc1b696498d3814ec642396 >--- /dev/null >+++ b/Tools/TestWebKitAPI/Tests/WTF/StringImpl.cpp >@@ -0,0 +1,60 @@ >+/* >+ * Copyright (C) 2012 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+ >+#include <wtf/text/StringImpl.h> >+ >+namespace TestWebKitAPI { >+ >+TEST(WTF, StringImplCreationFromLiteral) >+{ >+ RefPtr<StringImpl> stringWithTemplate = StringImpl::createFromLiteral("Template Literal"); >+ ASSERT_EQ(strlen("Template Literal"), stringWithTemplate->length()); >+ ASSERT_TRUE(equal(stringWithTemplate.get(), "Template Literal")); >+ ASSERT_TRUE(stringWithTemplate->is8Bit()); >+ ASSERT_TRUE(stringWithTemplate->hasTerminatingNullCharacter()); >+ >+ const char* programmaticStringData = "Explicit Size Literal"; >+ RefPtr<StringImpl> programmaticString = StringImpl::createFromLiteral(reinterpret_cast<const LChar*>(programmaticStringData), strlen(programmaticStringData)); >+ ASSERT_EQ(strlen(programmaticStringData), programmaticString->length()); >+ ASSERT_TRUE(equal(programmaticString.get(), programmaticStringData)); >+ ASSERT_EQ(programmaticStringData, reinterpret_cast<const char*>(programmaticString->characters8())); >+ ASSERT_TRUE(programmaticString->is8Bit()); >+ ASSERT_TRUE(programmaticString->hasTerminatingNullCharacter()); >+} >+ >+TEST(WTF, StringImplFromLiteralLoop16BitConversion) >+{ >+ RefPtr<StringImpl> controlString = StringImpl::create("Template Literal"); >+ for (size_t i = 0; i < 10; ++i) { >+ RefPtr<StringImpl> string = StringImpl::createFromLiteral("Template Literal"); >+ >+ ASSERT_EQ(0, memcmp(controlString->characters(), string->characters(), controlString->length() * sizeof(UChar))); >+ ASSERT_TRUE(string->has16BitShadow()); >+ } >+} >+ >+} // namespace TestWebKitAPI
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 92940
:
155975
|
156176
|
156191