OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <iostream> | 5 #include <iostream> |
6 #include "base/memory/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 PrefetchKeyType key_type)); | 67 PrefetchKeyType key_type)); |
68 MOCK_METHOD0(DeleteAllData, void()); | 68 MOCK_METHOD0(DeleteAllData, void()); |
69 | 69 |
70 protected: | 70 protected: |
71 ~MockResourcePrefetchPredictorTables() { } | 71 ~MockResourcePrefetchPredictorTables() { } |
72 }; | 72 }; |
73 | 73 |
74 class ResourcePrefetchPredictorTest : public testing::Test { | 74 class ResourcePrefetchPredictorTest : public testing::Test { |
75 public: | 75 public: |
76 ResourcePrefetchPredictorTest(); | 76 ResourcePrefetchPredictorTest(); |
77 ~ResourcePrefetchPredictorTest(); | 77 virtual ~ResourcePrefetchPredictorTest(); |
78 void SetUp() OVERRIDE; | 78 virtual void SetUp() OVERRIDE; |
79 void TearDown() OVERRIDE; | 79 virtual void TearDown() OVERRIDE; |
80 | 80 |
81 protected: | 81 protected: |
82 void AddUrlToHistory(const std::string& url, int visit_count) { | 82 void AddUrlToHistory(const std::string& url, int visit_count) { |
83 HistoryServiceFactory::GetForProfile(profile_.get(), | 83 HistoryServiceFactory::GetForProfile(profile_.get(), |
84 Profile::EXPLICIT_ACCESS)-> | 84 Profile::EXPLICIT_ACCESS)-> |
85 AddPageWithDetails( | 85 AddPageWithDetails( |
86 GURL(url), | 86 GURL(url), |
87 string16(), | 87 string16(), |
88 visit_count, | 88 visit_count, |
89 0, | 89 0, |
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 predictor_->inflight_navigations_[main_frame1.navigation_id]->at(0))); | 756 predictor_->inflight_navigations_[main_frame1.navigation_id]->at(0))); |
757 EXPECT_TRUE(URLRequestSummaryAreEqual( | 757 EXPECT_TRUE(URLRequestSummaryAreEqual( |
758 resource2, | 758 resource2, |
759 predictor_->inflight_navigations_[main_frame1.navigation_id]->at(1))); | 759 predictor_->inflight_navigations_[main_frame1.navigation_id]->at(1))); |
760 EXPECT_TRUE(URLRequestSummaryAreEqual( | 760 EXPECT_TRUE(URLRequestSummaryAreEqual( |
761 resource3, | 761 resource3, |
762 predictor_->inflight_navigations_[main_frame1.navigation_id]->at(2))); | 762 predictor_->inflight_navigations_[main_frame1.navigation_id]->at(2))); |
763 } | 763 } |
764 | 764 |
765 } // namespace predictors | 765 } // namespace predictors |
OLD | NEW |