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 "chrome/app/chrome_command_ids.h" | 5 #include "chrome/app/chrome_command_ids.h" |
6 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" | 6 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" |
7 #include "chrome/browser/extensions/extension_apitest.h" | 7 #include "chrome/browser/extensions/extension_apitest.h" |
8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/tab_contents/render_view_context_menu.h" | 10 #include "chrome/browser/tab_contents/render_view_context_menu.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 // http://crbug.com/118478 | 26 // http://crbug.com/118478 |
27 #define MAYBE_WebNavigationIFrame DISABLED_WebNavigationIFrame | 27 #define MAYBE_WebNavigationIFrame DISABLED_WebNavigationIFrame |
28 #define MAYBE_WebNavigationFailures DISABLED_WebNavigationFailures | 28 #define MAYBE_WebNavigationFailures DISABLED_WebNavigationFailures |
29 #define MAYBE_WebNavigationForwardBack DISABLED_WebNavigationForwardBack | 29 #define MAYBE_WebNavigationForwardBack DISABLED_WebNavigationForwardBack |
30 #define MAYBE_WebNavigationClientRedirect DISABLED_WebNavigationClientRedirect | 30 #define MAYBE_WebNavigationClientRedirect DISABLED_WebNavigationClientRedirect |
31 #define MAYBE_WebNavigationGetFrame DISABLED_WebNavigationGetFrame | 31 #define MAYBE_WebNavigationGetFrame DISABLED_WebNavigationGetFrame |
32 #define MAYBE_WebNavigationSimpleLoad DISABLED_WebNavigationSimpleLoad | 32 #define MAYBE_WebNavigationSimpleLoad DISABLED_WebNavigationSimpleLoad |
33 #define MAYBE_WebNavigationReferenceFragment \ | 33 #define MAYBE_WebNavigationReferenceFragment \ |
34 DISABLED_WebNavigationReferenceFragment | 34 DISABLED_WebNavigationReferenceFragment |
35 #define MAYBE_WebNavigationOpenTab DISABLED_WebNavigationOpenTab | 35 #define MAYBE_WebNavigationOpenTab DISABLED_WebNavigationOpenTab |
| 36 #define MAYBE_WebNavigationFilteredTest DISABLED_WebNavigationFilteredTest |
36 #else | 37 #else |
37 #define MAYBE_WebNavigationIFrame WebNavigationIFrame | 38 #define MAYBE_WebNavigationIFrame WebNavigationIFrame |
38 #define MAYBE_WebNavigationFailures WebNavigationFailures | 39 #define MAYBE_WebNavigationFailures WebNavigationFailures |
39 #define MAYBE_WebNavigationForwardBack WebNavigationForwardBack | 40 #define MAYBE_WebNavigationForwardBack WebNavigationForwardBack |
40 #define MAYBE_WebNavigationClientRedirect WebNavigationClientRedirect | 41 #define MAYBE_WebNavigationClientRedirect WebNavigationClientRedirect |
41 #define MAYBE_WebNavigationGetFrame WebNavigationGetFrame | 42 #define MAYBE_WebNavigationGetFrame WebNavigationGetFrame |
42 #define MAYBE_WebNavigationSimpleLoad WebNavigationSimpleLoad | 43 #define MAYBE_WebNavigationSimpleLoad WebNavigationSimpleLoad |
43 #define MAYBE_WebNavigationReferenceFragment WebNavigationReferenceFragment | 44 #define MAYBE_WebNavigationReferenceFragment WebNavigationReferenceFragment |
44 #define MAYBE_WebNavigationOpenTab WebNavigationOpenTab | 45 #define MAYBE_WebNavigationOpenTab WebNavigationOpenTab |
| 46 #define MAYBE_WebNavigationFilteredTest WebNavigationFilteredTest |
45 #endif | 47 #endif |
46 | 48 |
47 namespace extensions { | 49 namespace extensions { |
48 | 50 |
49 namespace { | 51 namespace { |
50 | 52 |
51 class TestRenderViewContextMenu : public RenderViewContextMenu { | 53 class TestRenderViewContextMenu : public RenderViewContextMenu { |
52 public: | 54 public: |
53 TestRenderViewContextMenu(WebContents* web_contents, | 55 TestRenderViewContextMenu(WebContents* web_contents, |
54 const content::ContextMenuParams& params) | 56 const content::ContextMenuParams& params) |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_WebNavigationFailures) { | 169 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_WebNavigationFailures) { |
168 FrameNavigationState::set_allow_extension_scheme(true); | 170 FrameNavigationState::set_allow_extension_scheme(true); |
169 | 171 |
170 CommandLine::ForCurrentProcess()->AppendSwitch( | 172 CommandLine::ForCurrentProcess()->AppendSwitch( |
171 switches::kAllowLegacyExtensionManifests); | 173 switches::kAllowLegacyExtensionManifests); |
172 | 174 |
173 ASSERT_TRUE( | 175 ASSERT_TRUE( |
174 RunExtensionSubtest("webnavigation", "test_failures.html")) << message_; | 176 RunExtensionSubtest("webnavigation", "test_failures.html")) << message_; |
175 } | 177 } |
176 | 178 |
| 179 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_WebNavigationFilteredTest) { |
| 180 FrameNavigationState::set_allow_extension_scheme(true); |
| 181 |
| 182 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 183 switches::kAllowLegacyExtensionManifests); |
| 184 |
| 185 ASSERT_TRUE( |
| 186 RunExtensionSubtest("webnavigation", "test_filtered.html")) << message_; |
| 187 } |
| 188 |
177 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WebNavigationUserAction) { | 189 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WebNavigationUserAction) { |
178 FrameNavigationState::set_allow_extension_scheme(true); | 190 FrameNavigationState::set_allow_extension_scheme(true); |
179 | 191 |
180 CommandLine::ForCurrentProcess()->AppendSwitch( | 192 CommandLine::ForCurrentProcess()->AppendSwitch( |
181 switches::kAllowLegacyExtensionManifests); | 193 switches::kAllowLegacyExtensionManifests); |
182 | 194 |
183 // Wait for the extension to set itself up and return control to us. | 195 // Wait for the extension to set itself up and return control to us. |
184 ASSERT_TRUE( | 196 ASSERT_TRUE( |
185 RunExtensionSubtest("webnavigation", "test_userAction.html")) << message_; | 197 RunExtensionSubtest("webnavigation", "test_userAction.html")) << message_; |
186 | 198 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 mouse_event.y = 7; | 327 mouse_event.y = 7; |
316 mouse_event.clickCount = 1; | 328 mouse_event.clickCount = 1; |
317 tab->GetRenderViewHost()->ForwardMouseEvent(mouse_event); | 329 tab->GetRenderViewHost()->ForwardMouseEvent(mouse_event); |
318 mouse_event.type = WebKit::WebInputEvent::MouseUp; | 330 mouse_event.type = WebKit::WebInputEvent::MouseUp; |
319 tab->GetRenderViewHost()->ForwardMouseEvent(mouse_event); | 331 tab->GetRenderViewHost()->ForwardMouseEvent(mouse_event); |
320 | 332 |
321 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 333 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
322 } | 334 } |
323 | 335 |
324 } // namespace extensions | 336 } // namespace extensions |
OLD | NEW |