summaryrefslogtreecommitdiffstats
path: root/dom/bindings/test/TestFunctions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/bindings/test/TestFunctions.cpp')
-rw-r--r--dom/bindings/test/TestFunctions.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/dom/bindings/test/TestFunctions.cpp b/dom/bindings/test/TestFunctions.cpp
index a91121eaa7..59d4554020 100644
--- a/dom/bindings/test/TestFunctions.cpp
+++ b/dom/bindings/test/TestFunctions.cpp
@@ -66,8 +66,7 @@ void TestFunctions::GetStringDataAsDOMString(const Optional<uint32_t>& aLength,
length = mStringData.Length();
}
- nsStringBuffer* buf = nsStringBuffer::FromString(mStringData);
- if (buf) {
+ if (nsStringBuffer* buf = mStringData.GetStringBuffer()) {
aString.SetKnownLiveStringBuffer(buf, length);
return;
}
@@ -134,7 +133,7 @@ StringType TestFunctions::GetStringType(const nsAString& aString) {
return StringType::Literal;
}
- if (nsStringBuffer::FromString(aString)) {
+ if (aString.GetStringBuffer()) {
return StringType::Stringbuffer;
}
@@ -146,9 +145,8 @@ StringType TestFunctions::GetStringType(const nsAString& aString) {
}
bool TestFunctions::StringbufferMatchesStored(const nsAString& aString) {
- return nsStringBuffer::FromString(aString) &&
- nsStringBuffer::FromString(aString) ==
- nsStringBuffer::FromString(mStringData);
+ return aString.GetStringBuffer() &&
+ aString.GetStringBuffer() == mStringData.GetStringBuffer();
}
void TestFunctions::TestThrowNsresult(ErrorResult& aError) {