| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <sstream> | 6 #include <sstream> |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "components/dom_distiller/core/article_entry.h" | 21 #include "components/dom_distiller/core/article_entry.h" |
| 22 #include "components/dom_distiller/core/distilled_page_prefs.h" | 22 #include "components/dom_distiller/core/distilled_page_prefs.h" |
| 23 #include "components/dom_distiller/core/distiller.h" | 23 #include "components/dom_distiller/core/distiller.h" |
| 24 #include "components/dom_distiller/core/dom_distiller_service.h" | 24 #include "components/dom_distiller/core/dom_distiller_service.h" |
| 25 #include "components/dom_distiller/core/dom_distiller_store.h" | 25 #include "components/dom_distiller/core/dom_distiller_store.h" |
| 26 #include "components/dom_distiller/core/proto/distilled_article.pb.h" | 26 #include "components/dom_distiller/core/proto/distilled_article.pb.h" |
| 27 #include "components/dom_distiller/core/proto/distilled_page.pb.h" | 27 #include "components/dom_distiller/core/proto/distilled_page.pb.h" |
| 28 #include "components/dom_distiller/core/task_tracker.h" | 28 #include "components/dom_distiller/core/task_tracker.h" |
| 29 #include "components/leveldb_proto/proto_database.h" | 29 #include "components/leveldb_proto/proto_database.h" |
| 30 #include "components/leveldb_proto/proto_database_impl.h" | 30 #include "components/leveldb_proto/proto_database_impl.h" |
| 31 #include "components/pref_registry/testing_pref_service_syncable.h" | 31 #include "components/sync_preferences/testing_pref_service_syncable.h" |
| 32 #include "content/public/browser/browser_context.h" | 32 #include "content/public/browser/browser_context.h" |
| 33 #include "content/public/browser/browser_thread.h" | 33 #include "content/public/browser/browser_thread.h" |
| 34 #include "content/public/browser/storage_partition.h" | 34 #include "content/public/browser/storage_partition.h" |
| 35 #include "content/public/common/isolated_world_ids.h" | 35 #include "content/public/common/isolated_world_ids.h" |
| 36 #include "content/public/test/content_browser_test.h" | 36 #include "content/public/test/content_browser_test.h" |
| 37 #include "content/shell/browser/shell.h" | 37 #include "content/shell/browser/shell.h" |
| 38 #include "google/protobuf/io/coded_stream.h" | 38 #include "google/protobuf/io/coded_stream.h" |
| 39 #include "google/protobuf/io/zero_copy_stream_impl_lite.h" | 39 #include "google/protobuf/io/zero_copy_stream_impl_lite.h" |
| 40 #include "net/dns/mock_host_resolver.h" | 40 #include "net/dns/mock_host_resolver.h" |
| 41 #include "third_party/dom_distiller_js/dom_distiller.pb.h" | 41 #include "third_party/dom_distiller_js/dom_distiller.pb.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 options.set_pagination_algo( | 164 options.set_pagination_algo( |
| 165 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 165 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 166 kPaginationAlgo)); | 166 kPaginationAlgo)); |
| 167 } | 167 } |
| 168 | 168 |
| 169 std::unique_ptr<DistillerFactory> distiller_factory( | 169 std::unique_ptr<DistillerFactory> distiller_factory( |
| 170 new TestDistillerFactoryImpl(std::move(distiller_url_fetcher_factory), | 170 new TestDistillerFactoryImpl(std::move(distiller_url_fetcher_factory), |
| 171 options, file_to_url_map)); | 171 options, file_to_url_map)); |
| 172 | 172 |
| 173 // Setting up PrefService for DistilledPagePrefs. | 173 // Setting up PrefService for DistilledPagePrefs. |
| 174 user_prefs::TestingPrefServiceSyncable* pref_service = | 174 sync_preferences::TestingPrefServiceSyncable* pref_service = |
| 175 new user_prefs::TestingPrefServiceSyncable(); | 175 new sync_preferences::TestingPrefServiceSyncable(); |
| 176 DistilledPagePrefs::RegisterProfilePrefs(pref_service->registry()); | 176 DistilledPagePrefs::RegisterProfilePrefs(pref_service->registry()); |
| 177 | 177 |
| 178 return std::unique_ptr<DomDistillerService>(new DomDistillerService( | 178 return std::unique_ptr<DomDistillerService>(new DomDistillerService( |
| 179 std::move(dom_distiller_store), std::move(distiller_factory), | 179 std::move(dom_distiller_store), std::move(distiller_factory), |
| 180 std::move(distiller_page_factory), | 180 std::move(distiller_page_factory), |
| 181 std::unique_ptr<DistilledPagePrefs>( | 181 std::unique_ptr<DistilledPagePrefs>( |
| 182 new DistilledPagePrefs(pref_service)))); | 182 new DistilledPagePrefs(pref_service)))); |
| 183 } | 183 } |
| 184 | 184 |
| 185 void AddComponentsTestResources() { | 185 void AddComponentsTestResources() { |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 protobuf_output_stream_; | 438 protobuf_output_stream_; |
| 439 }; | 439 }; |
| 440 | 440 |
| 441 IN_PROC_BROWSER_TEST_F(ContentExtractor, MANUAL_ExtractUrl) { | 441 IN_PROC_BROWSER_TEST_F(ContentExtractor, MANUAL_ExtractUrl) { |
| 442 SetDistillerJavaScriptWorldId(content::ISOLATED_WORLD_ID_CONTENT_END); | 442 SetDistillerJavaScriptWorldId(content::ISOLATED_WORLD_ID_CONTENT_END); |
| 443 Start(); | 443 Start(); |
| 444 base::RunLoop().Run(); | 444 base::RunLoop().Run(); |
| 445 } | 445 } |
| 446 | 446 |
| 447 } // namespace dom_distiller | 447 } // namespace dom_distiller |
| OLD | NEW |