| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <queue> | 5 #include <queue> |
| 6 #include <set> | 6 #include <set> |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| 11 #include "base/files/scoped_temp_dir.h" | 11 #include "base/files/scoped_temp_dir.h" |
| 12 #include "base/guid.h" | 12 #include "base/guid.h" |
| 13 #include "base/location.h" | 13 #include "base/location.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/path_service.h" | 15 #include "base/path_service.h" |
| 16 #include "base/process/process.h" | 16 #include "base/process/process.h" |
| 17 #include "base/run_loop.h" | 17 #include "base/run_loop.h" |
| 18 #include "base/single_thread_task_runner.h" | 18 #include "base/single_thread_task_runner.h" |
| 19 #include "base/strings/string_number_conversions.h" | 19 #include "base/strings/string_number_conversions.h" |
| 20 #include "base/strings/stringprintf.h" | 20 #include "base/strings/stringprintf.h" |
| 21 #include "base/strings/utf_string_conversions.h" | 21 #include "base/strings/utf_string_conversions.h" |
| 22 #include "base/threading/thread_restrictions.h" | 22 #include "base/threading/thread_restrictions.h" |
| 23 #include "base/threading/thread_task_runner_handle.h" | 23 #include "base/threading/thread_task_runner_handle.h" |
| 24 #include "build/build_config.h" | 24 #include "build/build_config.h" |
| 25 #include "chrome/app/chrome_command_ids.h" | 25 #include "chrome/app/chrome_command_ids.h" |
| 26 #include "chrome/browser/apps/app_browsertest_util.h" | 26 #include "chrome/browser/apps/app_browsertest_util.h" |
| 27 #include "chrome/browser/chrome_content_browser_client.h" | 27 #include "chrome/browser/chrome_content_browser_client.h" |
| 28 #include "chrome/browser/chrome_notification_types.h" | 28 #include "chrome/browser/chrome_notification_types.h" |
| 29 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 29 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
| 30 #include "chrome/browser/download/download_core_service.h" |
| 31 #include "chrome/browser/download/download_core_service_factory.h" |
| 30 #include "chrome/browser/download/download_history.h" | 32 #include "chrome/browser/download/download_history.h" |
| 31 #include "chrome/browser/download/download_prefs.h" | 33 #include "chrome/browser/download/download_prefs.h" |
| 32 #include "chrome/browser/download/download_service.h" | |
| 33 #include "chrome/browser/download/download_service_factory.h" | |
| 34 #include "chrome/browser/lifetime/application_lifetime.h" | 34 #include "chrome/browser/lifetime/application_lifetime.h" |
| 35 #include "chrome/browser/pdf/pdf_extension_test_util.h" | 35 #include "chrome/browser/pdf/pdf_extension_test_util.h" |
| 36 #include "chrome/browser/prerender/prerender_link_manager.h" | 36 #include "chrome/browser/prerender/prerender_link_manager.h" |
| 37 #include "chrome/browser/prerender/prerender_link_manager_factory.h" | 37 #include "chrome/browser/prerender/prerender_link_manager_factory.h" |
| 38 #include "chrome/browser/profiles/profile.h" | 38 #include "chrome/browser/profiles/profile.h" |
| 39 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" | 39 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" |
| 40 #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_uti
l.h" | 40 #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_uti
l.h" |
| 41 #include "chrome/browser/task_manager/task_manager_browsertest_util.h" | 41 #include "chrome/browser/task_manager/task_manager_browsertest_util.h" |
| 42 #include "chrome/browser/ui/browser.h" | 42 #include "chrome/browser/ui/browser.h" |
| 43 #include "chrome/browser/ui/browser_commands.h" | 43 #include "chrome/browser/ui/browser_commands.h" |
| (...skipping 2592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2636 response->set_code(status_codes->front()); | 2636 response->set_code(status_codes->front()); |
| 2637 response->set_content_type("application/octet-stream"); | 2637 response->set_content_type("application/octet-stream"); |
| 2638 response->set_content(cookie_to_expect); | 2638 response->set_content(cookie_to_expect); |
| 2639 status_codes->pop(); | 2639 status_codes->pop(); |
| 2640 return std::move(response); | 2640 return std::move(response); |
| 2641 } | 2641 } |
| 2642 | 2642 |
| 2643 class DownloadHistoryWaiter : public DownloadHistory::Observer { | 2643 class DownloadHistoryWaiter : public DownloadHistory::Observer { |
| 2644 public: | 2644 public: |
| 2645 explicit DownloadHistoryWaiter(content::BrowserContext* browser_context) { | 2645 explicit DownloadHistoryWaiter(content::BrowserContext* browser_context) { |
| 2646 DownloadService* service = | 2646 DownloadCoreService* service = |
| 2647 DownloadServiceFactory::GetForBrowserContext(browser_context); | 2647 DownloadCoreServiceFactory::GetForBrowserContext(browser_context); |
| 2648 download_history_ = service->GetDownloadHistory(); | 2648 download_history_ = service->GetDownloadHistory(); |
| 2649 download_history_->AddObserver(this); | 2649 download_history_->AddObserver(this); |
| 2650 } | 2650 } |
| 2651 | 2651 |
| 2652 ~DownloadHistoryWaiter() override { download_history_->RemoveObserver(this); } | 2652 ~DownloadHistoryWaiter() override { download_history_->RemoveObserver(this); } |
| 2653 | 2653 |
| 2654 void WaitForStored(size_t download_count) { | 2654 void WaitForStored(size_t download_count) { |
| 2655 if (stored_downloads_.size() >= download_count) | 2655 if (stored_downloads_.size() >= download_count) |
| 2656 return; | 2656 return; |
| 2657 stored_download_target_ = download_count; | 2657 stored_download_target_ = download_count; |
| (...skipping 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4140 ClosingChromeSignInShouldNotCrash) { | 4140 ClosingChromeSignInShouldNotCrash) { |
| 4141 GURL signin_url{"chrome://chrome-signin"}; | 4141 GURL signin_url{"chrome://chrome-signin"}; |
| 4142 | 4142 |
| 4143 AddTabAtIndex(0, signin_url, ui::PAGE_TRANSITION_TYPED); | 4143 AddTabAtIndex(0, signin_url, ui::PAGE_TRANSITION_TYPED); |
| 4144 AddTabAtIndex(1, signin_url, ui::PAGE_TRANSITION_TYPED); | 4144 AddTabAtIndex(1, signin_url, ui::PAGE_TRANSITION_TYPED); |
| 4145 WaitForWebViewInDom(); | 4145 WaitForWebViewInDom(); |
| 4146 | 4146 |
| 4147 chrome::CloseTab(browser()); | 4147 chrome::CloseTab(browser()); |
| 4148 } | 4148 } |
| 4149 #endif | 4149 #endif |
| OLD | NEW |