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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 test_dir_.Append(base::FilePath(kTestDir)).Append(file_name), | 531 test_dir_.Append(base::FilePath(kTestDir)).Append(file_name), |
532 full_file_name)); | 532 full_file_name)); |
533 } | 533 } |
534 | 534 |
535 // Disabled on Windows due to flakiness. http://crbug.com/162323 | 535 // Disabled on Windows due to flakiness. http://crbug.com/162323 |
536 #if defined(OS_WIN) | 536 #if defined(OS_WIN) |
537 #define MAYBE_SaveCompleteHTML DISABLED_SaveCompleteHTML | 537 #define MAYBE_SaveCompleteHTML DISABLED_SaveCompleteHTML |
538 #else | 538 #else |
539 #define MAYBE_SaveCompleteHTML SaveCompleteHTML | 539 #define MAYBE_SaveCompleteHTML SaveCompleteHTML |
540 #endif | 540 #endif |
541 IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, DISABLED_SaveCompleteHTML) { | 541 IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, SaveCompleteHTML) { |
542 GURL url = NavigateToMockURL("b"); | 542 GURL url = NavigateToMockURL("b"); |
543 | 543 |
544 base::FilePath full_file_name, dir; | 544 base::FilePath full_file_name, dir; |
545 GetDestinationPaths("b", &full_file_name, &dir); | 545 GetDestinationPaths("b", &full_file_name, &dir); |
546 DownloadPersistedObserver persisted(browser()->profile(), base::Bind( | 546 DownloadPersistedObserver persisted(browser()->profile(), base::Bind( |
547 &DownloadStoredProperly, url, full_file_name, 3, | 547 &DownloadStoredProperly, url, full_file_name, 3, |
548 history::DownloadState::COMPLETE)); | 548 history::DownloadState::COMPLETE)); |
549 scoped_refptr<content::MessageLoopRunner> loop_runner( | 549 scoped_refptr<content::MessageLoopRunner> loop_runner( |
550 new content::MessageLoopRunner); | 550 new content::MessageLoopRunner); |
551 SavePackageFinishedObserver observer( | 551 SavePackageFinishedObserver observer( |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 ui_test_utils::NavigateToURL(browser(), GURL(url::kAboutBlankURL)); | 624 ui_test_utils::NavigateToURL(browser(), GURL(url::kAboutBlankURL)); |
625 EXPECT_FALSE(chrome::CanSavePage(browser())); | 625 EXPECT_FALSE(chrome::CanSavePage(browser())); |
626 } | 626 } |
627 | 627 |
628 // Disabled on Windows due to flakiness. http://crbug.com/162323 | 628 // Disabled on Windows due to flakiness. http://crbug.com/162323 |
629 #if defined(OS_WIN) | 629 #if defined(OS_WIN) |
630 #define MAYBE_FileNameFromPageTitle DISABLED_FileNameFromPageTitle | 630 #define MAYBE_FileNameFromPageTitle DISABLED_FileNameFromPageTitle |
631 #else | 631 #else |
632 #define MAYBE_FileNameFromPageTitle FileNameFromPageTitle | 632 #define MAYBE_FileNameFromPageTitle FileNameFromPageTitle |
633 #endif | 633 #endif |
634 IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, DISABLED_FileNameFromPageTitle) { | 634 IN_PROC_BROWSER_TEST_F(SavePageBrowserTest, FileNameFromPageTitle) { |
635 GURL url = NavigateToMockURL("b"); | 635 GURL url = NavigateToMockURL("b"); |
636 | 636 |
637 base::FilePath full_file_name = save_dir_.path().AppendASCII( | 637 base::FilePath full_file_name = save_dir_.path().AppendASCII( |
638 std::string("Test page for saving page feature") + kAppendedExtension); | 638 std::string("Test page for saving page feature") + kAppendedExtension); |
639 base::FilePath dir = save_dir_.path().AppendASCII( | 639 base::FilePath dir = save_dir_.path().AppendASCII( |
640 "Test page for saving page feature_files"); | 640 "Test page for saving page feature_files"); |
641 DownloadPersistedObserver persisted(browser()->profile(), base::Bind( | 641 DownloadPersistedObserver persisted(browser()->profile(), base::Bind( |
642 &DownloadStoredProperly, url, full_file_name, 3, | 642 &DownloadStoredProperly, url, full_file_name, 3, |
643 history::DownloadState::COMPLETE)); | 643 history::DownloadState::COMPLETE)); |
644 scoped_refptr<content::MessageLoopRunner> loop_runner( | 644 scoped_refptr<content::MessageLoopRunner> loop_runner( |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 base::FilePath download_dir = DownloadPrefs::FromDownloadManager( | 802 base::FilePath download_dir = DownloadPrefs::FromDownloadManager( |
803 GetDownloadManager())->DownloadPath(); | 803 GetDownloadManager())->DownloadPath(); |
804 base::FilePath filename = download_dir.AppendASCII("dataurl.txt"); | 804 base::FilePath filename = download_dir.AppendASCII("dataurl.txt"); |
805 ASSERT_TRUE(base::PathExists(filename)); | 805 ASSERT_TRUE(base::PathExists(filename)); |
806 std::string contents; | 806 std::string contents; |
807 EXPECT_TRUE(base::ReadFileToString(filename, &contents)); | 807 EXPECT_TRUE(base::ReadFileToString(filename, &contents)); |
808 EXPECT_EQ("foo", contents); | 808 EXPECT_EQ("foo", contents); |
809 } | 809 } |
810 | 810 |
811 } // namespace | 811 } // namespace |
OLD | NEW |