OLD | NEW |
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 <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) | 11 #if defined(USE_SYSTEM_ZLIB) |
12 #include <zlib.h> | 12 #include <zlib.h> |
13 #else | 13 #else |
14 #include "third_party/zlib/zlib.h" | 14 #include "third_party/zlib/zlib.h" |
15 #endif | 15 #endif |
16 | 16 |
17 #include "base/logging.h" | 17 #include "base/logging.h" |
18 #include "base/scoped_ptr.h" | 18 #include "base/scoped_ptr.h" |
19 #include "net/base/filter.h" | 19 #include "net/base/filter.h" |
20 #include "net/base/filter_unittest.h" | 20 #include "net/base/filter_unittest.h" |
21 #include "net/base/io_buffer.h" | 21 #include "net/base/io_buffer.h" |
22 #include "net/base/sdch_filter.h" | 22 #include "net/base/sdch_filter.h" |
23 #include "net/url_request/url_request_http_job.cc" | 23 #include "net/url_request/url_request_http_job.h" |
24 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
25 | 25 |
26 //------------------------------------------------------------------------------ | 26 //------------------------------------------------------------------------------ |
27 // Provide sample data and compression results with a sample VCDIFF dictionary. | 27 // Provide sample data and compression results with a sample VCDIFF dictionary. |
28 // Note an SDCH dictionary has extra meta-data before the VCDIFF dictionary. | 28 // Note an SDCH dictionary has extra meta-data before the VCDIFF dictionary. |
29 static const char kTestVcdiffDictionary[] = "DictionaryFor" | 29 static const char kTestVcdiffDictionary[] = "DictionaryFor" |
30 "SdchCompression1SdchCompression2SdchCompression3SdchCompression\n"; | 30 "SdchCompression1SdchCompression2SdchCompression3SdchCompression\n"; |
31 // Pre-compression test data. Note that we pad with a lot of highly gzip | 31 // Pre-compression test data. Note that we pad with a lot of highly gzip |
32 // compressible content to help to exercise the chaining pipeline. That is why | 32 // compressible content to help to exercise the chaining pipeline. That is why |
33 // there are a PILE of zeros at the start and end. | 33 // there are a PILE of zeros at the start and end. |
(...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1397 | 1397 |
1398 // And can reset them to false. | 1398 // And can reset them to false. |
1399 sdch_manager_->SetAllowLatencyExperiment(url, false); | 1399 sdch_manager_->SetAllowLatencyExperiment(url, false); |
1400 EXPECT_FALSE(sdch_manager_->AllowLatencyExperiment(url)); | 1400 EXPECT_FALSE(sdch_manager_->AllowLatencyExperiment(url)); |
1401 EXPECT_TRUE(sdch_manager_->AllowLatencyExperiment(url2)); | 1401 EXPECT_TRUE(sdch_manager_->AllowLatencyExperiment(url2)); |
1402 | 1402 |
1403 sdch_manager_->SetAllowLatencyExperiment(url2, false); | 1403 sdch_manager_->SetAllowLatencyExperiment(url2, false); |
1404 EXPECT_FALSE(sdch_manager_->AllowLatencyExperiment(url)); | 1404 EXPECT_FALSE(sdch_manager_->AllowLatencyExperiment(url)); |
1405 EXPECT_FALSE(sdch_manager_->AllowLatencyExperiment(url2)); | 1405 EXPECT_FALSE(sdch_manager_->AllowLatencyExperiment(url2)); |
1406 } | 1406 } |
OLD | NEW |