| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 base::FilePath EnsureMimeExtension(const base::FilePath& name, | 87 base::FilePath EnsureMimeExtension(const base::FilePath& name, |
| 88 const std::string& content_mime_type) { | 88 const std::string& content_mime_type) { |
| 89 return SavePackage::EnsureMimeExtension(name, content_mime_type); | 89 return SavePackage::EnsureMimeExtension(name, content_mime_type); |
| 90 } | 90 } |
| 91 | 91 |
| 92 GURL GetUrlToBeSaved() { | 92 GURL GetUrlToBeSaved() { |
| 93 return save_package_success_->GetUrlToBeSaved(); | 93 return save_package_success_->GetUrlToBeSaved(); |
| 94 } | 94 } |
| 95 | 95 |
| 96 protected: | 96 protected: |
| 97 virtual void SetUp() { | 97 void SetUp() override { |
| 98 RenderViewHostImplTestHarness::SetUp(); | 98 RenderViewHostImplTestHarness::SetUp(); |
| 99 | 99 |
| 100 // Do the initialization in SetUp so contents() is initialized by | 100 // Do the initialization in SetUp so contents() is initialized by |
| 101 // RenderViewHostImplTestHarness::SetUp. | 101 // RenderViewHostImplTestHarness::SetUp. |
| 102 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 102 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 103 | 103 |
| 104 save_package_success_ = new SavePackage(contents(), | 104 save_package_success_ = new SavePackage(contents(), |
| 105 temp_dir_.path().AppendASCII("testfile" HTML_EXTENSION), | 105 temp_dir_.path().AppendASCII("testfile" HTML_EXTENSION), |
| 106 temp_dir_.path().AppendASCII("testfile_files")); | 106 temp_dir_.path().AppendASCII("testfile_files")); |
| 107 | 107 |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 GURL view_source_url = | 432 GURL view_source_url = |
| 433 GURL(kViewSourceScheme + std::string(":") + mock_url.spec()); | 433 GURL(kViewSourceScheme + std::string(":") + mock_url.spec()); |
| 434 GURL actual_url = net::URLRequestMockHTTPJob::GetMockUrl( | 434 GURL actual_url = net::URLRequestMockHTTPJob::GetMockUrl( |
| 435 base::FilePath(kTestDir).Append(file_name)); | 435 base::FilePath(kTestDir).Append(file_name)); |
| 436 NavigateAndCommit(view_source_url); | 436 NavigateAndCommit(view_source_url); |
| 437 EXPECT_EQ(actual_url, GetUrlToBeSaved()); | 437 EXPECT_EQ(actual_url, GetUrlToBeSaved()); |
| 438 EXPECT_EQ(view_source_url, contents()->GetLastCommittedURL()); | 438 EXPECT_EQ(view_source_url, contents()->GetLastCommittedURL()); |
| 439 } | 439 } |
| 440 | 440 |
| 441 } // namespace content | 441 } // namespace content |
| OLD | NEW |