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

Side by Side Diff: chrome/browser/net/sdch_browsertest.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
« no previous file with comments | « no previous file | net/base/sdch_manager.cc » ('j') | net/base/sdch_manager_unittest.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // End-to-end SDCH tests. Uses the embedded test server to return SDCH 5 // End-to-end SDCH tests. Uses the embedded test server to return SDCH
6 // results 6 // results
7 7
8 #include "base/base64.h" 8 #include "base/base64.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 void UnsubscribeFromAllSdchNotifications() { 604 void UnsubscribeFromAllSdchNotifications() {
605 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); 605 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
606 606
607 for (auto it = fetch_counts_.begin(); it != fetch_counts_.end(); ++it) 607 for (auto it = fetch_counts_.begin(); it != fetch_counts_.end(); ++it)
608 it->first->RemoveObserver(this); 608 it->first->RemoveObserver(this);
609 609
610 fetch_counts_.clear(); 610 fetch_counts_.clear();
611 } 611 }
612 612
613 // SdchObserver 613 // SdchObserver
614 void OnDictionaryAdded(net::SdchManager* manager,
615 const GURL& dictionary_url,
616 const std::string& server_hash) override {}
617 void OnDictionaryRemoved(net::SdchManager* manager,
618 const std::string& server_hash) override {}
614 void OnDictionaryUsed(net::SdchManager* manager, 619 void OnDictionaryUsed(net::SdchManager* manager,
615 const std::string& server_hash) override {} 620 const std::string& server_hash) override {}
616 621
617 void OnGetDictionary(net::SdchManager* manager, 622 void OnGetDictionary(net::SdchManager* manager,
618 const GURL& request_url, 623 const GURL& request_url,
619 const GURL& dictionary_url) override { 624 const GURL& dictionary_url) override {
620 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); 625 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
621 DLOG(ERROR) << "Retrieving count of notifications from manager " << manager; 626 DLOG(ERROR) << "Retrieving count of notifications from manager " << manager;
622 DCHECK(fetch_counts_.end() != fetch_counts_.find(manager)); 627 DCHECK(fetch_counts_.end() != fetch_counts_.find(manager));
623 ++fetch_counts_[manager]; 628 ++fetch_counts_[manager];
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 ASSERT_TRUE(SetupIncognitoBrowser()); 700 ASSERT_TRUE(SetupIncognitoBrowser());
696 ASSERT_TRUE(ForceSdchDictionaryLoad(incognito_browser())); 701 ASSERT_TRUE(ForceSdchDictionaryLoad(incognito_browser()));
697 702
698 // Data fetches on main browser should not be SDCH encoded. 703 // Data fetches on main browser should not be SDCH encoded.
699 bool sdch_encoding_used = true; 704 bool sdch_encoding_used = true;
700 ASSERT_TRUE(GetData(&sdch_encoding_used)); 705 ASSERT_TRUE(GetData(&sdch_encoding_used));
701 EXPECT_FALSE(sdch_encoding_used); 706 EXPECT_FALSE(sdch_encoding_used);
702 } 707 }
703 708
704 } // namespace 709 } // namespace
OLDNEW
« no previous file with comments | « no previous file | net/base/sdch_manager.cc » ('j') | net/base/sdch_manager_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698