OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "net/base/sdch_manager.h" | 5 #include "net/base/sdch_manager.h" |
6 | 6 |
7 #include <limits.h> | 7 #include <limits.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
15 #include "base/test/simple_test_clock.h" | 15 #include "base/test/simple_test_clock.h" |
16 #include "net/base/sdch_observer.h" | 16 #include "net/base/sdch_observer.h" |
17 #include "net/log/net_log.h" | |
18 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
19 #include "url/gurl.h" | 18 #include "url/gurl.h" |
20 | 19 |
21 namespace net { | 20 namespace net { |
22 | 21 |
23 //------------------------------------------------------------------------------ | 22 //------------------------------------------------------------------------------ |
24 // Provide sample data and compression results with a sample VCDIFF dictionary. | 23 // Provide sample data and compression results with a sample VCDIFF dictionary. |
25 // Note an SDCH dictionary has extra meta-data before the VCDIFF dictionary. | 24 // Note an SDCH dictionary has extra meta-data before the VCDIFF dictionary. |
26 static const char kTestVcdiffDictionary[] = "DictionaryFor" | 25 static const char kTestVcdiffDictionary[] = "DictionaryFor" |
27 "SdchCompression1SdchCompression2SdchCompression3SdchCompression\n"; | 26 "SdchCompression1SdchCompression2SdchCompression3SdchCompression\n"; |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 EXPECT_EQ(server_hash, observer.last_server_hash()); | 630 EXPECT_EQ(server_hash, observer.last_server_hash()); |
632 | 631 |
633 EXPECT_EQ(SDCH_OK, sdch_manager()->RemoveSdchDictionary(server_hash)); | 632 EXPECT_EQ(SDCH_OK, sdch_manager()->RemoveSdchDictionary(server_hash)); |
634 EXPECT_EQ(1, observer.dictionary_removed_notifications()); | 633 EXPECT_EQ(1, observer.dictionary_removed_notifications()); |
635 EXPECT_EQ(server_hash, observer.last_server_hash()); | 634 EXPECT_EQ(server_hash, observer.last_server_hash()); |
636 | 635 |
637 sdch_manager()->RemoveObserver(&observer); | 636 sdch_manager()->RemoveObserver(&observer); |
638 } | 637 } |
639 | 638 |
640 } // namespace net | 639 } // namespace net |
OLD | NEW |