Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(712)

Side by Side Diff: chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc

Issue 10514013: Filtered events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rename and move EventListenerMap's delegate Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 14 matching lines...) Expand all
25 // http://crbug.com/118478 25 // http://crbug.com/118478
26 #define MAYBE_WebNavigationIFrame DISABLED_WebNavigationIFrame 26 #define MAYBE_WebNavigationIFrame DISABLED_WebNavigationIFrame
27 #define MAYBE_WebNavigationFailures DISABLED_WebNavigationFailures 27 #define MAYBE_WebNavigationFailures DISABLED_WebNavigationFailures
28 #define MAYBE_WebNavigationForwardBack DISABLED_WebNavigationForwardBack 28 #define MAYBE_WebNavigationForwardBack DISABLED_WebNavigationForwardBack
29 #define MAYBE_WebNavigationClientRedirect DISABLED_WebNavigationClientRedirect 29 #define MAYBE_WebNavigationClientRedirect DISABLED_WebNavigationClientRedirect
30 #define MAYBE_WebNavigationGetFrame DISABLED_WebNavigationGetFrame 30 #define MAYBE_WebNavigationGetFrame DISABLED_WebNavigationGetFrame
31 #define MAYBE_WebNavigationSimpleLoad DISABLED_WebNavigationSimpleLoad 31 #define MAYBE_WebNavigationSimpleLoad DISABLED_WebNavigationSimpleLoad
32 #define MAYBE_WebNavigationReferenceFragment \ 32 #define MAYBE_WebNavigationReferenceFragment \
33 DISABLED_WebNavigationReferenceFragment 33 DISABLED_WebNavigationReferenceFragment
34 #define MAYBE_WebNavigationOpenTab DISABLED_WebNavigationOpenTab 34 #define MAYBE_WebNavigationOpenTab DISABLED_WebNavigationOpenTab
35 #define MAYBE_WebNavigationFilteredTest DISABLED_WebNavigationFilteredTest
35 #else 36 #else
36 #define MAYBE_WebNavigationIFrame WebNavigationIFrame 37 #define MAYBE_WebNavigationIFrame WebNavigationIFrame
37 #define MAYBE_WebNavigationFailures WebNavigationFailures 38 #define MAYBE_WebNavigationFailures WebNavigationFailures
38 #define MAYBE_WebNavigationForwardBack WebNavigationForwardBack 39 #define MAYBE_WebNavigationForwardBack WebNavigationForwardBack
39 #define MAYBE_WebNavigationClientRedirect WebNavigationClientRedirect 40 #define MAYBE_WebNavigationClientRedirect WebNavigationClientRedirect
40 #define MAYBE_WebNavigationGetFrame WebNavigationGetFrame 41 #define MAYBE_WebNavigationGetFrame WebNavigationGetFrame
41 #define MAYBE_WebNavigationSimpleLoad WebNavigationSimpleLoad 42 #define MAYBE_WebNavigationSimpleLoad WebNavigationSimpleLoad
42 #define MAYBE_WebNavigationReferenceFragment WebNavigationReferenceFragment 43 #define MAYBE_WebNavigationReferenceFragment WebNavigationReferenceFragment
43 #define MAYBE_WebNavigationOpenTab WebNavigationOpenTab 44 #define MAYBE_WebNavigationOpenTab WebNavigationOpenTab
45 #define MAYBE_WebNavigationFilteredTest WebNavigationFilteredTest
44 #endif 46 #endif
45 47
46 namespace extensions { 48 namespace extensions {
47 49
48 namespace { 50 namespace {
49 51
50 class TestRenderViewContextMenu : public RenderViewContextMenu { 52 class TestRenderViewContextMenu : public RenderViewContextMenu {
51 public: 53 public:
52 TestRenderViewContextMenu(WebContents* web_contents, 54 TestRenderViewContextMenu(WebContents* web_contents,
53 const content::ContextMenuParams& params) 55 const content::ContextMenuParams& params)
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_WebNavigationFailures) { 168 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_WebNavigationFailures) {
167 FrameNavigationState::set_allow_extension_scheme(true); 169 FrameNavigationState::set_allow_extension_scheme(true);
168 170
169 CommandLine::ForCurrentProcess()->AppendSwitch( 171 CommandLine::ForCurrentProcess()->AppendSwitch(
170 switches::kAllowLegacyExtensionManifests); 172 switches::kAllowLegacyExtensionManifests);
171 173
172 ASSERT_TRUE( 174 ASSERT_TRUE(
173 RunExtensionSubtest("webnavigation", "test_failures.html")) << message_; 175 RunExtensionSubtest("webnavigation", "test_failures.html")) << message_;
174 } 176 }
175 177
178 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_WebNavigationFilteredTest) {
179 FrameNavigationState::set_allow_extension_scheme(true);
180
181 CommandLine::ForCurrentProcess()->AppendSwitch(
182 switches::kAllowLegacyExtensionManifests);
183
184 ASSERT_TRUE(
185 RunExtensionSubtest("webnavigation", "test_filtered.html")) << message_;
186 }
187
176 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WebNavigationUserAction) { 188 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WebNavigationUserAction) {
177 FrameNavigationState::set_allow_extension_scheme(true); 189 FrameNavigationState::set_allow_extension_scheme(true);
178 190
179 CommandLine::ForCurrentProcess()->AppendSwitch( 191 CommandLine::ForCurrentProcess()->AppendSwitch(
180 switches::kAllowLegacyExtensionManifests); 192 switches::kAllowLegacyExtensionManifests);
181 193
182 // Wait for the extension to set itself up and return control to us. 194 // Wait for the extension to set itself up and return control to us.
183 ASSERT_TRUE( 195 ASSERT_TRUE(
184 RunExtensionSubtest("webnavigation", "test_userAction.html")) << message_; 196 RunExtensionSubtest("webnavigation", "test_userAction.html")) << message_;
185 197
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698