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 <limits.h> | 5 #include <limits.h> |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 const GURL& last_dictionary_url() const { return last_dictionary_url_; } | 43 const GURL& last_dictionary_url() const { return last_dictionary_url_; } |
44 int get_dictionary_notifications() const { | 44 int get_dictionary_notifications() const { |
45 return get_dictionary_notifications_; | 45 return get_dictionary_notifications_; |
46 } | 46 } |
47 | 47 |
48 int clear_dictionary_notifications() const { | 48 int clear_dictionary_notifications() const { |
49 return clear_dictionaries_notifications_; | 49 return clear_dictionaries_notifications_; |
50 } | 50 } |
51 | 51 |
52 // SdchObserver implementation | 52 // SdchObserver implementation |
53 void OnDictionaryAdded(SdchManager* /* manager */, | |
54 const GURL& /* dictionary_url */, | |
55 const std::string& /* server_hash */) override {} | |
56 void OnDictionaryRemoved(SdchManager* /* manager */, | |
57 const std::string& /* server_hash */) override {} | |
mmenke
2015/05/12 15:46:42
Should have at least a minimal test for these meth
| |
53 void OnDictionaryUsed(SdchManager* manager, | 58 void OnDictionaryUsed(SdchManager* manager, |
54 const std::string& server_hash) override { | 59 const std::string& server_hash) override { |
55 last_server_hash_ = server_hash; | 60 last_server_hash_ = server_hash; |
56 ++dictionary_used_notifications_; | 61 ++dictionary_used_notifications_; |
57 } | 62 } |
58 | 63 |
59 void OnGetDictionary(SdchManager* manager, | 64 void OnGetDictionary(SdchManager* manager, |
60 const GURL& request_url, | 65 const GURL& request_url, |
61 const GURL& dictionary_url) override { | 66 const GURL& dictionary_url) override { |
62 ++get_dictionary_notifications_; | 67 ++get_dictionary_notifications_; |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
637 | 642 |
638 sdch_manager()->RemoveObserver(&observer); | 643 sdch_manager()->RemoveObserver(&observer); |
639 EXPECT_EQ(1, observer.dictionary_used_notifications()); | 644 EXPECT_EQ(1, observer.dictionary_used_notifications()); |
640 EXPECT_EQ("xyzzy", observer.last_server_hash()); | 645 EXPECT_EQ("xyzzy", observer.last_server_hash()); |
641 sdch_manager()->OnDictionaryUsed("plugh"); | 646 sdch_manager()->OnDictionaryUsed("plugh"); |
642 EXPECT_EQ(1, observer.dictionary_used_notifications()); | 647 EXPECT_EQ(1, observer.dictionary_used_notifications()); |
643 EXPECT_EQ("xyzzy", observer.last_server_hash()); | 648 EXPECT_EQ("xyzzy", observer.last_server_hash()); |
644 } | 649 } |
645 | 650 |
646 } // namespace net | 651 } // namespace net |
OLD | NEW |