| 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/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 void SetUpOnMainThread() override { | 22 void SetUpOnMainThread() override { |
| 23 WebUIBrowserTest::SetUpOnMainThread(); | 23 WebUIBrowserTest::SetUpOnMainThread(); |
| 24 AddLibrary( | 24 AddLibrary( |
| 25 base::FilePath(FILE_PATH_LITERAL("webview_content_script_test.js"))); | 25 base::FilePath(FILE_PATH_LITERAL("webview_content_script_test.js"))); |
| 26 AddLibrary( | 26 AddLibrary( |
| 27 base::FilePath(FILE_PATH_LITERAL("webview_basic.js"))); | 27 base::FilePath(FILE_PATH_LITERAL("webview_basic.js"))); |
| 28 | 28 |
| 29 base::FilePath test_data_dir; | 29 base::FilePath test_data_dir; |
| 30 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir); | 30 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir); |
| 31 embedded_test_server()->ServeFilesFromDirectory(test_data_dir); | 31 embedded_test_server()->ServeFilesFromDirectory(test_data_dir); |
| 32 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 32 ASSERT_TRUE(embedded_test_server()->Start()); |
| 33 } | 33 } |
| 34 | 34 |
| 35 GURL GetTestUrl(const std::string& path) const { | 35 GURL GetTestUrl(const std::string& path) const { |
| 36 return embedded_test_server()->base_url().Resolve(path); | 36 return embedded_test_server()->base_url().Resolve(path); |
| 37 } | 37 } |
| 38 | 38 |
| 39 GURL GetWebViewEnabledWebUIURL() const { | 39 GURL GetWebViewEnabledWebUIURL() const { |
| 40 return GURL(chrome::kChromeUIChromeSigninURL); | 40 return GURL(chrome::kChromeUIChromeSigninURL); |
| 41 } | 41 } |
| 42 | 42 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 #endif | 167 #endif |
| 168 | 168 |
| 169 IN_PROC_BROWSER_TEST_F(WebUIWebViewBrowserTest, ContextMenuInspectElement) { | 169 IN_PROC_BROWSER_TEST_F(WebUIWebViewBrowserTest, ContextMenuInspectElement) { |
| 170 ui_test_utils::NavigateToURL(browser(), GetWebViewEnabledWebUIURL()); | 170 ui_test_utils::NavigateToURL(browser(), GetWebViewEnabledWebUIURL()); |
| 171 content::ContextMenuParams params; | 171 content::ContextMenuParams params; |
| 172 TestRenderViewContextMenu menu( | 172 TestRenderViewContextMenu menu( |
| 173 browser()->tab_strip_model()->GetActiveWebContents()->GetMainFrame(), | 173 browser()->tab_strip_model()->GetActiveWebContents()->GetMainFrame(), |
| 174 params); | 174 params); |
| 175 EXPECT_FALSE(menu.IsItemPresent(IDC_CONTENT_CONTEXT_INSPECTELEMENT)); | 175 EXPECT_FALSE(menu.IsItemPresent(IDC_CONTENT_CONTEXT_INSPECTELEMENT)); |
| 176 } | 176 } |
| OLD | NEW |