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

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

Issue 165016: Linux: add GYP flag to build with system libbz2. (Closed)
Patch Set: Created 11 years, 4 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
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <iostream> 6 #include <iostream>
7 7
8 #if defined(USE_SYSTEM_LIBBZ2)
9 #include <bzlib.h>
10 #else
11 #include "third_party/bzip2/bzlib.h"
12 #endif
13
8 #include "base/file_util.h" 14 #include "base/file_util.h"
9 #include "base/path_service.h" 15 #include "base/path_service.h"
10 #include "base/scoped_ptr.h" 16 #include "base/scoped_ptr.h"
11 #include "net/base/bzip2_filter.h" 17 #include "net/base/bzip2_filter.h"
12 #include "net/base/filter_unittest.h" 18 #include "net/base/filter_unittest.h"
13 #include "net/base/io_buffer.h" 19 #include "net/base/io_buffer.h"
14 #include "testing/gtest/include/gtest/gtest.h" 20 #include "testing/gtest/include/gtest/gtest.h"
15 #include "testing/platform_test.h" 21 #include "testing/platform_test.h"
16 #include "third_party/bzip2/bzlib.h"
17 22
18 namespace { 23 namespace {
19 24
20 const char* kExtraData = "Test Data, More Test Data, Even More Data of Test"; 25 const char* kExtraData = "Test Data, More Test Data, Even More Data of Test";
21 const int kExtraDataBufferSize = 49; 26 const int kExtraDataBufferSize = 49;
22 const int kDefaultBufferSize = 4096; 27 const int kDefaultBufferSize = 4096;
23 const int kSmallBufferSize = 128; 28 const int kSmallBufferSize = 128;
24 const int kMaxBufferSize = 1048576; // 1048576 == 2^20 == 1 MB 29 const int kMaxBufferSize = 1048576; // 1048576 == 2^20 == 1 MB
25 30
26 const char kApplicationOctetStream[] = "application/octet-stream"; 31 const char kApplicationOctetStream[] = "application/octet-stream";
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 DecodeAndCompareWithFilter(filter.get(), 397 DecodeAndCompareWithFilter(filter.get(),
393 source_buffer(), 398 source_buffer(),
394 source_len() + kExtraDataBufferSize, 399 source_len() + kExtraDataBufferSize,
395 more_data, 400 more_data,
396 more_data_len, 401 more_data_len,
397 kDefaultBufferSize, 402 kDefaultBufferSize,
398 true); 403 true);
399 } 404 }
400 405
401 } // namespace 406 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698