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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 EXPECT_TRUE(incognito->window()->IsDownloadShelfVisible()); | 617 EXPECT_TRUE(incognito->window()->IsDownloadShelfVisible()); |
618 | 618 |
619 // We can't check more than this because SavePackage is racing with | 619 // We can't check more than this because SavePackage is racing with |
620 // the page load. If the page load won the race, then SavePackage | 620 // the page load. If the page load won the race, then SavePackage |
621 // might have completed. If the page load lost the race, then | 621 // might have completed. If the page load lost the race, then |
622 // SavePackage will cancel because there aren't any resources to | 622 // SavePackage will cancel because there aren't any resources to |
623 // save. | 623 // save. |
624 } | 624 } |
625 | 625 |
626 IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, NoSave) { | 626 IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, NoSave) { |
627 ui_test_utils::NavigateToURL(browser(), GURL(content::kAboutBlankURL)); | 627 ui_test_utils::NavigateToURL(browser(), GURL(url::kAboutBlankURL)); |
628 EXPECT_FALSE(chrome::CanSavePage(browser())); | 628 EXPECT_FALSE(chrome::CanSavePage(browser())); |
629 } | 629 } |
630 | 630 |
631 // Disabled on Windows due to flakiness. http://crbug.com/162323 | 631 // Disabled on Windows due to flakiness. http://crbug.com/162323 |
632 #if defined(OS_WIN) | 632 #if defined(OS_WIN) |
633 #define MAYBE_FileNameFromPageTitle DISABLED_FileNameFromPageTitle | 633 #define MAYBE_FileNameFromPageTitle DISABLED_FileNameFromPageTitle |
634 #else | 634 #else |
635 #define MAYBE_FileNameFromPageTitle FileNameFromPageTitle | 635 #define MAYBE_FileNameFromPageTitle FileNameFromPageTitle |
636 #endif | 636 #endif |
637 IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, MAYBE_FileNameFromPageTitle) { | 637 IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, MAYBE_FileNameFromPageTitle) { |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 base::FilePath download_dir = DownloadPrefs::FromDownloadManager( | 805 base::FilePath download_dir = DownloadPrefs::FromDownloadManager( |
806 GetDownloadManager())->DownloadPath(); | 806 GetDownloadManager())->DownloadPath(); |
807 base::FilePath filename = download_dir.AppendASCII("dataurl.txt"); | 807 base::FilePath filename = download_dir.AppendASCII("dataurl.txt"); |
808 ASSERT_TRUE(base::PathExists(filename)); | 808 ASSERT_TRUE(base::PathExists(filename)); |
809 std::string contents; | 809 std::string contents; |
810 EXPECT_TRUE(base::ReadFileToString(filename, &contents)); | 810 EXPECT_TRUE(base::ReadFileToString(filename, &contents)); |
811 EXPECT_EQ("foo", contents); | 811 EXPECT_EQ("foo", contents); |
812 } | 812 } |
813 | 813 |
814 } // namespace | 814 } // namespace |
OLD | NEW |