| 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 "chrome/browser/android/offline_pages/offline_page_utils.h" | 5 #include "chrome/browser/android/offline_pages/offline_page_utils.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/files/file.h" | 12 #include "base/files/file.h" |
| 13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/files/file_util.h" | 14 #include "base/files/file_util.h" |
| 15 #include "base/run_loop.h" | 15 #include "base/run_loop.h" |
| 16 #include "base/strings/string16.h" | 16 #include "base/strings/string16.h" |
| 17 #include "base/test/scoped_feature_list.h" | 17 #include "base/test/scoped_feature_list.h" |
| 18 #include "base/threading/thread_task_runner_handle.h" | 18 #include "base/threading/thread_task_runner_handle.h" |
| 19 #include "base/time/time.h" | 19 #include "base/time/time.h" |
| 20 #include "chrome/browser/android/offline_pages/offline_page_model_factory.h" | 20 #include "chrome/browser/android/offline_pages/offline_page_model_factory.h" |
| 21 #include "chrome/browser/android/offline_pages/request_coordinator_factory.h" | 21 #include "chrome/browser/android/offline_pages/request_coordinator_factory.h" |
| 22 #include "chrome/browser/android/offline_pages/test_offline_page_model_builder.h
" | 22 #include "chrome/browser/android/offline_pages/test_offline_page_model_builder.h
" |
| 23 #include "chrome/browser/android/offline_pages/test_request_coordinator_builder.
h" | 23 #include "chrome/browser/android/offline_pages/test_request_coordinator_builder.
h" |
| 24 #include "chrome/common/chrome_constants.h" | 24 #include "chrome/common/chrome_constants.h" |
| 25 #include "chrome/test/base/testing_profile.h" | 25 #include "chrome/test/base/testing_profile.h" |
| 26 #include "components/offline_pages/background/network_quality_provider_stub.h" | 26 #include "components/offline_pages/core/background/network_quality_provider_stub
.h" |
| 27 #include "components/offline_pages/background/request_coordinator.h" | 27 #include "components/offline_pages/core/background/request_coordinator.h" |
| 28 #include "components/offline_pages/client_namespace_constants.h" | 28 #include "components/offline_pages/core/client_namespace_constants.h" |
| 29 #include "components/offline_pages/offline_page_feature.h" | 29 #include "components/offline_pages/core/offline_page_feature.h" |
| 30 #include "components/offline_pages/offline_page_model.h" | 30 #include "components/offline_pages/core/offline_page_model.h" |
| 31 #include "components/offline_pages/offline_page_test_archiver.h" | 31 #include "components/offline_pages/core/offline_page_test_archiver.h" |
| 32 #include "components/offline_pages/offline_page_test_store.h" | 32 #include "components/offline_pages/core/offline_page_test_store.h" |
| 33 #include "components/offline_pages/offline_page_types.h" | 33 #include "components/offline_pages/core/offline_page_types.h" |
| 34 #include "content/public/test/test_browser_thread_bundle.h" | 34 #include "content/public/test/test_browser_thread_bundle.h" |
| 35 #include "net/base/filename_util.h" | 35 #include "net/base/filename_util.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 namespace { | 40 namespace { |
| 41 | 41 |
| 42 const GURL kTestPage1Url("http://test.org/page1"); | 42 const GURL kTestPage1Url("http://test.org/page1"); |
| 43 const GURL kTestPage2Url("http://test.org/page2"); | 43 const GURL kTestPage2Url("http://test.org/page2"); |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 OfflinePageUtils::CheckExistenceOfRequestsWithURL( | 256 OfflinePageUtils::CheckExistenceOfRequestsWithURL( |
| 257 profile(), kDownloadNamespace, kTestPage1Url, | 257 profile(), kDownloadNamespace, kTestPage1Url, |
| 258 base::Bind(&HasDuplicatesCallback, base::Unretained(&has_duplicates), | 258 base::Bind(&HasDuplicatesCallback, base::Unretained(&has_duplicates), |
| 259 base::Unretained(&latest_saved_time))); | 259 base::Unretained(&latest_saved_time))); |
| 260 RunUntilIdle(); | 260 RunUntilIdle(); |
| 261 EXPECT_FALSE(has_duplicates); | 261 EXPECT_FALSE(has_duplicates); |
| 262 EXPECT_TRUE(latest_saved_time.is_null()); | 262 EXPECT_TRUE(latest_saved_time.is_null()); |
| 263 } | 263 } |
| 264 | 264 |
| 265 } // namespace offline_pages | 265 } // namespace offline_pages |
| OLD | NEW |