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

Side by Side Diff: net/filter/sdch_filter_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 <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after
1238 // SdchObserver 1238 // SdchObserver
1239 void OnDictionaryUsed(SdchManager* manager, 1239 void OnDictionaryUsed(SdchManager* manager,
1240 const std::string& server_hash) override { 1240 const std::string& server_hash) override {
1241 dictionary_used_++; 1241 dictionary_used_++;
1242 last_server_hash_ = server_hash; 1242 last_server_hash_ = server_hash;
1243 } 1243 }
1244 1244
1245 int dictionary_used_calls() const { return dictionary_used_; } 1245 int dictionary_used_calls() const { return dictionary_used_; }
1246 std::string last_server_hash() const { return last_server_hash_; } 1246 std::string last_server_hash() const { return last_server_hash_; }
1247 1247
1248 void OnDictionaryAdded(SdchManager* /* manager */,
1249 const GURL& /* dictionary_url */,
1250 const std::string& /* server_hash */) override {}
1251 void OnDictionaryRemoved(SdchManager* /* manager */,
1252 const std::string& /* server_hash */) override {}
1248 void OnGetDictionary(SdchManager* /* manager */, 1253 void OnGetDictionary(SdchManager* /* manager */,
1249 const GURL& /* request_url */, 1254 const GURL& /* request_url */,
1250 const GURL& /* dictionary_url */) override {} 1255 const GURL& /* dictionary_url */) override {}
1251 void OnClearDictionaries(SdchManager* /* manager */) override {} 1256 void OnClearDictionaries(SdchManager* /* manager */) override {}
1252 1257
1253 private: 1258 private:
1254 int dictionary_used_; 1259 int dictionary_used_;
1255 std::string last_server_hash_; 1260 std::string last_server_hash_;
1256 SdchManager* manager_; 1261 SdchManager* manager_;
1257 1262
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
1291 1296
1292 filter.reset(nullptr); 1297 filter.reset(nullptr);
1293 1298
1294 // Confirm that we got a "DictionaryUsed" signal from the SdchManager 1299 // Confirm that we got a "DictionaryUsed" signal from the SdchManager
1295 // for our dictionary. 1300 // for our dictionary.
1296 EXPECT_EQ(1, observer.dictionary_used_calls()); 1301 EXPECT_EQ(1, observer.dictionary_used_calls());
1297 EXPECT_EQ(server_hash, observer.last_server_hash()); 1302 EXPECT_EQ(server_hash, observer.last_server_hash());
1298 } 1303 }
1299 1304
1300 } // namespace net 1305 } // namespace net
OLDNEW
« net/base/sdch_observer.h ('K') | « net/base/sdch_observer.h ('k') | net/sdch/sdch_owner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698