| OLD | NEW |
| 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 <limits.h> | 5 #include <limits.h> |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #if defined(USE_SYSTEM_ZLIB) | |
| 12 #include <zlib.h> | |
| 13 #else | |
| 14 #include "third_party/zlib/zlib.h" | |
| 15 #endif | |
| 16 | |
| 17 #include "base/logging.h" | 11 #include "base/logging.h" |
| 18 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 19 #include "net/base/filter.h" | 13 #include "net/base/filter.h" |
| 20 #include "net/base/io_buffer.h" | 14 #include "net/base/io_buffer.h" |
| 21 #include "net/base/mock_filter_context.h" | 15 #include "net/base/mock_filter_context.h" |
| 22 #include "net/base/sdch_filter.h" | 16 #include "net/base/sdch_filter.h" |
| 23 #include "net/url_request/url_request_http_job.h" | 17 #include "net/url_request/url_request_http_job.h" |
| 24 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 19 #include "third_party/zlib/zlib.h" |
| 25 | 20 |
| 26 namespace net { | 21 namespace net { |
| 27 | 22 |
| 28 //------------------------------------------------------------------------------ | 23 //------------------------------------------------------------------------------ |
| 29 // Provide sample data and compression results with a sample VCDIFF dictionary. | 24 // Provide sample data and compression results with a sample VCDIFF dictionary. |
| 30 // Note an SDCH dictionary has extra meta-data before the VCDIFF dictionary. | 25 // Note an SDCH dictionary has extra meta-data before the VCDIFF dictionary. |
| 31 static const char kTestVcdiffDictionary[] = "DictionaryFor" | 26 static const char kTestVcdiffDictionary[] = "DictionaryFor" |
| 32 "SdchCompression1SdchCompression2SdchCompression3SdchCompression\n"; | 27 "SdchCompression1SdchCompression2SdchCompression3SdchCompression\n"; |
| 33 // Pre-compression test data. Note that we pad with a lot of highly gzip | 28 // Pre-compression test data. Note that we pad with a lot of highly gzip |
| 34 // compressible content to help to exercise the chaining pipeline. That is why | 29 // compressible content to help to exercise the chaining pipeline. That is why |
| (...skipping 1354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1389 sdch_manager_->SetAllowLatencyExperiment(url, false); | 1384 sdch_manager_->SetAllowLatencyExperiment(url, false); |
| 1390 EXPECT_FALSE(sdch_manager_->AllowLatencyExperiment(url)); | 1385 EXPECT_FALSE(sdch_manager_->AllowLatencyExperiment(url)); |
| 1391 EXPECT_TRUE(sdch_manager_->AllowLatencyExperiment(url2)); | 1386 EXPECT_TRUE(sdch_manager_->AllowLatencyExperiment(url2)); |
| 1392 | 1387 |
| 1393 sdch_manager_->SetAllowLatencyExperiment(url2, false); | 1388 sdch_manager_->SetAllowLatencyExperiment(url2, false); |
| 1394 EXPECT_FALSE(sdch_manager_->AllowLatencyExperiment(url)); | 1389 EXPECT_FALSE(sdch_manager_->AllowLatencyExperiment(url)); |
| 1395 EXPECT_FALSE(sdch_manager_->AllowLatencyExperiment(url2)); | 1390 EXPECT_FALSE(sdch_manager_->AllowLatencyExperiment(url2)); |
| 1396 } | 1391 } |
| 1397 | 1392 |
| 1398 } // namespace net | 1393 } // namespace net |
| OLD | NEW |