Chromium Code Reviews| 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 "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
| 9 #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_uti l.h" | 9 #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_uti l.h" |
| 10 #include "chrome/browser/signin/signin_promo.h" | 10 #include "chrome/browser/signin/signin_promo.h" |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 32 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir); | 32 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir); |
| 33 embedded_test_server()->ServeFilesFromDirectory(test_data_dir); | 33 embedded_test_server()->ServeFilesFromDirectory(test_data_dir); |
| 34 ASSERT_TRUE(embedded_test_server()->Start()); | 34 ASSERT_TRUE(embedded_test_server()->Start()); |
| 35 } | 35 } |
| 36 | 36 |
| 37 GURL GetTestUrl(const std::string& path) const { | 37 GURL GetTestUrl(const std::string& path) const { |
| 38 return embedded_test_server()->base_url().Resolve(path); | 38 return embedded_test_server()->base_url().Resolve(path); |
| 39 } | 39 } |
| 40 | 40 |
| 41 GURL GetWebViewEnabledWebUIURL() const { | 41 GURL GetWebViewEnabledWebUIURL() const { |
| 42 #if defined(OS_CHROMEOS) | |
| 43 return GURL("chrome://oobe/login"); | |
|
xiyuan
2016/01/26 16:39:56
nit: return GURL(chrome::kChromeUIOobeURL).Resolve
dzhioev (left Google)
2016/01/28 00:27:00
Done.
| |
| 44 #else | |
| 42 return GURL(signin::GetPromoURL( | 45 return GURL(signin::GetPromoURL( |
| 43 signin_metrics::AccessPoint::ACCESS_POINT_START_PAGE, | 46 signin_metrics::AccessPoint::ACCESS_POINT_START_PAGE, |
| 44 signin_metrics::Reason::REASON_SIGNIN_PRIMARY_ACCOUNT, false)); | 47 signin_metrics::Reason::REASON_SIGNIN_PRIMARY_ACCOUNT, false)); |
| 48 #endif | |
| 45 } | 49 } |
| 46 | 50 |
| 47 private: | 51 private: |
| 48 DISALLOW_COPY_AND_ASSIGN(WebUIWebViewBrowserTest); | 52 DISALLOW_COPY_AND_ASSIGN(WebUIWebViewBrowserTest); |
| 49 }; | 53 }; |
| 50 | 54 |
| 51 // Checks that hiding and showing the WebUI host page doesn't break guests in | 55 // Checks that hiding and showing the WebUI host page doesn't break guests in |
| 52 // it. | 56 // it. |
| 53 // Regression test for http://crbug.com/515268 | 57 // Regression test for http://crbug.com/515268 |
| 54 IN_PROC_BROWSER_TEST_F(WebUIWebViewBrowserTest, DisplayNone) { | 58 IN_PROC_BROWSER_TEST_F(WebUIWebViewBrowserTest, DisplayNone) { |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 171 #endif | 175 #endif |
| 172 | 176 |
| 173 IN_PROC_BROWSER_TEST_F(WebUIWebViewBrowserTest, ContextMenuInspectElement) { | 177 IN_PROC_BROWSER_TEST_F(WebUIWebViewBrowserTest, ContextMenuInspectElement) { |
| 174 ui_test_utils::NavigateToURL(browser(), GetWebViewEnabledWebUIURL()); | 178 ui_test_utils::NavigateToURL(browser(), GetWebViewEnabledWebUIURL()); |
| 175 content::ContextMenuParams params; | 179 content::ContextMenuParams params; |
| 176 TestRenderViewContextMenu menu( | 180 TestRenderViewContextMenu menu( |
| 177 browser()->tab_strip_model()->GetActiveWebContents()->GetMainFrame(), | 181 browser()->tab_strip_model()->GetActiveWebContents()->GetMainFrame(), |
| 178 params); | 182 params); |
| 179 EXPECT_FALSE(menu.IsItemPresent(IDC_CONTENT_CONTEXT_INSPECTELEMENT)); | 183 EXPECT_FALSE(menu.IsItemPresent(IDC_CONTENT_CONTEXT_INSPECTELEMENT)); |
| 180 } | 184 } |
| OLD | NEW |