| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/browser.h" |
| 6 #include "chrome/browser/tab_contents/tab_contents.h" |
| 7 #include "chrome/common/chrome_paths.h" |
| 8 #include "chrome/common/chrome_switches.h" |
| 9 #include "chrome/common/extensions/extension_error_reporter.h" |
| 10 #include "chrome/test/in_process_browser_test.h" |
| 11 #include "chrome/test/ui_test_utils.h" |
| 12 #include "net/base/net_util.h" |
| 13 |
| 14 class RenderViewHostManagerTest : public InProcessBrowserTest { |
| 15 public: |
| 16 RenderViewHostManagerTest() { |
| 17 EnableDOMAutomation(); |
| 18 } |
| 19 virtual void SetUpCommandLine(CommandLine* command_line) { |
| 20 command_line->AppendSwitch(switches::kEnableExtensions); |
| 21 } |
| 22 }; |
| 23 |
| 24 // Test for crbug.com/14505. This tests that chrome:// urls are still functional |
| 25 // after download of a file while viewing another chrome://. |
| 26 IN_PROC_BROWSER_TEST_F(RenderViewHostManagerTest, ChromeURLAfterDownload) { |
| 27 GURL downloads_url("chrome://downloads"); |
| 28 GURL extensions_url("chrome://extensions"); |
| 29 FilePath zip_download; |
| 30 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &zip_download)); |
| 31 zip_download = zip_download.AppendASCII("zip").AppendASCII("test.zip"); |
| 32 GURL zip_url = net::FilePathToFileURL(zip_download); |
| 33 |
| 34 ui_test_utils::NavigateToURL(browser(), downloads_url); |
| 35 ui_test_utils::NavigateToURL(browser(), zip_url); |
| 36 ui_test_utils::NavigateToURL(browser(), extensions_url); |
| 37 |
| 38 TabContents *contents = browser()->GetSelectedTabContents(); |
| 39 ASSERT_TRUE(contents); |
| 40 bool domui_responded = false; |
| 41 EXPECT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractBool( |
| 42 contents, |
| 43 L"", |
| 44 L"window.domAutomationController.send(window.domui_responded_);", |
| 45 &domui_responded)); |
| 46 EXPECT_TRUE(domui_responded); |
| 47 } |
| OLD | NEW |