Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(994)

Unified Diff: remoting/base/compressor_zlib_unittest.cc

Issue 11195029: Remove ZLib codec support from chromoting host and client. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/base/compressor_zlib.cc ('k') | remoting/base/decompressor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/base/compressor_zlib_unittest.cc
diff --git a/remoting/base/compressor_zlib_unittest.cc b/remoting/base/compressor_zlib_unittest.cc
deleted file mode 100644
index 0b9eade9d1dadc55b2df70d7f2d03026e36d92fa..0000000000000000000000000000000000000000
--- a/remoting/base/compressor_zlib_unittest.cc
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <stdlib.h>
-
-#include "remoting/base/compressor_zlib.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace remoting {
-
-static void GenerateTestData(uint8* data, int size, int seed) {
- srand(seed);
- for (int i = 0; i < size; ++i)
- data[i] = rand() % 256;
-}
-
-// Keep compressing |input_data| into |output_data| until the last
-// bytes is consumed.
-static void Compress(remoting::Compressor* compressor,
- const uint8* input_data, int input_size,
- uint8* output_data, int output_size) {
-
- // Feed data into the compress until the end.
- // This loop will rewrite |output_data| continuously.
- int consumed = 0;
- int written = 0;
- while (compressor->Process(
- input_data, input_size, output_data, output_size,
- input_size == 0 ?
- Compressor::CompressorFinish : Compressor::CompressorNoFlush,
- &consumed, &written)) {
- input_data += consumed;
- input_size -= consumed;
- }
-}
-
-TEST(CompressorZlibTest, Compress) {
- static const int kRawDataSize = 1024 * 128;
- static const int kCompressedDataSize = 256;
- uint8 raw_data[kRawDataSize];
- uint8 compressed_data[kCompressedDataSize];
-
- // Generate the test data.g
- GenerateTestData(raw_data, kRawDataSize, 99);
-
- // Then use the compressor to compress.
- remoting::CompressorZlib compressor;
- Compress(&compressor, raw_data, kRawDataSize,
- compressed_data, kCompressedDataSize);
-}
-
-// Checks that zlib can work with a small output buffer by reading
-// less from the input.
-TEST(CompressorZlibTest, SmallOutputBuffer) {
- static const int kRawDataSize = 1024 * 128;
- static const int kCompressedDataSize = 1;
- uint8 raw_data[kRawDataSize];
- uint8 compressed_data[kCompressedDataSize];
-
- // Generate the test data.g
- GenerateTestData(raw_data, kRawDataSize, 99);
-
- // Then use the compressor to compress.
- remoting::CompressorZlib compressor;
- Compress(&compressor, raw_data, kRawDataSize,
- compressed_data, kCompressedDataSize);
-}
-
-} // namespace remoting
« no previous file with comments | « remoting/base/compressor_zlib.cc ('k') | remoting/base/decompressor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698