| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/macros.h" | 5 #include "base/macros.h" |
| 6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
| 8 #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_uti
l.h" | 8 #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_uti
l.h" |
| 9 #include "chrome/browser/signin/signin_promo.h" |
| 9 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 11 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 11 #include "chrome/common/chrome_paths.h" | 12 #include "chrome/common/chrome_paths.h" |
| 12 #include "chrome/common/url_constants.h" | 13 #include "chrome/common/url_constants.h" |
| 13 #include "chrome/test/base/ui_test_utils.h" | 14 #include "chrome/test/base/ui_test_utils.h" |
| 14 #include "chrome/test/base/web_ui_browser_test.h" | 15 #include "chrome/test/base/web_ui_browser_test.h" |
| 15 #include "content/public/common/context_menu_params.h" | 16 #include "content/public/common/context_menu_params.h" |
| 16 #include "net/test/embedded_test_server/embedded_test_server.h" | 17 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 17 | 18 |
| 18 class WebUIWebViewBrowserTest : public WebUIBrowserTest { | 19 class WebUIWebViewBrowserTest : public WebUIBrowserTest { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 30 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir); | 31 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir); |
| 31 embedded_test_server()->ServeFilesFromDirectory(test_data_dir); | 32 embedded_test_server()->ServeFilesFromDirectory(test_data_dir); |
| 32 ASSERT_TRUE(embedded_test_server()->Start()); | 33 ASSERT_TRUE(embedded_test_server()->Start()); |
| 33 } | 34 } |
| 34 | 35 |
| 35 GURL GetTestUrl(const std::string& path) const { | 36 GURL GetTestUrl(const std::string& path) const { |
| 36 return embedded_test_server()->base_url().Resolve(path); | 37 return embedded_test_server()->base_url().Resolve(path); |
| 37 } | 38 } |
| 38 | 39 |
| 39 GURL GetWebViewEnabledWebUIURL() const { | 40 GURL GetWebViewEnabledWebUIURL() const { |
| 40 return GURL(chrome::kChromeUIChromeSigninURL); | 41 return GURL(signin::GetPromoURL( |
| 42 signin_metrics::AccessPoint::ACCESS_POINT_START_PAGE, |
| 43 signin_metrics::Reason::REASON_SIGNIN_PRIMARY_ACCOUNT, false)); |
| 41 } | 44 } |
| 42 | 45 |
| 43 private: | 46 private: |
| 44 DISALLOW_COPY_AND_ASSIGN(WebUIWebViewBrowserTest); | 47 DISALLOW_COPY_AND_ASSIGN(WebUIWebViewBrowserTest); |
| 45 }; | 48 }; |
| 46 | 49 |
| 47 // Checks that hiding and showing the WebUI host page doesn't break guests in | 50 // Checks that hiding and showing the WebUI host page doesn't break guests in |
| 48 // it. | 51 // it. |
| 49 // Regression test for http://crbug.com/515268 | 52 // Regression test for http://crbug.com/515268 |
| 50 IN_PROC_BROWSER_TEST_F(WebUIWebViewBrowserTest, DisplayNone) { | 53 IN_PROC_BROWSER_TEST_F(WebUIWebViewBrowserTest, DisplayNone) { |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 #endif | 170 #endif |
| 168 | 171 |
| 169 IN_PROC_BROWSER_TEST_F(WebUIWebViewBrowserTest, ContextMenuInspectElement) { | 172 IN_PROC_BROWSER_TEST_F(WebUIWebViewBrowserTest, ContextMenuInspectElement) { |
| 170 ui_test_utils::NavigateToURL(browser(), GetWebViewEnabledWebUIURL()); | 173 ui_test_utils::NavigateToURL(browser(), GetWebViewEnabledWebUIURL()); |
| 171 content::ContextMenuParams params; | 174 content::ContextMenuParams params; |
| 172 TestRenderViewContextMenu menu( | 175 TestRenderViewContextMenu menu( |
| 173 browser()->tab_strip_model()->GetActiveWebContents()->GetMainFrame(), | 176 browser()->tab_strip_model()->GetActiveWebContents()->GetMainFrame(), |
| 174 params); | 177 params); |
| 175 EXPECT_FALSE(menu.IsItemPresent(IDC_CONTENT_CONTEXT_INSPECTELEMENT)); | 178 EXPECT_FALSE(menu.IsItemPresent(IDC_CONTENT_CONTEXT_INSPECTELEMENT)); |
| 176 } | 179 } |
| OLD | NEW |