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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 // Open an Incognito window. | 572 // Open an Incognito window. |
573 Browser* incognito = CreateIncognitoBrowser(); // Waits. | 573 Browser* incognito = CreateIncognitoBrowser(); // Waits. |
574 ASSERT_TRUE(incognito); | 574 ASSERT_TRUE(incognito); |
575 | 575 |
576 // Create a download item creation waiter on that window. | 576 // Create a download item creation waiter on that window. |
577 DownloadItemCreatedObserver creation_observer( | 577 DownloadItemCreatedObserver creation_observer( |
578 BrowserContext::GetDownloadManager(incognito->profile())); | 578 BrowserContext::GetDownloadManager(incognito->profile())); |
579 | 579 |
580 // Navigate, unblocking with new tab. | 580 // Navigate, unblocking with new tab. |
581 GURL url = URLRequestMockHTTPJob::GetMockUrl("save_page/b.htm"); | 581 GURL url = URLRequestMockHTTPJob::GetMockUrl("save_page/b.htm"); |
582 NavigateToURLWithDisposition(incognito, url, NEW_FOREGROUND_TAB, | 582 NavigateToURLWithDisposition(incognito, url, |
| 583 WindowOpenDisposition::NEW_FOREGROUND_TAB, |
583 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB); | 584 ui_test_utils::BROWSER_TEST_WAIT_FOR_TAB); |
584 | 585 |
585 // Save the page before completion. | 586 // Save the page before completion. |
586 base::FilePath full_file_name, dir; | 587 base::FilePath full_file_name, dir; |
587 GetDestinationPaths("b", &full_file_name, &dir); | 588 GetDestinationPaths("b", &full_file_name, &dir); |
588 scoped_refptr<content::MessageLoopRunner> loop_runner( | 589 scoped_refptr<content::MessageLoopRunner> loop_runner( |
589 new content::MessageLoopRunner); | 590 new content::MessageLoopRunner); |
590 SavePackageFinishedObserver observer( | 591 SavePackageFinishedObserver observer( |
591 content::BrowserContext::GetDownloadManager(incognito->profile()), | 592 content::BrowserContext::GetDownloadManager(incognito->profile()), |
592 loop_runner->QuitClosure()); | 593 loop_runner->QuitClosure()); |
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1316 TestOriginalVsSavedPage(save_page_type, url, 1, expected_substrings); | 1317 TestOriginalVsSavedPage(save_page_type, url, 1, expected_substrings); |
1317 } | 1318 } |
1318 | 1319 |
1319 INSTANTIATE_TEST_CASE_P( | 1320 INSTANTIATE_TEST_CASE_P( |
1320 SaveType, | 1321 SaveType, |
1321 SavePageOriginalVsSavedComparisonTest, | 1322 SavePageOriginalVsSavedComparisonTest, |
1322 ::testing::Values(content::SAVE_PAGE_TYPE_AS_COMPLETE_HTML, | 1323 ::testing::Values(content::SAVE_PAGE_TYPE_AS_COMPLETE_HTML, |
1323 content::SAVE_PAGE_TYPE_AS_MHTML)); | 1324 content::SAVE_PAGE_TYPE_AS_MHTML)); |
1324 | 1325 |
1325 } // namespace | 1326 } // namespace |
OLD | NEW |