OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 #include "chrome/common/url_constants.h" | 33 #include "chrome/common/url_constants.h" |
34 #include "chrome/test/base/in_process_browser_test.h" | 34 #include "chrome/test/base/in_process_browser_test.h" |
35 #include "chrome/test/base/ui_test_utils.h" | 35 #include "chrome/test/base/ui_test_utils.h" |
36 #include "components/history/core/browser/download_constants.h" | 36 #include "components/history/core/browser/download_constants.h" |
37 #include "components/history/core/browser/download_row.h" | 37 #include "components/history/core/browser/download_row.h" |
38 #include "content/public/browser/download_item.h" | 38 #include "content/public/browser/download_item.h" |
39 #include "content/public/browser/download_manager.h" | 39 #include "content/public/browser/download_manager.h" |
40 #include "content/public/browser/notification_service.h" | 40 #include "content/public/browser/notification_service.h" |
41 #include "content/public/browser/notification_types.h" | 41 #include "content/public/browser/notification_types.h" |
42 #include "content/public/browser/web_contents.h" | 42 #include "content/public/browser/web_contents.h" |
| 43 #include "content/public/common/content_switches.h" |
43 #include "content/public/common/url_constants.h" | 44 #include "content/public/common/url_constants.h" |
44 #include "content/public/test/browser_test_utils.h" | 45 #include "content/public/test/browser_test_utils.h" |
45 #include "content/public/test/test_utils.h" | 46 #include "content/public/test/test_utils.h" |
46 #include "net/dns/mock_host_resolver.h" | 47 #include "net/dns/mock_host_resolver.h" |
47 #include "net/test/embedded_test_server/embedded_test_server.h" | 48 #include "net/test/embedded_test_server/embedded_test_server.h" |
48 #include "net/test/url_request/url_request_mock_http_job.h" | 49 #include "net/test/url_request/url_request_mock_http_job.h" |
49 #include "testing/gtest/include/gtest/gtest.h" | 50 #include "testing/gtest/include/gtest/gtest.h" |
50 | 51 |
51 using content::BrowserContext; | 52 using content::BrowserContext; |
52 using content::BrowserThread; | 53 using content::BrowserThread; |
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 class SavePageSitePerProcessBrowserTest : public SavePageBrowserTest { | 777 class SavePageSitePerProcessBrowserTest : public SavePageBrowserTest { |
777 public: | 778 public: |
778 SavePageSitePerProcessBrowserTest() {} | 779 SavePageSitePerProcessBrowserTest() {} |
779 | 780 |
780 protected: | 781 protected: |
781 void SetUpCommandLine(base::CommandLine* command_line) override { | 782 void SetUpCommandLine(base::CommandLine* command_line) override { |
782 SavePageBrowserTest::SetUpCommandLine(command_line); | 783 SavePageBrowserTest::SetUpCommandLine(command_line); |
783 | 784 |
784 // TODO(lukasza): Enable --site-per-process once crbug.com/526786 is fixed. | 785 // TODO(lukasza): Enable --site-per-process once crbug.com/526786 is fixed. |
785 // (currently, when the line below is uncommented out, the test crashes | 786 // (currently, when the line below is uncommented out, the test crashes |
786 // under RenderViewImpl::OnGetAllSavableResourceLinksForCurrentPage). | 787 // under RenderViewImpl::OnGetSerializedHtmlDataForCu...PageWithLocalLinks). |
787 // content::IsolateAllSitesForTesting(command_line); | 788 // content::IsolateAllSitesForTesting(command_line); |
788 } | 789 } |
789 | 790 |
790 void SetUpOnMainThread() override { | 791 void SetUpOnMainThread() override { |
791 SavePageBrowserTest::SetUpOnMainThread(); | 792 SavePageBrowserTest::SetUpOnMainThread(); |
792 | 793 |
793 host_resolver()->AddRule("*", "127.0.0.1"); | 794 host_resolver()->AddRule("*", "127.0.0.1"); |
794 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 795 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
795 content::SetupCrossSiteRedirector(embedded_test_server()); | 796 content::SetupCrossSiteRedirector(embedded_test_server()); |
796 } | 797 } |
(...skipping 29 matching lines...) Expand all Loading... |
826 EXPECT_TRUE(base::PathExists(file_path)) << "Does " << file_path.value() | 827 EXPECT_TRUE(base::PathExists(file_path)) << "Does " << file_path.value() |
827 << " exist?"; | 828 << " exist?"; |
828 int64 actual_file_size = 0; | 829 int64 actual_file_size = 0; |
829 EXPECT_TRUE(base::GetFileSize(file_path, &actual_file_size)); | 830 EXPECT_TRUE(base::GetFileSize(file_path, &actual_file_size)); |
830 EXPECT_NE(0, actual_file_size) << "Is " << file_path.value() | 831 EXPECT_NE(0, actual_file_size) << "Is " << file_path.value() |
831 << " non-empty?"; | 832 << " non-empty?"; |
832 } | 833 } |
833 } | 834 } |
834 | 835 |
835 } // namespace | 836 } // namespace |
OLD | NEW |