| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/macros.h" | 6 #include "base/macros.h" |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 ExtensionService* service = | 266 ExtensionService* service = |
| 267 ExtensionSystem::Get(browser()->profile())->extension_service(); | 267 ExtensionSystem::Get(browser()->profile())->extension_service(); |
| 268 const Extension* extension = | 268 const Extension* extension = |
| 269 service->GetExtensionById(last_loaded_extension_id(), false); | 269 service->GetExtensionById(last_loaded_extension_id(), false); |
| 270 GURL url = extension->GetResourceURL("newTab/a.html"); | 270 GURL url = extension->GetResourceURL("newTab/a.html"); |
| 271 | 271 |
| 272 ui_test_utils::NavigateToURL(browser(), url); | 272 ui_test_utils::NavigateToURL(browser(), url); |
| 273 | 273 |
| 274 // There's a link on a.html with target=_blank. Click on it to open it in a | 274 // There's a link on a.html with target=_blank. Click on it to open it in a |
| 275 // new tab. | 275 // new tab. |
| 276 blink::WebMouseEvent mouse_event; | 276 blink::WebMouseEvent mouse_event(blink::WebInputEvent::MouseDown, |
| 277 mouse_event.type = blink::WebInputEvent::MouseDown; | 277 blink::WebInputEvent::NoModifiers, |
| 278 blink::WebInputEvent::TimeStampForTesting); |
| 278 mouse_event.button = blink::WebMouseEvent::Button::Left; | 279 mouse_event.button = blink::WebMouseEvent::Button::Left; |
| 279 mouse_event.x = 7; | 280 mouse_event.x = 7; |
| 280 mouse_event.y = 7; | 281 mouse_event.y = 7; |
| 281 mouse_event.clickCount = 1; | 282 mouse_event.clickCount = 1; |
| 282 tab->GetRenderViewHost()->GetWidget()->ForwardMouseEvent(mouse_event); | 283 tab->GetRenderViewHost()->GetWidget()->ForwardMouseEvent(mouse_event); |
| 283 mouse_event.type = blink::WebInputEvent::MouseUp; | 284 mouse_event.setType(blink::WebInputEvent::MouseUp); |
| 284 tab->GetRenderViewHost()->GetWidget()->ForwardMouseEvent(mouse_event); | 285 tab->GetRenderViewHost()->GetWidget()->ForwardMouseEvent(mouse_event); |
| 285 | 286 |
| 286 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 287 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
| 287 } | 288 } |
| 288 | 289 |
| 289 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, WebRequestDeclarative1) { | 290 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, WebRequestDeclarative1) { |
| 290 ASSERT_TRUE(StartEmbeddedTestServer()); | 291 ASSERT_TRUE(StartEmbeddedTestServer()); |
| 291 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_declarative1.html")) | 292 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_declarative1.html")) |
| 292 << message_; | 293 << message_; |
| 293 } | 294 } |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 ASSERT_TRUE(granter); | 647 ASSERT_TRUE(granter); |
| 647 granter->RevokeForTesting(); | 648 granter->RevokeForTesting(); |
| 648 base::RunLoop().RunUntilIdle(); | 649 base::RunLoop().RunUntilIdle(); |
| 649 PerformXhrInFrame(main_frame, kHost, port, kXhrPath); | 650 PerformXhrInFrame(main_frame, kHost, port, kXhrPath); |
| 650 EXPECT_EQ(xhr_count, | 651 EXPECT_EQ(xhr_count, |
| 651 GetWebRequestCountFromBackgroundPage(extension, profile())); | 652 GetWebRequestCountFromBackgroundPage(extension, profile())); |
| 652 EXPECT_EQ(BLOCKED_ACTION_WEB_REQUEST, runner->GetBlockedActions(extension)); | 653 EXPECT_EQ(BLOCKED_ACTION_WEB_REQUEST, runner->GetBlockedActions(extension)); |
| 653 } | 654 } |
| 654 | 655 |
| 655 } // namespace extensions | 656 } // namespace extensions |
| OLD | NEW |