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

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

Issue 1133763003: SdchObserver: add OnDictionary{Added,Removed} (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 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
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
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
OLDNEW
« no previous file with comments | « net/base/sdch_manager.cc ('k') | net/base/sdch_observer.h » ('j') | net/base/sdch_observer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698