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/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/scoped_temp_dir.h" | 9 #include "base/scoped_temp_dir.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
12 #include "content/browser/browser_thread_impl.h" | 12 #include "content/browser/browser_thread_impl.h" |
13 #include "content/browser/download/save_package.h" | 13 #include "content/browser/download/save_package.h" |
14 #include "content/browser/renderer_host/test_render_view_host.h" | 14 #include "content/browser/renderer_host/test_render_view_host.h" |
15 #include "content/browser/tab_contents/test_web_contents.h" | 15 #include "content/browser/web_contents/test_web_contents.h" |
16 #include "content/test/net/url_request_mock_http_job.h" | 16 #include "content/test/net/url_request_mock_http_job.h" |
17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
19 | 19 |
20 using content::BrowserThread; | 20 using content::BrowserThread; |
21 using content::BrowserThreadImpl; | 21 using content::BrowserThreadImpl; |
22 using content::RenderViewHostImplTestHarness; | 22 using content::RenderViewHostImplTestHarness; |
23 | 23 |
24 #define FPL FILE_PATH_LITERAL | 24 #define FPL FILE_PATH_LITERAL |
25 #if defined(OS_WIN) | 25 #if defined(OS_WIN) |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 TEST_F(SavePackageTest, TestGetUrlToBeSavedViewSource) { | 421 TEST_F(SavePackageTest, TestGetUrlToBeSavedViewSource) { |
422 FilePath file_name(FILE_PATH_LITERAL("a.htm")); | 422 FilePath file_name(FILE_PATH_LITERAL("a.htm")); |
423 GURL view_source_url = URLRequestMockHTTPJob::GetMockViewSourceUrl( | 423 GURL view_source_url = URLRequestMockHTTPJob::GetMockViewSourceUrl( |
424 FilePath(kTestDir).Append(file_name)); | 424 FilePath(kTestDir).Append(file_name)); |
425 GURL actual_url = URLRequestMockHTTPJob::GetMockUrl( | 425 GURL actual_url = URLRequestMockHTTPJob::GetMockUrl( |
426 FilePath(kTestDir).Append(file_name)); | 426 FilePath(kTestDir).Append(file_name)); |
427 NavigateAndCommit(view_source_url); | 427 NavigateAndCommit(view_source_url); |
428 EXPECT_EQ(actual_url, GetUrlToBeSaved()); | 428 EXPECT_EQ(actual_url, GetUrlToBeSaved()); |
429 EXPECT_EQ(view_source_url, contents()->GetURL()); | 429 EXPECT_EQ(view_source_url, contents()->GetURL()); |
430 } | 430 } |
OLD | NEW |