| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "chrome/browser/automation/url_request_mock_http_job.h" | 8 #include "chrome/browser/automation/url_request_mock_http_job.h" |
| 9 #include "chrome/browser/download/save_package.h" | 9 #include "chrome/browser/download/save_package.h" |
| 10 #include "chrome/common/chrome_paths.h" | 10 #include "chrome/common/chrome_paths.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 EXPECT_EQ(client_file_size, server_file_size); | 45 EXPECT_EQ(client_file_size, server_file_size); |
| 46 EXPECT_TRUE(file_util::ContentsEqual(client_file, server_file_name)); | 46 EXPECT_TRUE(file_util::ContentsEqual(client_file, server_file_name)); |
| 47 } | 47 } |
| 48 | 48 |
| 49 EXPECT_TRUE(DieFileDie(client_file, false)); | 49 EXPECT_TRUE(DieFileDie(client_file, false)); |
| 50 } | 50 } |
| 51 | 51 |
| 52 virtual void SetUp() { | 52 virtual void SetUp() { |
| 53 UITest::SetUp(); | 53 UITest::SetUp(); |
| 54 EXPECT_TRUE(file_util::CreateNewTempDirectory(L"", &save_dir_)); | 54 EXPECT_TRUE(file_util::CreateNewTempDirectory(L"", &save_dir_)); |
| 55 save_dir_ += file_util::kPathSeparator; | 55 save_dir_ += FilePath::kSeparators[0]; |
| 56 } | 56 } |
| 57 | 57 |
| 58 std::wstring save_dir_; | 58 std::wstring save_dir_; |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 TEST_F(SavePageTest, SaveHTMLOnly) { | 61 TEST_F(SavePageTest, SaveHTMLOnly) { |
| 62 std::wstring file_name = L"a.htm"; | 62 std::wstring file_name = L"a.htm"; |
| 63 std::wstring full_file_name = save_dir_ + file_name; | 63 std::wstring full_file_name = save_dir_ + file_name; |
| 64 std::wstring dir = save_dir_ + L"a_files"; | 64 std::wstring dir = save_dir_ + L"a_files"; |
| 65 | 65 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 103 |
| 104 scoped_ptr<TabProxy> tab(GetActiveTab()); | 104 scoped_ptr<TabProxy> tab(GetActiveTab()); |
| 105 ASSERT_TRUE(tab->NavigateToURL(GURL(L"about:blank"))); | 105 ASSERT_TRUE(tab->NavigateToURL(GURL(L"about:blank"))); |
| 106 WaitUntilTabCount(1); | 106 WaitUntilTabCount(1); |
| 107 | 107 |
| 108 EXPECT_FALSE(tab->SavePage(full_file_name, dir, | 108 EXPECT_FALSE(tab->SavePage(full_file_name, dir, |
| 109 SavePackage::SAVE_AS_ONLY_HTML)); | 109 SavePackage::SAVE_AS_ONLY_HTML)); |
| 110 EXPECT_FALSE(WaitForDownloadShelfVisible(tab.get())); | 110 EXPECT_FALSE(WaitForDownloadShelfVisible(tab.get())); |
| 111 } | 111 } |
| 112 | 112 |
| OLD | NEW |