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

Unified Diff: chrome/browser/net/predictor.h

Issue 1989363007: Move predictor dns unit tests to browser tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: eroman@ review Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/net/predictor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/predictor.h
diff --git a/chrome/browser/net/predictor.h b/chrome/browser/net/predictor.h
index f9aa90a6a0e1c6b0e1c649f4cea82c77011999b1..300e341ca52b1eb2c869d7f434f91d4db4795870 100644
--- a/chrome/browser/net/predictor.h
+++ b/chrome/browser/net/predictor.h
@@ -79,6 +79,8 @@ class PredictorObserver {
int count) {}
virtual void OnLearnFromNavigation(const GURL& referring_url,
const GURL& target_url) {}
+
+ virtual void OnDnsLookupFinished(const GURL& url, bool found) {}
};
// Predictor is constructed during Profile construction (on the UI thread),
@@ -317,11 +319,6 @@ class Predictor {
}
private:
- FRIEND_TEST_ALL_PREFIXES(PredictorTest, BenefitLookupTest);
- FRIEND_TEST_ALL_PREFIXES(PredictorTest, ShutdownWhenResolutionIsPendingTest);
- FRIEND_TEST_ALL_PREFIXES(PredictorTest, SingleLookupTest);
- FRIEND_TEST_ALL_PREFIXES(PredictorTest, ConcurrentLookupTest);
- FRIEND_TEST_ALL_PREFIXES(PredictorTest, MassiveConcurrentLookupTest);
FRIEND_TEST_ALL_PREFIXES(PredictorTest, PriorityQueuePushPopTest);
FRIEND_TEST_ALL_PREFIXES(PredictorTest, PriorityQueueReorderTest);
FRIEND_TEST_ALL_PREFIXES(PredictorTest, ReferrerSerializationTrimTest);
@@ -333,6 +330,7 @@ class Predictor {
FRIEND_TEST_ALL_PREFIXES(PredictorTest, ProxyDefinitelyNotEnabled);
FRIEND_TEST_ALL_PREFIXES(PredictorTest, ProxyMaybeEnabled);
friend class WaitForResolutionHelper; // For testing.
+ friend class PredictorBrowserTest;
class LookupRequest;
@@ -423,25 +421,6 @@ class Predictor {
// Number of referring URLs processed in an incremental trimming.
static const size_t kUrlsTrimmedPerIncrement;
- // Only for testing. Returns true if hostname has been successfully resolved
- // (name found).
- bool WasFound(const GURL& url) const {
- Results::const_iterator it(results_.find(url));
- return (it != results_.end()) &&
- it->second.was_found();
- }
-
- // Only for testing. Return how long was the resolution
- // or UrlInfo::NullDuration() if it hasn't been resolved yet.
- base::TimeDelta GetResolutionDuration(const GURL& url) {
- if (results_.find(url) == results_.end())
- return UrlInfo::NullDuration();
- return results_[url].resolve_duration();
- }
-
- // Only for testing;
- size_t peak_pending_lookups() const { return peak_pending_lookups_; }
-
// These two members call the appropriate global functions in
// prediction_options.cc depending on which thread they are called on.
virtual bool CanPrefetchAndPrerender() const;
« no previous file with comments | « no previous file | chrome/browser/net/predictor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698