| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "chrome/browser/predictors/loading_predictor.h" | 5 #include "chrome/browser/predictors/loading_predictor.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
| 12 #include "base/test/histogram_tester.h" | 12 #include "base/test/histogram_tester.h" |
| 13 #include "chrome/browser/predictors/resource_prefetch_predictor_test_util.h" | 13 #include "chrome/browser/predictors/loading_test_util.h" |
| 14 #include "chrome/test/base/testing_profile.h" | 14 #include "chrome/test/base/testing_profile.h" |
| 15 #include "content/public/test/test_browser_thread_bundle.h" | 15 #include "content/public/test/test_browser_thread_bundle.h" |
| 16 #include "testing/gmock/include/gmock/gmock.h" | 16 #include "testing/gmock/include/gmock/gmock.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 18 | 18 |
| 19 namespace predictors { | 19 namespace predictors { |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 // First two are prefetchable, last one is not (see SetUp()). | 22 // First two are prefetchable, last one is not (see SetUp()). |
| 23 const char kUrl[] = "http://www.google.com/cats"; | 23 const char kUrl[] = "http://www.google.com/cats"; |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 EXPECT_EQ(start_time, it->second); | 210 EXPECT_EQ(start_time, it->second); |
| 211 } | 211 } |
| 212 | 212 |
| 213 TEST_F(LoadingPredictorTest, TestDontTrackNonPrefetchableUrls) { | 213 TEST_F(LoadingPredictorTest, TestDontTrackNonPrefetchableUrls) { |
| 214 const GURL url3 = GURL(kUrl3); | 214 const GURL url3 = GURL(kUrl3); |
| 215 predictor_->PrepareForPageLoad(url3, HintOrigin::EXTERNAL); | 215 predictor_->PrepareForPageLoad(url3, HintOrigin::EXTERNAL); |
| 216 EXPECT_TRUE(predictor_->active_hints_.empty()); | 216 EXPECT_TRUE(predictor_->active_hints_.empty()); |
| 217 } | 217 } |
| 218 | 218 |
| 219 } // namespace predictors | 219 } // namespace predictors |
| OLD | NEW |