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

Side by Side Diff: chrome/browser/predictors/resource_prefetch_common_unittest.cc

Issue 2796783004: predictors: Add origin learning. (Closed)
Patch Set: , Created 3 years, 8 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 <memory> 5 #include <memory>
6 #include <string> 6 #include <string>
7 7
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "chrome/browser/net/prediction_options.h" 10 #include "chrome/browser/net/prediction_options.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 EXPECT_GT(config.min_resource_hits_to_trigger_prefetch, 1U); 66 EXPECT_GT(config.min_resource_hits_to_trigger_prefetch, 1U);
67 } 67 }
68 68
69 void TestIsDefaultExtraConfig(const ResourcePrefetchPredictorConfig& config) { 69 void TestIsDefaultExtraConfig(const ResourcePrefetchPredictorConfig& config) {
70 EXPECT_FALSE(config.IsLowConfidenceForTest()); 70 EXPECT_FALSE(config.IsLowConfidenceForTest());
71 EXPECT_FALSE(config.IsHighConfidenceForTest()); 71 EXPECT_FALSE(config.IsHighConfidenceForTest());
72 EXPECT_FALSE(config.IsMoreResourcesEnabledForTest()); 72 EXPECT_FALSE(config.IsMoreResourcesEnabledForTest());
73 EXPECT_FALSE(config.IsSmallDBEnabledForTest()); 73 EXPECT_FALSE(config.IsSmallDBEnabledForTest());
74 EXPECT_FALSE(config.is_url_learning_enabled); 74 EXPECT_FALSE(config.is_url_learning_enabled);
75 EXPECT_FALSE(config.is_manifests_enabled); 75 EXPECT_FALSE(config.is_manifests_enabled);
76 EXPECT_FALSE(config.is_origin_prediction_enabled);
76 EXPECT_GT(config.min_resource_hits_to_trigger_prefetch, 1U); 77 EXPECT_GT(config.min_resource_hits_to_trigger_prefetch, 1U);
77 } 78 }
78 79
79 protected: 80 protected:
80 base::MessageLoop loop_; 81 base::MessageLoop loop_;
81 content::TestBrowserThread ui_thread_; 82 content::TestBrowserThread ui_thread_;
82 std::unique_ptr<TestingProfile> profile_; 83 std::unique_ptr<TestingProfile> profile_;
83 }; 84 };
84 85
85 ResourcePrefetchCommonTest::ResourcePrefetchCommonTest() 86 ResourcePrefetchCommonTest::ResourcePrefetchCommonTest()
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 TestIsPrefetchLearning(config); 195 TestIsPrefetchLearning(config);
195 } 196 }
196 { 197 {
197 std::unique_ptr<NetworkChangeNotifier> mock( 198 std::unique_ptr<NetworkChangeNotifier> mock(
198 new MockNetworkChangeNotifier4G); 199 new MockNetworkChangeNotifier4G);
199 TestIsPrefetchLearning(config); 200 TestIsPrefetchLearning(config);
200 } 201 }
201 } 202 }
202 203
203 } // namespace predictors 204 } // namespace predictors
OLDNEW
« no previous file with comments | « chrome/browser/predictors/resource_prefetch_common.cc ('k') | chrome/browser/predictors/resource_prefetch_predictor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698