| OLD | NEW |
| 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 "chrome/browser/predictors/resource_prefetch_predictor.h" | 5 #include "chrome/browser/predictors/resource_prefetch_predictor.h" |
| 6 | 6 |
| 7 #include <iostream> | 7 #include <iostream> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| 11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
| 14 #include "base/test/histogram_tester.h" | 14 #include "base/test/histogram_tester.h" |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "chrome/browser/history/history_service_factory.h" | 16 #include "chrome/browser/history/history_service_factory.h" |
| 17 #include "chrome/browser/predictors/loading_predictor.h" | 17 #include "chrome/browser/predictors/loading_predictor.h" |
| 18 #include "chrome/browser/predictors/loading_test_util.h" | 18 #include "chrome/browser/predictors/loading_test_util.h" |
| 19 #include "chrome/browser/predictors/resource_prefetch_predictor_tables.h" | 19 #include "chrome/browser/predictors/resource_prefetch_predictor_tables.h" |
| 20 #include "chrome/browser/predictors/resource_prefetcher_manager.h" | |
| 21 #include "chrome/test/base/testing_profile.h" | 20 #include "chrome/test/base/testing_profile.h" |
| 22 #include "components/history/core/browser/history_service.h" | 21 #include "components/history/core/browser/history_service.h" |
| 23 #include "components/history/core/browser/history_types.h" | 22 #include "components/history/core/browser/history_types.h" |
| 24 #include "components/sessions/core/session_id.h" | 23 #include "components/sessions/core/session_id.h" |
| 25 #include "content/public/test/test_browser_thread_bundle.h" | 24 #include "content/public/test/test_browser_thread_bundle.h" |
| 26 #include "net/http/http_response_headers.h" | 25 #include "net/http/http_response_headers.h" |
| 27 #include "net/traffic_annotation/network_traffic_annotation_test_helper.h" | 26 #include "net/traffic_annotation/network_traffic_annotation_test_helper.h" |
| 28 #include "net/url_request/url_request_context.h" | 27 #include "net/url_request/url_request_context.h" |
| 29 #include "net/url_request/url_request_job.h" | 28 #include "net/url_request/url_request_job.h" |
| 30 #include "testing/gmock/include/gmock/gmock.h" | 29 #include "testing/gmock/include/gmock/gmock.h" |
| (...skipping 1697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1728 ResourceData* resource3_rd = host_data.add_resources(); | 1727 ResourceData* resource3_rd = host_data.add_resources(); |
| 1729 InitializeResourceData(resource3_rd, "http://google.com/script2.js", | 1728 InitializeResourceData(resource3_rd, "http://google.com/script2.js", |
| 1730 content::RESOURCE_TYPE_SCRIPT, 1, 0, 0, 3.0, | 1729 content::RESOURCE_TYPE_SCRIPT, 1, 0, 0, 3.0, |
| 1731 net::MEDIUM, false, false); | 1730 net::MEDIUM, false, false); |
| 1732 resource3_rd->set_before_first_contentful_paint(false); | 1731 resource3_rd->set_before_first_contentful_paint(false); |
| 1733 EXPECT_EQ(mock_tables_->host_resource_table_.data_, | 1732 EXPECT_EQ(mock_tables_->host_resource_table_.data_, |
| 1734 PrefetchDataMap({{host_data.primary_key(), host_data}})); | 1733 PrefetchDataMap({{host_data.primary_key(), host_data}})); |
| 1735 } | 1734 } |
| 1736 | 1735 |
| 1737 } // namespace predictors | 1736 } // namespace predictors |
| OLD | NEW |