Commit 9bdce258 authored by Chan Li's avatar Chan Li Committed by Commit Bot

Revert "blink/bindings: Check that decompression is correct, and add UTF-16 testing."

This reverts commit 8ca571cb.

Reason for revert: This change caused blink_platform_unittests failing on multiple builders

sample build:
https://analysis.chromium.org/waterfall/failure?url=https://ci.chromium.org/p/chromium/builders/ci/Win%207%20Tests%20x64%20%281%29/52324

Original change's description:
> blink/bindings: Check that decompression is correct, and add UTF-16 testing.
> 
> There are crashes in ParkableString decompression, which are assumed to be OOM
> conditions. Add a check to make sure this is the case, and add testing for UTF16
> strings to make sure that this doesn't instead come from such strings.
> 
> Bug: 946203
> Change-Id: Iaafde8c3c7b9c79bf87de67e6c5de5b71e1a310a
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1575499
> Reviewed-by: Kentaro Hara <haraken@chromium.org>
> Commit-Queue: Benoit L <lizeb@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#652513}

TBR=haraken@chromium.org,lizeb@chromium.org

Change-Id: Id697c7df2b13d7ff8a40e68a80b3189600f781c4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 946203
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1574286Reviewed-by: default avatarChan Li <chanli@chromium.org>
Commit-Queue: Chan Li <chanli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#652547}
parent ae59440a
......@@ -493,15 +493,12 @@ String ParkableStringImpl::UnparkInternal() const {
base::StringPiece(reinterpret_cast<const char*>(data), size);
}
// If the buffer size is incorrect, then we have a corrupted data issue,
// and in such case there is nothing else to do than crash.
CHECK_EQ(compression::GetUncompressedSize(compressed_string_piece),
uncompressed_string_piece.size());
// If decompression fails, this is either because:
// 1. Compressed data is corrupted
// 2. Cannot allocate memory in zlib
// 1. The output buffer is too small
// 2. Compressed data is corrupted
// 3. Cannot allocate memory in zlib
//
// (1) is data corruption, and (2) is OOM. In all cases, we cannot
// (1-2) are data corruption, and (3) is OOM. In all cases, we cannot
// recover the string we need, nothing else to do than to abort.
//
// Stability sheriffs: If you see this, this is likely an OOM.
......
......@@ -157,36 +157,6 @@ TEST_F(ParkableStringTest, ParkUnparkIdenticalContent) {
EXPECT_EQ(MakeLargeString(), parkable.ToString());
}
TEST_F(ParkableStringTest, DecompressUtf16String) {
UChar emoji_grinning_face[2] = {0xd83d, 0xde00};
size_t size_in_chars = 2 * kSizeKb * 1000 / sizeof(UChar);
std::vector<UChar> data(size_in_chars);
for (size_t i = 0; i < size_in_chars / 2; ++i) {
data[i * 2] = emoji_grinning_face[0];
data[i * 2 + 1] = emoji_grinning_face[1];
}
String large_string = String(&data[0], size_in_chars);
String copy = large_string.IsolatedCopy();
ParkableString parkable(large_string.ReleaseImpl());
large_string = String();
EXPECT_FALSE(parkable.Is8Bit());
EXPECT_EQ(size_in_chars, parkable.length());
EXPECT_EQ(sizeof(UChar) * size_in_chars, parkable.CharactersSizeInBytes());
EXPECT_TRUE(parkable.Impl()->Park(ParkableStringImpl::ParkingMode::kAlways));
RunPostedTasks();
EXPECT_TRUE(parkable.Impl()->is_parked());
// Decompression checks that the size is correct.
String unparked = parkable.ToString();
EXPECT_FALSE(unparked.Is8Bit());
EXPECT_EQ(size_in_chars, unparked.length());
EXPECT_EQ(sizeof(UChar) * size_in_chars, unparked.CharactersSizeInBytes());
EXPECT_EQ(copy, unparked);
}
TEST_F(ParkableStringTest, Simple) {
ParkableString parkable_abc(String("abc").ReleaseImpl());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment