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

Side by Side Diff: net/base/gzip_filter_unittest.cc

Issue 24616002: Clean up a few unused globals. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <fstream> 5 #include <fstream>
6 #include <ostream> 6 #include <ostream>
7 7
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
11 #include "net/base/gzip_filter.h" 11 #include "net/base/gzip_filter.h"
12 #include "net/base/mock_filter_context.h" 12 #include "net/base/mock_filter_context.h"
13 #include "net/base/io_buffer.h" 13 #include "net/base/io_buffer.h"
14 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
15 #include "testing/platform_test.h" 15 #include "testing/platform_test.h"
16 #include "third_party/zlib/zlib.h" 16 #include "third_party/zlib/zlib.h"
17 17
18 namespace { 18 namespace {
19 19
20 const int kDefaultBufferSize = 4096; 20 const int kDefaultBufferSize = 4096;
21 const int kSmallBufferSize = 128; 21 const int kSmallBufferSize = 128;
22 22
23 const char kApplicationOctetStream[] = "application/octet-stream";
24 const char kApplicationXGzip[] = "application/x-gzip";
25 const char kApplicationGzip[] = "application/gzip";
26 const char kApplicationXGunzip[] = "application/x-gunzip";
27
28 // The GZIP header (see RFC 1952): 23 // The GZIP header (see RFC 1952):
29 // +---+---+---+---+---+---+---+---+---+---+ 24 // +---+---+---+---+---+---+---+---+---+---+
30 // |ID1|ID2|CM |FLG| MTIME |XFL|OS | 25 // |ID1|ID2|CM |FLG| MTIME |XFL|OS |
31 // +---+---+---+---+---+---+---+---+---+---+ 26 // +---+---+---+---+---+---+---+---+---+---+
32 // ID1 \037 27 // ID1 \037
33 // ID2 \213 28 // ID2 \213
34 // CM \010 (compression method == DEFLATE) 29 // CM \010 (compression method == DEFLATE)
35 // FLG \000 (special flags that we do not support) 30 // FLG \000 (special flags that we do not support)
36 // MTIME Unix format modification time (0 means not available) 31 // MTIME Unix format modification time (0 means not available)
37 // XFL 2-4? DEFLATE flags 32 // XFL 2-4? DEFLATE flags
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 int corrupt_decode_size = kDefaultBufferSize; 378 int corrupt_decode_size = kDefaultBufferSize;
384 379
385 int code = DecodeAllWithFilter(filter_.get(), corrupt_data, corrupt_data_len, 380 int code = DecodeAllWithFilter(filter_.get(), corrupt_data, corrupt_data_len,
386 corrupt_decode_buffer, &corrupt_decode_size); 381 corrupt_decode_buffer, &corrupt_decode_size);
387 382
388 // Expect failures 383 // Expect failures
389 EXPECT_TRUE(code == Filter::FILTER_ERROR); 384 EXPECT_TRUE(code == Filter::FILTER_ERROR);
390 } 385 }
391 386
392 } // namespace net 387 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698