OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/offline_pages/offline_page_model_impl.h" | 5 #include "components/offline_pages/core/offline_page_model_impl.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/feature_list.h" | 13 #include "base/feature_list.h" |
14 #include "base/files/file_util.h" | 14 #include "base/files/file_util.h" |
15 #include "base/files/scoped_temp_dir.h" | 15 #include "base/files/scoped_temp_dir.h" |
16 #include "base/memory/ptr_util.h" | 16 #include "base/memory/ptr_util.h" |
17 #include "base/metrics/statistics_recorder.h" | 17 #include "base/metrics/statistics_recorder.h" |
18 #include "base/run_loop.h" | 18 #include "base/run_loop.h" |
19 #include "base/single_thread_task_runner.h" | 19 #include "base/single_thread_task_runner.h" |
20 #include "base/strings/string_number_conversions.h" | 20 #include "base/strings/string_number_conversions.h" |
21 #include "base/strings/utf_string_conversions.h" | 21 #include "base/strings/utf_string_conversions.h" |
22 #include "base/test/histogram_tester.h" | 22 #include "base/test/histogram_tester.h" |
23 #include "base/test/scoped_feature_list.h" | 23 #include "base/test/scoped_feature_list.h" |
24 #include "base/test/test_mock_time_task_runner.h" | 24 #include "base/test/test_mock_time_task_runner.h" |
25 #include "base/threading/thread_task_runner_handle.h" | 25 #include "base/threading/thread_task_runner_handle.h" |
26 #include "base/time/time.h" | 26 #include "base/time/time.h" |
27 #include "components/offline_pages/client_namespace_constants.h" | 27 #include "components/offline_pages/core/client_namespace_constants.h" |
28 #include "components/offline_pages/client_policy_controller.h" | 28 #include "components/offline_pages/core/client_policy_controller.h" |
29 #include "components/offline_pages/offline_page_client_policy.h" | 29 #include "components/offline_pages/core/offline_page_client_policy.h" |
30 #include "components/offline_pages/offline_page_feature.h" | 30 #include "components/offline_pages/core/offline_page_feature.h" |
31 #include "components/offline_pages/offline_page_item.h" | 31 #include "components/offline_pages/core/offline_page_item.h" |
32 #include "components/offline_pages/offline_page_storage_manager.h" | 32 #include "components/offline_pages/core/offline_page_storage_manager.h" |
33 #include "components/offline_pages/offline_page_test_archiver.h" | 33 #include "components/offline_pages/core/offline_page_test_archiver.h" |
34 #include "components/offline_pages/offline_page_test_store.h" | 34 #include "components/offline_pages/core/offline_page_test_store.h" |
35 #include "components/offline_pages/offline_page_types.h" | 35 #include "components/offline_pages/core/offline_page_types.h" |
36 #include "testing/gtest/include/gtest/gtest.h" | 36 #include "testing/gtest/include/gtest/gtest.h" |
37 #include "url/gurl.h" | 37 #include "url/gurl.h" |
38 | 38 |
39 namespace offline_pages { | 39 namespace offline_pages { |
40 | 40 |
41 namespace { | 41 namespace { |
42 const char kTestClientNamespace[] = "default"; | 42 const char kTestClientNamespace[] = "default"; |
43 const char kUserRequestedNamespace[] = "download"; | 43 const char kUserRequestedNamespace[] = "download"; |
44 const GURL kTestUrl("http://example.com"); | 44 const GURL kTestUrl("http://example.com"); |
45 const GURL kTestUrl2("http://other.page.com"); | 45 const GURL kTestUrl2("http://other.page.com"); |
(...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1307 EXPECT_FALSE(offline_pages::IsOfflinePagesSvelteConcurrentLoadingEnabled()); | 1307 EXPECT_FALSE(offline_pages::IsOfflinePagesSvelteConcurrentLoadingEnabled()); |
1308 | 1308 |
1309 // Check if feature is correctly enabled by command-line flag. | 1309 // Check if feature is correctly enabled by command-line flag. |
1310 base::test::ScopedFeatureList scoped_feature_list; | 1310 base::test::ScopedFeatureList scoped_feature_list; |
1311 scoped_feature_list.InitAndEnableFeature( | 1311 scoped_feature_list.InitAndEnableFeature( |
1312 kOfflinePagesSvelteConcurrentLoadingFeature); | 1312 kOfflinePagesSvelteConcurrentLoadingFeature); |
1313 EXPECT_TRUE(offline_pages::IsOfflinePagesSvelteConcurrentLoadingEnabled()); | 1313 EXPECT_TRUE(offline_pages::IsOfflinePagesSvelteConcurrentLoadingEnabled()); |
1314 } | 1314 } |
1315 | 1315 |
1316 } // namespace offline_pages | 1316 } // namespace offline_pages |
OLD | NEW |