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/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 test_dir_.Append(base::FilePath(kTestDir)).Append(file_name), | 527 test_dir_.Append(base::FilePath(kTestDir)).Append(file_name), |
528 full_file_name)); | 528 full_file_name)); |
529 } | 529 } |
530 | 530 |
531 // Disabled on Windows due to flakiness. http://crbug.com/162323 | 531 // Disabled on Windows due to flakiness. http://crbug.com/162323 |
532 #if defined(OS_WIN) | 532 #if defined(OS_WIN) |
533 #define MAYBE_SaveCompleteHTML DISABLED_SaveCompleteHTML | 533 #define MAYBE_SaveCompleteHTML DISABLED_SaveCompleteHTML |
534 #else | 534 #else |
535 #define MAYBE_SaveCompleteHTML SaveCompleteHTML | 535 #define MAYBE_SaveCompleteHTML SaveCompleteHTML |
536 #endif | 536 #endif |
537 IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, SaveCompleteHTML) { | 537 IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, DISABLED_SaveCompleteHTML) { |
538 GURL url = NavigateToMockURL("b"); | 538 GURL url = NavigateToMockURL("b"); |
539 | 539 |
540 base::FilePath full_file_name, dir; | 540 base::FilePath full_file_name, dir; |
541 GetDestinationPaths("b", &full_file_name, &dir); | 541 GetDestinationPaths("b", &full_file_name, &dir); |
542 DownloadPersistedObserver persisted(browser()->profile(), base::Bind( | 542 DownloadPersistedObserver persisted(browser()->profile(), base::Bind( |
543 &DownloadStoredProperly, url, full_file_name, 3, | 543 &DownloadStoredProperly, url, full_file_name, 3, |
544 history::DownloadState::COMPLETE)); | 544 history::DownloadState::COMPLETE)); |
545 scoped_refptr<content::MessageLoopRunner> loop_runner( | 545 scoped_refptr<content::MessageLoopRunner> loop_runner( |
546 new content::MessageLoopRunner); | 546 new content::MessageLoopRunner); |
547 SavePackageFinishedObserver observer( | 547 SavePackageFinishedObserver observer( |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 ui_test_utils::NavigateToURL(browser(), GURL(url::kAboutBlankURL)); | 615 ui_test_utils::NavigateToURL(browser(), GURL(url::kAboutBlankURL)); |
616 EXPECT_FALSE(chrome::CanSavePage(browser())); | 616 EXPECT_FALSE(chrome::CanSavePage(browser())); |
617 } | 617 } |
618 | 618 |
619 // Disabled on Windows due to flakiness. http://crbug.com/162323 | 619 // Disabled on Windows due to flakiness. http://crbug.com/162323 |
620 #if defined(OS_WIN) | 620 #if defined(OS_WIN) |
621 #define MAYBE_FileNameFromPageTitle DISABLED_FileNameFromPageTitle | 621 #define MAYBE_FileNameFromPageTitle DISABLED_FileNameFromPageTitle |
622 #else | 622 #else |
623 #define MAYBE_FileNameFromPageTitle FileNameFromPageTitle | 623 #define MAYBE_FileNameFromPageTitle FileNameFromPageTitle |
624 #endif | 624 #endif |
625 IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, FileNameFromPageTitle) { | 625 IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, DISABLED_FileNameFromPageTitle) { |
626 GURL url = NavigateToMockURL("b"); | 626 GURL url = NavigateToMockURL("b"); |
627 | 627 |
628 base::FilePath full_file_name = save_dir_.path().AppendASCII( | 628 base::FilePath full_file_name = save_dir_.path().AppendASCII( |
629 std::string("Test page for saving page feature") + kAppendedExtension); | 629 std::string("Test page for saving page feature") + kAppendedExtension); |
630 base::FilePath dir = save_dir_.path().AppendASCII( | 630 base::FilePath dir = save_dir_.path().AppendASCII( |
631 "Test page for saving page feature_files"); | 631 "Test page for saving page feature_files"); |
632 DownloadPersistedObserver persisted(browser()->profile(), base::Bind( | 632 DownloadPersistedObserver persisted(browser()->profile(), base::Bind( |
633 &DownloadStoredProperly, url, full_file_name, 3, | 633 &DownloadStoredProperly, url, full_file_name, 3, |
634 history::DownloadState::COMPLETE)); | 634 history::DownloadState::COMPLETE)); |
635 scoped_refptr<content::MessageLoopRunner> loop_runner( | 635 scoped_refptr<content::MessageLoopRunner> loop_runner( |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
789 base::FilePath download_dir = DownloadPrefs::FromDownloadManager( | 789 base::FilePath download_dir = DownloadPrefs::FromDownloadManager( |
790 GetDownloadManager())->DownloadPath(); | 790 GetDownloadManager())->DownloadPath(); |
791 base::FilePath filename = download_dir.AppendASCII("dataurl.txt"); | 791 base::FilePath filename = download_dir.AppendASCII("dataurl.txt"); |
792 ASSERT_TRUE(base::PathExists(filename)); | 792 ASSERT_TRUE(base::PathExists(filename)); |
793 std::string contents; | 793 std::string contents; |
794 EXPECT_TRUE(base::ReadFileToString(filename, &contents)); | 794 EXPECT_TRUE(base::ReadFileToString(filename, &contents)); |
795 EXPECT_EQ("foo", contents); | 795 EXPECT_EQ("foo", contents); |
796 } | 796 } |
797 | 797 |
798 } // namespace | 798 } // namespace |
OLD | NEW |