OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/scoped_temp_dir.h" | 9 #include "base/scoped_temp_dir.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 1482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1493 EXPECT_EQ(DownloadItem::COMPLETE, info.state); | 1493 EXPECT_EQ(DownloadItem::COMPLETE, info.state); |
1494 } | 1494 } |
1495 | 1495 |
1496 // Test for crbug.com/14505. This tests that chrome:// urls are still functional | 1496 // Test for crbug.com/14505. This tests that chrome:// urls are still functional |
1497 // after download of a file while viewing another chrome://. | 1497 // after download of a file while viewing another chrome://. |
1498 IN_PROC_BROWSER_TEST_F(DownloadTest, ChromeURLAfterDownload) { | 1498 IN_PROC_BROWSER_TEST_F(DownloadTest, ChromeURLAfterDownload) { |
1499 ASSERT_TRUE(InitialSetup(false)); | 1499 ASSERT_TRUE(InitialSetup(false)); |
1500 FilePath file(FILE_PATH_LITERAL("download-test1.lib")); | 1500 FilePath file(FILE_PATH_LITERAL("download-test1.lib")); |
1501 GURL download_url(URLRequestMockHTTPJob::GetMockUrl(file)); | 1501 GURL download_url(URLRequestMockHTTPJob::GetMockUrl(file)); |
1502 GURL flags_url(chrome::kChromeUIFlagsURL); | 1502 GURL flags_url(chrome::kChromeUIFlagsURL); |
1503 GURL extensions_url(chrome::kChromeUIExtensionsURL); | 1503 GURL extensions_url(GURL(std::string(chrome::kChromeUISettingsURL) + |
| 1504 chrome::kExtensionsSubPage)); |
1504 | 1505 |
1505 ui_test_utils::NavigateToURL(browser(), flags_url); | 1506 ui_test_utils::NavigateToURL(browser(), flags_url); |
1506 DownloadAndWait(browser(), download_url, EXPECT_NO_SELECT_DIALOG); | 1507 DownloadAndWait(browser(), download_url, EXPECT_NO_SELECT_DIALOG); |
1507 ui_test_utils::NavigateToURL(browser(), extensions_url); | 1508 ui_test_utils::NavigateToURL(browser(), extensions_url); |
1508 TabContents* contents = browser()->GetSelectedTabContents(); | 1509 TabContents* contents = browser()->GetSelectedTabContents(); |
1509 ASSERT_TRUE(contents); | 1510 ASSERT_TRUE(contents); |
1510 bool webui_responded = false; | 1511 bool webui_responded = false; |
1511 EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( | 1512 EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( |
1512 contents->render_view_host(), | 1513 contents->render_view_host(), |
1513 L"", | 1514 L"", |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1730 EXPECT_EQ(1u, observer->NumDangerousDownloadsSeen()); | 1731 EXPECT_EQ(1u, observer->NumDangerousDownloadsSeen()); |
1731 | 1732 |
1732 // Download shelf should close. Download panel stays open on ChromeOS. | 1733 // Download shelf should close. Download panel stays open on ChromeOS. |
1733 CheckDownloadUI(browser(), false, true, FilePath()); | 1734 CheckDownloadUI(browser(), false, true, FilePath()); |
1734 | 1735 |
1735 // Check that the extension was installed. | 1736 // Check that the extension was installed. |
1736 ExtensionService* extension_service = | 1737 ExtensionService* extension_service = |
1737 browser()->profile()->GetExtensionService(); | 1738 browser()->profile()->GetExtensionService(); |
1738 ASSERT_TRUE(extension_service->GetExtensionById(kLargeThemeCrxId, false)); | 1739 ASSERT_TRUE(extension_service->GetExtensionById(kLargeThemeCrxId, false)); |
1739 } | 1740 } |
OLD | NEW |