| 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 "chrome/browser/download/download_browsertest.h" | 5 #include "chrome/browser/download/download_browsertest.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 std::unique_ptr<content::DownloadTestObserver> observer( | 713 std::unique_ptr<content::DownloadTestObserver> observer( |
| 714 CreateWaiter(browser, 1)); | 714 CreateWaiter(browser, 1)); |
| 715 ui_test_utils::NavigateToURL(browser, url); | 715 ui_test_utils::NavigateToURL(browser, url); |
| 716 | 716 |
| 717 // TODO(ahendrickson): check download status text before downloading. | 717 // TODO(ahendrickson): check download status text before downloading. |
| 718 // Need to: | 718 // Need to: |
| 719 // - Add a member function to the |DownloadShelf| interface class, that | 719 // - Add a member function to the |DownloadShelf| interface class, that |
| 720 // indicates how many members it has. | 720 // indicates how many members it has. |
| 721 // - Add a member function to |DownloadShelf| to get the status text | 721 // - Add a member function to |DownloadShelf| to get the status text |
| 722 // of a given member (for example, via the name in |DownloadItemView|'s | 722 // of a given member (for example, via the name in |DownloadItemView|'s |
| 723 // GetAccessibleState() member function), by index. | 723 // GetAccessibleNodeData() member function), by index. |
| 724 // - Iterate over browser->window()->GetDownloadShelf()'s members | 724 // - Iterate over browser->window()->GetDownloadShelf()'s members |
| 725 // to see if any match the status text we want. Start with the last one. | 725 // to see if any match the status text we want. Start with the last one. |
| 726 | 726 |
| 727 // Allow the request to finish. We do this by loading a second URL in a | 727 // Allow the request to finish. We do this by loading a second URL in a |
| 728 // separate tab. | 728 // separate tab. |
| 729 GURL finish_url(net::URLRequestSlowDownloadJob::kFinishDownloadUrl); | 729 GURL finish_url(net::URLRequestSlowDownloadJob::kFinishDownloadUrl); |
| 730 ui_test_utils::NavigateToURLWithDisposition( | 730 ui_test_utils::NavigateToURLWithDisposition( |
| 731 browser, finish_url, WindowOpenDisposition::NEW_FOREGROUND_TAB, | 731 browser, finish_url, WindowOpenDisposition::NEW_FOREGROUND_TAB, |
| 732 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 732 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
| 733 observer->WaitForFinished(); | 733 observer->WaitForFinished(); |
| (...skipping 2932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3666 browser(), 1, | 3666 browser(), 1, |
| 3667 content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_DENY)); | 3667 content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_DENY)); |
| 3668 ui_test_utils::NavigateToURL(browser(), extension_url); | 3668 ui_test_utils::NavigateToURL(browser(), extension_url); |
| 3669 | 3669 |
| 3670 observer->WaitForFinished(); | 3670 observer->WaitForFinished(); |
| 3671 | 3671 |
| 3672 // Download shelf should close. | 3672 // Download shelf should close. |
| 3673 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible()); | 3673 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible()); |
| 3674 } | 3674 } |
| 3675 #endif // defined(OS_CHROMEOS) | 3675 #endif // defined(OS_CHROMEOS) |
| OLD | NEW |