| 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/process_util.h" | 5 #include "base/process_util.h" |
| 6 #include "base/sys_string_conversions.h" | 6 #include "base/sys_string_conversions.h" |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/extensions/component_loader.h" | 8 #include "chrome/browser/extensions/component_loader.h" |
| 9 #include "chrome/browser/extensions/extension_browsertest.h" | 9 #include "chrome/browser/extensions/extension_browsertest.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 IN_PROC_BROWSER_TEST_F(ExtensionURLRewriteBrowserTest, NewTabPageURLOverride) { | 86 IN_PROC_BROWSER_TEST_F(ExtensionURLRewriteBrowserTest, NewTabPageURLOverride) { |
| 87 // Load an extension to override the NTP and check that the location bar text | 87 // Load an extension to override the NTP and check that the location bar text |
| 88 // is blank after navigating to chrome://newtab. | 88 // is blank after navigating to chrome://newtab. |
| 89 LoadExtension(GetTestExtensionPath("newtab")); | 89 LoadExtension(GetTestExtensionPath("newtab")); |
| 90 TestURLNotShown(GURL(chrome::kChromeUINewTabURL)); | 90 TestURLNotShown(GURL(chrome::kChromeUINewTabURL)); |
| 91 // Check that the internal URL uses the chrome-extension:// scheme. | 91 // Check that the internal URL uses the chrome-extension:// scheme. |
| 92 EXPECT_TRUE(GetNavigationEntry()->GetURL().SchemeIs( | 92 EXPECT_TRUE(GetNavigationEntry()->GetURL().SchemeIs( |
| 93 extensions::kExtensionScheme)); | 93 extensions::kExtensionScheme)); |
| 94 } | 94 } |
| 95 | 95 |
| 96 IN_PROC_BROWSER_TEST_F(ExtensionURLRewriteBrowserTest, BookmarksURL) { | 96 // TODO(linux_aura) http://crbug.com/163931 |
| 97 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(USE_AURA) |
| 98 #define MAYBE_BookmarksURL DISABLED_BookmarksURL |
| 99 #else |
| 100 #define MAYBE_BookmarksURL BookmarksURL |
| 101 #endif |
| 102 IN_PROC_BROWSER_TEST_F(ExtensionURLRewriteBrowserTest, MAYBE_BookmarksURL) { |
| 97 // Navigate to chrome://bookmarks and check that the location bar URL is | 103 // Navigate to chrome://bookmarks and check that the location bar URL is |
| 98 // what was entered and the internal URL uses the chrome-extension:// scheme. | 104 // what was entered and the internal URL uses the chrome-extension:// scheme. |
| 99 TestExtensionURLOverride(GURL(chrome::kChromeUIBookmarksURL)); | 105 TestExtensionURLOverride(GURL(chrome::kChromeUIBookmarksURL)); |
| 100 } | 106 } |
| 101 | 107 |
| 102 #if defined(FILE_MANAGER_EXTENSION) | 108 #if defined(FILE_MANAGER_EXTENSION) |
| 103 IN_PROC_BROWSER_TEST_F(ExtensionURLRewriteBrowserTest, FileManagerURL) { | 109 IN_PROC_BROWSER_TEST_F(ExtensionURLRewriteBrowserTest, FileManagerURL) { |
| 104 // Navigate to chrome://files and check that the location bar URL is | 110 // Navigate to chrome://files and check that the location bar URL is |
| 105 // what was entered and the internal URL uses the chrome-extension:// scheme. | 111 // what was entered and the internal URL uses the chrome-extension:// scheme. |
| 106 TestExtensionURLOverride(GURL(chrome::kChromeUIFileManagerURL)); | 112 TestExtensionURLOverride(GURL(chrome::kChromeUIFileManagerURL)); |
| 107 } | 113 } |
| 108 #endif | 114 #endif |
| 109 | 115 |
| 110 IN_PROC_BROWSER_TEST_F(ExtensionURLRewriteBrowserTest, BookmarksURLWithRef) { | 116 IN_PROC_BROWSER_TEST_F(ExtensionURLRewriteBrowserTest, BookmarksURLWithRef) { |
| 111 // Navigate to chrome://bookmarks/#1 and check that the location bar URL is | 117 // Navigate to chrome://bookmarks/#1 and check that the location bar URL is |
| 112 // what was entered and the internal URL uses the chrome-extension:// scheme. | 118 // what was entered and the internal URL uses the chrome-extension:// scheme. |
| 113 GURL url_with_ref(chrome::kChromeUIBookmarksURL + std::string("#1")); | 119 GURL url_with_ref(chrome::kChromeUIBookmarksURL + std::string("#1")); |
| 114 TestExtensionURLOverride(url_with_ref); | 120 TestExtensionURLOverride(url_with_ref); |
| 115 } | 121 } |
| 116 | 122 |
| 117 // Disabled for flakiness: crbug.com/176332 | 123 // Disabled for flakiness: crbug.com/176332 |
| 118 IN_PROC_BROWSER_TEST_F(ExtensionURLRewriteBrowserTest, | 124 IN_PROC_BROWSER_TEST_F(ExtensionURLRewriteBrowserTest, |
| 119 DISABLED_BookmarksURLOverride) { | 125 DISABLED_BookmarksURLOverride) { |
| 120 // Load an extension that overrides chrome://bookmarks. | 126 // Load an extension that overrides chrome://bookmarks. |
| 121 LoadExtension(GetTestExtensionPath("bookmarks")); | 127 LoadExtension(GetTestExtensionPath("bookmarks")); |
| 122 // Navigate to chrome://bookmarks and check that the location bar URL is what | 128 // Navigate to chrome://bookmarks and check that the location bar URL is what |
| 123 // was entered and the internal URL uses the chrome-extension:// scheme. | 129 // was entered and the internal URL uses the chrome-extension:// scheme. |
| 124 TestExtensionURLOverride(GURL(chrome::kChromeUIBookmarksURL)); | 130 TestExtensionURLOverride(GURL(chrome::kChromeUIBookmarksURL)); |
| 125 } | 131 } |
| OLD | NEW |