| 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" |
| 11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "content/browser/download/save_package.h" | 12 #include "content/browser/download/save_package.h" |
| 13 #include "content/browser/renderer_host/test_render_view_host.h" | 13 #include "content/browser/renderer_host/test_render_view_host.h" |
| 14 #include "content/test/net/url_request_mock_http_job.h" | 14 #include "content/test/net/url_request_mock_http_job.h" |
| 15 #include "content/test/test_web_contents.h" | 15 #include "content/test/test_web_contents.h" |
| 16 #include "googleurl/src/gurl.h" | |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 17 #include "url/gurl.h" |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 | 20 |
| 21 #define FPL FILE_PATH_LITERAL | 21 #define FPL FILE_PATH_LITERAL |
| 22 #if defined(OS_WIN) | 22 #if defined(OS_WIN) |
| 23 #define HTML_EXTENSION ".htm" | 23 #define HTML_EXTENSION ".htm" |
| 24 // This second define is needed because MSVC is broken. | 24 // This second define is needed because MSVC is broken. |
| 25 #define FPL_HTML_EXTENSION L".htm" | 25 #define FPL_HTML_EXTENSION L".htm" |
| 26 #else | 26 #else |
| 27 #define HTML_EXTENSION ".html" | 27 #define HTML_EXTENSION ".html" |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 GURL view_source_url = URLRequestMockHTTPJob::GetMockViewSourceUrl( | 431 GURL view_source_url = URLRequestMockHTTPJob::GetMockViewSourceUrl( |
| 432 base::FilePath(kTestDir).Append(file_name)); | 432 base::FilePath(kTestDir).Append(file_name)); |
| 433 GURL actual_url = URLRequestMockHTTPJob::GetMockUrl( | 433 GURL actual_url = URLRequestMockHTTPJob::GetMockUrl( |
| 434 base::FilePath(kTestDir).Append(file_name)); | 434 base::FilePath(kTestDir).Append(file_name)); |
| 435 NavigateAndCommit(view_source_url); | 435 NavigateAndCommit(view_source_url); |
| 436 EXPECT_EQ(actual_url, GetUrlToBeSaved()); | 436 EXPECT_EQ(actual_url, GetUrlToBeSaved()); |
| 437 EXPECT_EQ(view_source_url, contents()->GetURL()); | 437 EXPECT_EQ(view_source_url, contents()->GetURL()); |
| 438 } | 438 } |
| 439 | 439 |
| 440 } // namespace content | 440 } // namespace content |
| OLD | NEW |