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 25 matching lines...) Expand all Loading... |
36 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, | 36 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, |
37 &server_file_name)); | 37 &server_file_name)); |
38 server_file_name += L"\\" + kTestDir + L"\\" + server_file; | 38 server_file_name += L"\\" + kTestDir + L"\\" + server_file; |
39 ASSERT_TRUE(file_util::PathExists(server_file_name)); | 39 ASSERT_TRUE(file_util::PathExists(server_file_name)); |
40 | 40 |
41 int64 client_file_size = 0; | 41 int64 client_file_size = 0; |
42 int64 server_file_size = 0; | 42 int64 server_file_size = 0; |
43 EXPECT_TRUE(file_util::GetFileSize(client_file, &client_file_size)); | 43 EXPECT_TRUE(file_util::GetFileSize(client_file, &client_file_size)); |
44 EXPECT_TRUE(file_util::GetFileSize(server_file_name, &server_file_size)); | 44 EXPECT_TRUE(file_util::GetFileSize(server_file_name, &server_file_size)); |
45 EXPECT_EQ(client_file_size, server_file_size); | 45 EXPECT_EQ(client_file_size, server_file_size); |
46 EXPECT_PRED2(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_ += file_util::kPathSeparator; |
56 } | 56 } |
(...skipping 46 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 |