| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_path.h" | 5 #include "base/file_path.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
| 8 #include "base/scoped_temp_dir.h" | 8 #include "base/scoped_temp_dir.h" |
| 9 #include "base/test/test_file_util.h" | 9 #include "base/test/test_file_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 if (!downloaded_file_exists) | 355 if (!downloaded_file_exists) |
| 356 return false; | 356 return false; |
| 357 | 357 |
| 358 int64 origin_file_size = 0; | 358 int64 origin_file_size = 0; |
| 359 int64 downloaded_file_size = 0; | 359 int64 downloaded_file_size = 0; |
| 360 EXPECT_TRUE(file_util::GetFileSize(origin_file, &origin_file_size)); | 360 EXPECT_TRUE(file_util::GetFileSize(origin_file, &origin_file_size)); |
| 361 EXPECT_TRUE(file_util::GetFileSize(downloaded_file, &downloaded_file_size)); | 361 EXPECT_TRUE(file_util::GetFileSize(downloaded_file, &downloaded_file_size)); |
| 362 EXPECT_EQ(origin_file_size, downloaded_file_size); | 362 EXPECT_EQ(origin_file_size, downloaded_file_size); |
| 363 EXPECT_TRUE(file_util::ContentsEqual(downloaded_file, origin_file)); | 363 EXPECT_TRUE(file_util::ContentsEqual(downloaded_file, origin_file)); |
| 364 | 364 |
| 365 #if defined(OS_WIN) | |
| 366 // Check if the Zone Identifier is correctly set. | |
| 367 if (file_util::VolumeSupportsADS(downloaded_file)) | |
| 368 EXPECT_TRUE(file_util::HasInternetZoneIdentifier(downloaded_file)); | |
| 369 #endif | |
| 370 | |
| 371 // Delete the downloaded copy of the file. | 365 // Delete the downloaded copy of the file. |
| 372 bool downloaded_file_deleted = | 366 bool downloaded_file_deleted = |
| 373 file_util::DieFileDie(downloaded_file, false); | 367 file_util::DieFileDie(downloaded_file, false); |
| 374 EXPECT_TRUE(downloaded_file_deleted); | 368 EXPECT_TRUE(downloaded_file_deleted); |
| 375 return downloaded_file_deleted; | 369 return downloaded_file_deleted; |
| 376 } | 370 } |
| 377 | 371 |
| 378 // TODO(ahendrickson) -- |expected_title_in_progress| and | 372 // TODO(ahendrickson) -- |expected_title_in_progress| and |
| 379 // |expected_title_in_finished| need to be checked. | 373 // |expected_title_in_finished| need to be checked. |
| 380 bool RunSizeTest(Browser* browser, | 374 bool RunSizeTest(Browser* browser, |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 | 455 |
| 462 // Download the file and wait. We do not expect the Select File dialog. | 456 // Download the file and wait. We do not expect the Select File dialog. |
| 463 DownloadAndWait(browser(), url, EXPECT_NO_SELECT_DIALOG); | 457 DownloadAndWait(browser(), url, EXPECT_NO_SELECT_DIALOG); |
| 464 | 458 |
| 465 // Check state. | 459 // Check state. |
| 466 EXPECT_EQ(1, browser()->tab_count()); | 460 EXPECT_EQ(1, browser()->tab_count()); |
| 467 CheckDownload(browser(), file, file); | 461 CheckDownload(browser(), file, file); |
| 468 EXPECT_TRUE(browser()->window()->IsDownloadShelfVisible()); | 462 EXPECT_TRUE(browser()->window()->IsDownloadShelfVisible()); |
| 469 } | 463 } |
| 470 | 464 |
| 465 #if defined(OS_WIN) |
| 466 // Download a file and confirm that the zone identifier (on windows) |
| 467 // is set to internet. |
| 468 // This is flaky due to http://crbug.com/20809. |
| 469 IN_PROC_BROWSER_TEST_F(DownloadTest, FLAKY_CheckInternetZone) { |
| 470 ASSERT_TRUE(InitialSetup(false)); |
| 471 FilePath file(FILE_PATH_LITERAL("download-test1.lib")); |
| 472 GURL url(URLRequestMockHTTPJob::GetMockUrl(file)); |
| 473 |
| 474 // Download the file and wait. We do not expect the Select File dialog. |
| 475 DownloadAndWait(browser(), url, EXPECT_NO_SELECT_DIALOG); |
| 476 |
| 477 // Check state. |
| 478 EXPECT_EQ(1, browser()->tab_count()); |
| 479 CheckDownload(browser(), file, file); |
| 480 EXPECT_TRUE(browser()->window()->IsDownloadShelfVisible()); |
| 481 |
| 482 FilePath downloaded_file = GetDownloadDirectory(browser()).Append(file); |
| 483 if (file_util::VolumeSupportsADS(downloaded_file)) |
| 484 EXPECT_TRUE(file_util::HasInternetZoneIdentifier(downloaded_file)); |
| 485 } |
| 486 #endif |
| 487 |
| 471 // Put up a Select File dialog when the file is downloaded, due to its MIME | 488 // Put up a Select File dialog when the file is downloaded, due to its MIME |
| 472 // type. | 489 // type. |
| 473 // | 490 // |
| 474 // This test runs correctly, but leaves behind turds in the test user's | 491 // This test runs correctly, but leaves behind turds in the test user's |
| 475 // download directory because of http://crbug.com/62099. No big loss; it | 492 // download directory because of http://crbug.com/62099. No big loss; it |
| 476 // was primarily confirming DownloadsObserver wait on select file dialog | 493 // was primarily confirming DownloadsObserver wait on select file dialog |
| 477 // functionality anyway. | 494 // functionality anyway. |
| 478 // Additionally, there is Windows-specific flake, http://crbug.com/20809. | |
| 479 IN_PROC_BROWSER_TEST_F(DownloadTest, DISABLED_DownloadMimeTypeSelect) { | 495 IN_PROC_BROWSER_TEST_F(DownloadTest, DISABLED_DownloadMimeTypeSelect) { |
| 480 ASSERT_TRUE(InitialSetup(true)); | 496 ASSERT_TRUE(InitialSetup(true)); |
| 481 FilePath file(FILE_PATH_LITERAL("download-test1.lib")); | 497 FilePath file(FILE_PATH_LITERAL("download-test1.lib")); |
| 482 GURL url(URLRequestMockHTTPJob::GetMockUrl(file)); | 498 GURL url(URLRequestMockHTTPJob::GetMockUrl(file)); |
| 483 | 499 |
| 484 // Download the file and wait. We expect the Select File dialog to appear | 500 // Download the file and wait. We expect the Select File dialog to appear |
| 485 // due to the MIME type. | 501 // due to the MIME type. |
| 486 DownloadAndWait(browser(), url, EXPECT_SELECT_DIALOG); | 502 DownloadAndWait(browser(), url, EXPECT_SELECT_DIALOG); |
| 487 | 503 |
| 488 // Check state. | 504 // Check state. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 514 // Download a 0-size file with a content-disposition header, verify that the | 530 // Download a 0-size file with a content-disposition header, verify that the |
| 515 // download tab opened and the file exists as the filename specified in the | 531 // download tab opened and the file exists as the filename specified in the |
| 516 // header. This also ensures we properly handle empty file downloads. | 532 // header. This also ensures we properly handle empty file downloads. |
| 517 // The download shelf should be visible in the current tab. | 533 // The download shelf should be visible in the current tab. |
| 518 // | 534 // |
| 519 // Test is believed mostly good (non-flaky) in itself, but it | 535 // Test is believed mostly good (non-flaky) in itself, but it |
| 520 // sometimes trips over underlying flakiness in the downloads | 536 // sometimes trips over underlying flakiness in the downloads |
| 521 // subsystem in in http://crbug.com/63237. Until that bug is | 537 // subsystem in in http://crbug.com/63237. Until that bug is |
| 522 // fixed, this test should be considered flaky. It's entered as | 538 // fixed, this test should be considered flaky. It's entered as |
| 523 // DISABLED since if 63237 does cause a failure, it'll be a timeout. | 539 // DISABLED since if 63237 does cause a failure, it'll be a timeout. |
| 524 // Additionally, there is Windows-specific flake, http://crbug.com/20809. | |
| 525 IN_PROC_BROWSER_TEST_F(DownloadTest, DISABLED_ContentDisposition) { | 540 IN_PROC_BROWSER_TEST_F(DownloadTest, DISABLED_ContentDisposition) { |
| 526 ASSERT_TRUE(InitialSetup(false)); | 541 ASSERT_TRUE(InitialSetup(false)); |
| 527 FilePath file(FILE_PATH_LITERAL("download-test3.gif")); | 542 FilePath file(FILE_PATH_LITERAL("download-test3.gif")); |
| 528 GURL url(URLRequestMockHTTPJob::GetMockUrl(file)); | 543 GURL url(URLRequestMockHTTPJob::GetMockUrl(file)); |
| 529 FilePath download_file(FILE_PATH_LITERAL("download-test3-attachment.gif")); | 544 FilePath download_file(FILE_PATH_LITERAL("download-test3-attachment.gif")); |
| 530 | 545 |
| 531 // Download a file and wait. | 546 // Download a file and wait. |
| 532 DownloadAndWait(browser(), url, EXPECT_NO_SELECT_DIALOG); | 547 DownloadAndWait(browser(), url, EXPECT_NO_SELECT_DIALOG); |
| 533 | 548 |
| 534 CheckDownload(browser(), download_file, file); | 549 CheckDownload(browser(), download_file, file); |
| 535 | 550 |
| 536 // Check state. | 551 // Check state. |
| 537 EXPECT_EQ(1, browser()->tab_count()); | 552 EXPECT_EQ(1, browser()->tab_count()); |
| 538 EXPECT_TRUE(browser()->window()->IsDownloadShelfVisible()); | 553 EXPECT_TRUE(browser()->window()->IsDownloadShelfVisible()); |
| 539 } | 554 } |
| 540 | 555 |
| 541 // Test that the download shelf is per-window by starting a download in one | 556 // Test that the download shelf is per-window by starting a download in one |
| 542 // tab, opening a second tab, closing the shelf, going back to the first tab, | 557 // tab, opening a second tab, closing the shelf, going back to the first tab, |
| 543 // and checking that the shelf is closed. | 558 // and checking that the shelf is closed. |
| 544 // | 559 // |
| 545 // The test sometimes trips over underlying flakiness in the downloads | 560 // The test sometimes trips over underlying flakiness in the downloads |
| 546 // subsystem in in http://crbug.com/63237. It's entered as | 561 // subsystem in in http://crbug.com/63237. It's entered as |
| 547 // DISABLED since if 63237 does cause a failure, it'll be a timeout. | 562 // DISABLED since if 63237 does cause a failure, it'll be a timeout. |
| 548 // Additionally, there is Windows-specific flake, http://crbug.com/20809. | |
| 549 IN_PROC_BROWSER_TEST_F(DownloadTest, DISABLED_PerWindowShelf) { | 563 IN_PROC_BROWSER_TEST_F(DownloadTest, DISABLED_PerWindowShelf) { |
| 550 ASSERT_TRUE(InitialSetup(false)); | 564 ASSERT_TRUE(InitialSetup(false)); |
| 551 FilePath file(FILE_PATH_LITERAL("download-test3.gif")); | 565 FilePath file(FILE_PATH_LITERAL("download-test3.gif")); |
| 552 GURL url(URLRequestMockHTTPJob::GetMockUrl(file)); | 566 GURL url(URLRequestMockHTTPJob::GetMockUrl(file)); |
| 553 FilePath download_file(FILE_PATH_LITERAL("download-test3-attachment.gif")); | 567 FilePath download_file(FILE_PATH_LITERAL("download-test3-attachment.gif")); |
| 554 | 568 |
| 555 // Download a file and wait. | 569 // Download a file and wait. |
| 556 DownloadAndWait(browser(), url, EXPECT_NO_SELECT_DIALOG); | 570 DownloadAndWait(browser(), url, EXPECT_NO_SELECT_DIALOG); |
| 557 | 571 |
| 558 CheckDownload(browser(), download_file, file); | 572 CheckDownload(browser(), download_file, file); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 586 // in the middle until the server receives a second request for | 600 // in the middle until the server receives a second request for |
| 587 // "download-finish". At that time, the download will finish. | 601 // "download-finish". At that time, the download will finish. |
| 588 // These tests don't currently test much due to holes in |RunSizeTest()|. See | 602 // These tests don't currently test much due to holes in |RunSizeTest()|. See |
| 589 // comments in that routine for details. | 603 // comments in that routine for details. |
| 590 | 604 |
| 591 // Test is believed mostly good (non-flaky) in itself, but it | 605 // Test is believed mostly good (non-flaky) in itself, but it |
| 592 // very occasionally trips over underlying flakiness in the downloads | 606 // very occasionally trips over underlying flakiness in the downloads |
| 593 // subsystem in in http://crbug.com/63237. Until that bug is | 607 // subsystem in in http://crbug.com/63237. Until that bug is |
| 594 // fixed, this test should be considered flaky. It's entered as | 608 // fixed, this test should be considered flaky. It's entered as |
| 595 // DISABLED since if 63237 does cause a failure, it'll be a timeout. | 609 // DISABLED since if 63237 does cause a failure, it'll be a timeout. |
| 596 // Additionally, there is Windows-specific flake, http://crbug.com/20809. | |
| 597 IN_PROC_BROWSER_TEST_F(DownloadTest, DISABLED_UnknownSize) { | 610 IN_PROC_BROWSER_TEST_F(DownloadTest, DISABLED_UnknownSize) { |
| 598 GURL url(URLRequestSlowDownloadJob::kUnknownSizeUrl); | 611 GURL url(URLRequestSlowDownloadJob::kUnknownSizeUrl); |
| 599 FilePath filename; | 612 FilePath filename; |
| 600 net::FileURLToFilePath(url, &filename); | 613 net::FileURLToFilePath(url, &filename); |
| 601 filename = filename.BaseName(); | 614 filename = filename.BaseName(); |
| 602 ASSERT_TRUE(RunSizeTest(browser(), | 615 ASSERT_TRUE(RunSizeTest(browser(), |
| 603 url, | 616 url, |
| 604 L"32.0 KB - " + filename.ToWStringHack(), | 617 L"32.0 KB - " + filename.ToWStringHack(), |
| 605 L"100% - " + filename.ToWStringHack())); | 618 L"100% - " + filename.ToWStringHack())); |
| 606 } | 619 } |
| 607 | 620 |
| 608 // Test is believed mostly good (non-flaky) in itself, but it | 621 // Test is believed mostly good (non-flaky) in itself, but it |
| 609 // very occasionally trips over underlying flakiness in the downloads | 622 // very occasionally trips over underlying flakiness in the downloads |
| 610 // subsystem in in http://crbug.com/63237. Until that bug is | 623 // subsystem in in http://crbug.com/63237. Until that bug is |
| 611 // fixed, this test should be considered flaky. It's entered as | 624 // fixed, this test should be considered flaky. It's entered as |
| 612 // DISABLED since if 63237 does cause a failure, it'll be a timeout. | 625 // DISABLED since if 63237 does cause a failure, it'll be a timeout. |
| 613 // Additionally, there is Windows-specific flake, http://crbug.com/20809. | |
| 614 IN_PROC_BROWSER_TEST_F(DownloadTest, DISABLED_KnownSize) { | 626 IN_PROC_BROWSER_TEST_F(DownloadTest, DISABLED_KnownSize) { |
| 615 GURL url(URLRequestSlowDownloadJob::kKnownSizeUrl); | 627 GURL url(URLRequestSlowDownloadJob::kKnownSizeUrl); |
| 616 FilePath filename; | 628 FilePath filename; |
| 617 net::FileURLToFilePath(url, &filename); | 629 net::FileURLToFilePath(url, &filename); |
| 618 filename = filename.BaseName(); | 630 filename = filename.BaseName(); |
| 619 ASSERT_TRUE(RunSizeTest(browser(), | 631 ASSERT_TRUE(RunSizeTest(browser(), |
| 620 url, | 632 url, |
| 621 L"71% - " + filename.ToWStringHack(), | 633 L"71% - " + filename.ToWStringHack(), |
| 622 L"100% - " + filename.ToWStringHack())); | 634 L"100% - " + filename.ToWStringHack())); |
| 623 } | 635 } |
| 624 | 636 |
| 625 // Test that when downloading an item in Incognito mode, we don't crash when | 637 // Test that when downloading an item in Incognito mode, we don't crash when |
| 626 // closing the last Incognito window (http://crbug.com/13983). | 638 // closing the last Incognito window (http://crbug.com/13983). |
| 627 // Also check that the download shelf is not visible after closing the | 639 // Also check that the download shelf is not visible after closing the |
| 628 // Incognito window. | 640 // Incognito window. |
| 629 // | 641 // |
| 630 // Test is believed mostly good (non-flaky) in itself, but it | 642 // Test is believed mostly good (non-flaky) in itself, but it |
| 631 // sometimes trips over underlying flakiness in the downloads | 643 // sometimes trips over underlying flakiness in the downloads |
| 632 // subsystem in in http://crbug.com/63237. Until that bug is | 644 // subsystem in in http://crbug.com/63237. Until that bug is |
| 633 // fixed, this test should be considered flaky. It's entered as | 645 // fixed, this test should be considered flaky. It's entered as |
| 634 // DISABLED since if 63237 does cause a failure, it'll be a timeout. | 646 // DISABLED since if 63237 does cause a failure, it'll be a timeout. |
| 635 // Additionally, there is Windows-specific flake, http://crbug.com/20809. | |
| 636 IN_PROC_BROWSER_TEST_F(DownloadTest, DISABLED_IncognitoDownload) { | 647 IN_PROC_BROWSER_TEST_F(DownloadTest, DISABLED_IncognitoDownload) { |
| 637 ASSERT_TRUE(InitialSetup(false)); | 648 ASSERT_TRUE(InitialSetup(false)); |
| 638 | 649 |
| 639 // Open an Incognito window. | 650 // Open an Incognito window. |
| 640 Browser* incognito = CreateIncognitoBrowser(); // Waits. | 651 Browser* incognito = CreateIncognitoBrowser(); // Waits. |
| 641 ASSERT_TRUE(incognito); | 652 ASSERT_TRUE(incognito); |
| 642 int window_count = BrowserList::size(); | 653 int window_count = BrowserList::size(); |
| 643 EXPECT_EQ(2, window_count); | 654 EXPECT_EQ(2, window_count); |
| 644 | 655 |
| 645 // Download a file in the Incognito window and wait. | 656 // Download a file in the Incognito window and wait. |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 EXPECT_EQ(2, browser()->tab_count()); | 705 EXPECT_EQ(2, browser()->tab_count()); |
| 695 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible()); | 706 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible()); |
| 696 } | 707 } |
| 697 | 708 |
| 698 // Download a file in a background tab. Verify that the tab is closed | 709 // Download a file in a background tab. Verify that the tab is closed |
| 699 // automatically, and that the download shelf is visible in the current tab. | 710 // automatically, and that the download shelf is visible in the current tab. |
| 700 // | 711 // |
| 701 // The test sometimes trips over underlying flakiness in the downloads | 712 // The test sometimes trips over underlying flakiness in the downloads |
| 702 // subsystem in http://crbug.com/63237. It's entered as | 713 // subsystem in http://crbug.com/63237. It's entered as |
| 703 // DISABLED since if 63237 does cause a failure, it'll be a timeout. | 714 // DISABLED since if 63237 does cause a failure, it'll be a timeout. |
| 704 // Additionally, there is Windows-specific flake, http://crbug.com/20809. | |
| 705 IN_PROC_BROWSER_TEST_F(DownloadTest, DISABLED_CloseNewTab1) { | 715 IN_PROC_BROWSER_TEST_F(DownloadTest, DISABLED_CloseNewTab1) { |
| 706 ASSERT_TRUE(InitialSetup(false)); | 716 ASSERT_TRUE(InitialSetup(false)); |
| 707 | 717 |
| 708 // Download a file in a new background tab and wait. The tab is automatically | 718 // Download a file in a new background tab and wait. The tab is automatically |
| 709 // closed when the download begins. | 719 // closed when the download begins. |
| 710 FilePath file(FILE_PATH_LITERAL("download-test1.lib")); | 720 FilePath file(FILE_PATH_LITERAL("download-test1.lib")); |
| 711 GURL url(URLRequestMockHTTPJob::GetMockUrl(file)); | 721 GURL url(URLRequestMockHTTPJob::GetMockUrl(file)); |
| 712 DownloadAndWaitWithDisposition( | 722 DownloadAndWaitWithDisposition( |
| 713 browser(), | 723 browser(), |
| 714 url, | 724 url, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 727 // a Javascript call. | 737 // a Javascript call. |
| 728 // Verify that we have 2 tabs, and the download shelf is visible in the current | 738 // Verify that we have 2 tabs, and the download shelf is visible in the current |
| 729 // tab. | 739 // tab. |
| 730 // | 740 // |
| 731 // The download_page1.html page contains an openNew() function that opens a | 741 // The download_page1.html page contains an openNew() function that opens a |
| 732 // tab and then downloads download-test1.lib. | 742 // tab and then downloads download-test1.lib. |
| 733 // | 743 // |
| 734 // The test sometimes trips over underlying flakiness in the downloads | 744 // The test sometimes trips over underlying flakiness in the downloads |
| 735 // subsystem in in http://crbug.com/63237. It's entered as | 745 // subsystem in in http://crbug.com/63237. It's entered as |
| 736 // DISABLED since if 63237 does cause a failure, it'll be a timeout. | 746 // DISABLED since if 63237 does cause a failure, it'll be a timeout. |
| 737 // Additionally, there is Windows-specific flake, http://crbug.com/20809. | |
| 738 IN_PROC_BROWSER_TEST_F(DownloadTest, DISABLED_DontCloseNewTab2) { | 747 IN_PROC_BROWSER_TEST_F(DownloadTest, DISABLED_DontCloseNewTab2) { |
| 739 ASSERT_TRUE(InitialSetup(false)); | 748 ASSERT_TRUE(InitialSetup(false)); |
| 740 // Because it's an HTML link, it should open a web page rather than | 749 // Because it's an HTML link, it should open a web page rather than |
| 741 // downloading. | 750 // downloading. |
| 742 FilePath file1(FILE_PATH_LITERAL("download_page1.html")); | 751 FilePath file1(FILE_PATH_LITERAL("download_page1.html")); |
| 743 GURL url(URLRequestMockHTTPJob::GetMockUrl(file1)); | 752 GURL url(URLRequestMockHTTPJob::GetMockUrl(file1)); |
| 744 | 753 |
| 745 // Open a web page and wait. | 754 // Open a web page and wait. |
| 746 ui_test_utils::NavigateToURL(browser(), url); | 755 ui_test_utils::NavigateToURL(browser(), url); |
| 747 | 756 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 764 // then download a file in the new tab. | 773 // then download a file in the new tab. |
| 765 // Verify that we have 2 tabs, and the download shelf is visible in the current | 774 // Verify that we have 2 tabs, and the download shelf is visible in the current |
| 766 // tab. | 775 // tab. |
| 767 // | 776 // |
| 768 // The download_page2.html page contains an openNew() function that opens a | 777 // The download_page2.html page contains an openNew() function that opens a |
| 769 // tab. | 778 // tab. |
| 770 // | 779 // |
| 771 // The test sometimes trips over underlying flakiness in the downloads | 780 // The test sometimes trips over underlying flakiness in the downloads |
| 772 // subsystem in in http://crbug.com/63237. It's entered as | 781 // subsystem in in http://crbug.com/63237. It's entered as |
| 773 // DISABLED since if 63237 does cause a failure, it'll be a timeout. | 782 // DISABLED since if 63237 does cause a failure, it'll be a timeout. |
| 774 // Additionally, there is Windows-specific flake, http://crbug.com/20809. | |
| 775 IN_PROC_BROWSER_TEST_F(DownloadTest, DISABLED_DontCloseNewTab3) { | 783 IN_PROC_BROWSER_TEST_F(DownloadTest, DISABLED_DontCloseNewTab3) { |
| 776 ASSERT_TRUE(InitialSetup(false)); | 784 ASSERT_TRUE(InitialSetup(false)); |
| 777 // Because it's an HTML link, it should open a web page rather than | 785 // Because it's an HTML link, it should open a web page rather than |
| 778 // downloading. | 786 // downloading. |
| 779 FilePath file1(FILE_PATH_LITERAL("download_page2.html")); | 787 FilePath file1(FILE_PATH_LITERAL("download_page2.html")); |
| 780 GURL url1(URLRequestMockHTTPJob::GetMockUrl(file1)); | 788 GURL url1(URLRequestMockHTTPJob::GetMockUrl(file1)); |
| 781 | 789 |
| 782 // Open a web page and wait. | 790 // Open a web page and wait. |
| 783 ui_test_utils::NavigateToURL(browser(), url1); | 791 ui_test_utils::NavigateToURL(browser(), url1); |
| 784 | 792 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 811 // which will do so in a temporary tab. | 819 // which will do so in a temporary tab. |
| 812 // Verify that we have 1 tab, and the download shelf is visible. | 820 // Verify that we have 1 tab, and the download shelf is visible. |
| 813 // | 821 // |
| 814 // The download_page3.html page contains an openNew() function that opens a | 822 // The download_page3.html page contains an openNew() function that opens a |
| 815 // tab with download-test1.lib in the URL. When the URL is determined to be | 823 // tab with download-test1.lib in the URL. When the URL is determined to be |
| 816 // a download, the tab is closed automatically. | 824 // a download, the tab is closed automatically. |
| 817 // | 825 // |
| 818 // The test sometimes trips over underlying flakiness in the downloads | 826 // The test sometimes trips over underlying flakiness in the downloads |
| 819 // subsystem in in http://crbug.com/63237. It's entered as | 827 // subsystem in in http://crbug.com/63237. It's entered as |
| 820 // DISABLED since if 63237 does cause a failure, it'll be a timeout. | 828 // DISABLED since if 63237 does cause a failure, it'll be a timeout. |
| 821 // Additionally, there is Windows-specific flake, http://crbug.com/20809. | |
| 822 IN_PROC_BROWSER_TEST_F(DownloadTest, DISABLED_CloseNewTab2) { | 829 IN_PROC_BROWSER_TEST_F(DownloadTest, DISABLED_CloseNewTab2) { |
| 823 ASSERT_TRUE(InitialSetup(false)); | 830 ASSERT_TRUE(InitialSetup(false)); |
| 824 // Because it's an HTML link, it should open a web page rather than | 831 // Because it's an HTML link, it should open a web page rather than |
| 825 // downloading. | 832 // downloading. |
| 826 FilePath file1(FILE_PATH_LITERAL("download_page3.html")); | 833 FilePath file1(FILE_PATH_LITERAL("download_page3.html")); |
| 827 GURL url(URLRequestMockHTTPJob::GetMockUrl(file1)); | 834 GURL url(URLRequestMockHTTPJob::GetMockUrl(file1)); |
| 828 | 835 |
| 829 // Open a web page and wait. | 836 // Open a web page and wait. |
| 830 ui_test_utils::NavigateToURL(browser(), url); | 837 ui_test_utils::NavigateToURL(browser(), url); |
| 831 | 838 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 849 // download a file in a new tab, which is closed automatically when the | 856 // download a file in a new tab, which is closed automatically when the |
| 850 // download begins. | 857 // download begins. |
| 851 // Verify that we have 1 tab, and the download shelf is visible. | 858 // Verify that we have 1 tab, and the download shelf is visible. |
| 852 // | 859 // |
| 853 // The download_page4.html page contains a form with download-test1.lib as the | 860 // The download_page4.html page contains a form with download-test1.lib as the |
| 854 // action. | 861 // action. |
| 855 // | 862 // |
| 856 // The test sometimes trips over underlying flakiness in the downloads | 863 // The test sometimes trips over underlying flakiness in the downloads |
| 857 // subsystem in in http://crbug.com/63237. It's entered as | 864 // subsystem in in http://crbug.com/63237. It's entered as |
| 858 // DISABLED since if 63237 does cause a failure, it'll be a timeout. | 865 // DISABLED since if 63237 does cause a failure, it'll be a timeout. |
| 859 // Additionally, there is Windows-specific flake, http://crbug.com/20809. | |
| 860 IN_PROC_BROWSER_TEST_F(DownloadTest, DISABLED_CloseNewTab3) { | 866 IN_PROC_BROWSER_TEST_F(DownloadTest, DISABLED_CloseNewTab3) { |
| 861 ASSERT_TRUE(InitialSetup(false)); | 867 ASSERT_TRUE(InitialSetup(false)); |
| 862 // Because it's an HTML link, it should open a web page rather than | 868 // Because it's an HTML link, it should open a web page rather than |
| 863 // downloading. | 869 // downloading. |
| 864 FilePath file1(FILE_PATH_LITERAL("download_page4.html")); | 870 FilePath file1(FILE_PATH_LITERAL("download_page4.html")); |
| 865 GURL url(URLRequestMockHTTPJob::GetMockUrl(file1)); | 871 GURL url(URLRequestMockHTTPJob::GetMockUrl(file1)); |
| 866 | 872 |
| 867 // Open a web page and wait. | 873 // Open a web page and wait. |
| 868 ui_test_utils::NavigateToURL(browser(), url); | 874 ui_test_utils::NavigateToURL(browser(), url); |
| 869 | 875 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 891 // Close the new window. | 897 // Close the new window. |
| 892 // Verify that we have 1 window, and the download shelf is not visible. | 898 // Verify that we have 1 window, and the download shelf is not visible. |
| 893 // | 899 // |
| 894 // Regression test for http://crbug.com/44454 | 900 // Regression test for http://crbug.com/44454 |
| 895 // | 901 // |
| 896 // Test is believed mostly good (non-flaky) in itself, but it | 902 // Test is believed mostly good (non-flaky) in itself, but it |
| 897 // sometimes trips over underlying flakiness in the downloads | 903 // sometimes trips over underlying flakiness in the downloads |
| 898 // subsystem in in http://crbug.com/63237. Until that bug is | 904 // subsystem in in http://crbug.com/63237. Until that bug is |
| 899 // fixed, this test should be considered flaky. It's entered as | 905 // fixed, this test should be considered flaky. It's entered as |
| 900 // DISABLED since if 63237 does cause a failure, it'll be a timeout. | 906 // DISABLED since if 63237 does cause a failure, it'll be a timeout. |
| 901 // Additionally, there is Windows-specific flake, http://crbug.com/20809. | |
| 902 IN_PROC_BROWSER_TEST_F(DownloadTest, DISABLED_NewWindow) { | 907 IN_PROC_BROWSER_TEST_F(DownloadTest, DISABLED_NewWindow) { |
| 903 ASSERT_TRUE(InitialSetup(false)); | 908 ASSERT_TRUE(InitialSetup(false)); |
| 904 FilePath file(FILE_PATH_LITERAL("download-test1.lib")); | 909 FilePath file(FILE_PATH_LITERAL("download-test1.lib")); |
| 905 GURL url(URLRequestMockHTTPJob::GetMockUrl(file)); | 910 GURL url(URLRequestMockHTTPJob::GetMockUrl(file)); |
| 906 Browser* first_browser = browser(); | 911 Browser* first_browser = browser(); |
| 907 | 912 |
| 908 // Download a file in a new window and wait. | 913 // Download a file in a new window and wait. |
| 909 DownloadAndWaitWithDisposition(browser(), | 914 DownloadAndWaitWithDisposition(browser(), |
| 910 url, | 915 url, |
| 911 NEW_WINDOW, | 916 NEW_WINDOW, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 937 window_count = BrowserList::size(); | 942 window_count = BrowserList::size(); |
| 938 EXPECT_EQ(1, window_count); | 943 EXPECT_EQ(1, window_count); |
| 939 EXPECT_EQ(1, browser()->tab_count()); | 944 EXPECT_EQ(1, browser()->tab_count()); |
| 940 // The download shelf should not be visible in the remaining window. | 945 // The download shelf should not be visible in the remaining window. |
| 941 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible()); | 946 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible()); |
| 942 | 947 |
| 943 CheckDownload(browser(), file, file); | 948 CheckDownload(browser(), file, file); |
| 944 } | 949 } |
| 945 | 950 |
| 946 } // namespace | 951 } // namespace |
| OLD | NEW |