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 <sstream> | 5 #include <sstream> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
10 #include <shlwapi.h> | 10 #include <shlwapi.h> |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 return false; | 51 return false; |
52 } | 52 } |
53 #endif // defined(OS_WIN) | 53 #endif // defined(OS_WIN) |
54 | 54 |
55 class DownloadTest : public UITest { | 55 class DownloadTest : public UITest { |
56 protected: | 56 protected: |
57 DownloadTest() : UITest() {} | 57 DownloadTest() : UITest() {} |
58 | 58 |
59 void CheckDownload(const FilePath& client_filename, | 59 void CheckDownload(const FilePath& client_filename, |
60 const FilePath& server_filename) { | 60 const FilePath& server_filename) { |
61 // Find the path on the client. | 61 // Find the path on the client. |
62 FilePath file_on_client = download_prefix_.Append(client_filename); | 62 FilePath file_on_client = download_prefix_.Append(client_filename); |
63 | 63 |
64 // Find the path on the server. | 64 // Find the path on the server. |
65 FilePath file_on_server; | 65 FilePath file_on_server; |
66 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, | 66 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, |
67 &file_on_server)); | 67 &file_on_server)); |
68 file_on_server = file_on_server.Append(server_filename); | 68 file_on_server = file_on_server.Append(server_filename); |
69 ASSERT_TRUE(file_util::PathExists(file_on_server)); | 69 ASSERT_TRUE(file_util::PathExists(file_on_server)); |
70 | 70 |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 FilePath file(FILE_PATH_LITERAL("download-test1.lib")); | 560 FilePath file(FILE_PATH_LITERAL("download-test1.lib")); |
561 ASSERT_TRUE(tab_proxy->NavigateToURLAsyncWithDisposition( | 561 ASSERT_TRUE(tab_proxy->NavigateToURLAsyncWithDisposition( |
562 URLRequestMockHTTPJob::GetMockUrl(file), NEW_WINDOW)); | 562 URLRequestMockHTTPJob::GetMockUrl(file), NEW_WINDOW)); |
563 | 563 |
564 ASSERT_TRUE(automation()->WaitForWindowCountToBecome(2)); | 564 ASSERT_TRUE(automation()->WaitForWindowCountToBecome(2)); |
565 | 565 |
566 CheckDownload(file); | 566 CheckDownload(file); |
567 } | 567 } |
568 | 568 |
569 } // namespace | 569 } // namespace |
OLD | NEW |