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

Side by Side Diff: chrome/browser/extensions/api/web_request/web_request_apitest.cc

Issue 10375021: Move Extension into extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Take 6 Created 8 years, 7 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
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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "chrome/browser/extensions/api/web_request/web_request_api.h" 6 #include "chrome/browser/extensions/api/web_request/web_request_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/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 // Wait for the extension to set itself up and return control to us. 98 // Wait for the extension to set itself up and return control to us.
99 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_newTab.html")) 99 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_newTab.html"))
100 << message_; 100 << message_;
101 101
102 WebContents* tab = browser()->GetSelectedWebContents(); 102 WebContents* tab = browser()->GetSelectedWebContents();
103 ui_test_utils::WaitForLoadStop(tab); 103 ui_test_utils::WaitForLoadStop(tab);
104 104
105 ResultCatcher catcher; 105 ResultCatcher catcher;
106 106
107 ExtensionService* service = browser()->profile()->GetExtensionService(); 107 ExtensionService* service = browser()->profile()->GetExtensionService();
108 const Extension* extension = 108 const extensions::Extension* extension =
109 service->GetExtensionById(last_loaded_extension_id_, false); 109 service->GetExtensionById(last_loaded_extension_id_, false);
110 GURL url = extension->GetResourceURL("newTab/a.html"); 110 GURL url = extension->GetResourceURL("newTab/a.html");
111 111
112 ui_test_utils::NavigateToURL(browser(), url); 112 ui_test_utils::NavigateToURL(browser(), url);
113 113
114 // There's a link on a.html with target=_blank. Click on it to open it in a 114 // There's a link on a.html with target=_blank. Click on it to open it in a
115 // new tab. 115 // new tab.
116 WebKit::WebMouseEvent mouse_event; 116 WebKit::WebMouseEvent mouse_event;
117 mouse_event.type = WebKit::WebInputEvent::MouseDown; 117 mouse_event.type = WebKit::WebInputEvent::MouseDown;
118 mouse_event.button = WebKit::WebMouseEvent::ButtonLeft; 118 mouse_event.button = WebKit::WebMouseEvent::ButtonLeft;
119 mouse_event.x = 7; 119 mouse_event.x = 7;
120 mouse_event.y = 7; 120 mouse_event.y = 7;
121 mouse_event.clickCount = 1; 121 mouse_event.clickCount = 1;
122 tab->GetRenderViewHost()->ForwardMouseEvent(mouse_event); 122 tab->GetRenderViewHost()->ForwardMouseEvent(mouse_event);
123 mouse_event.type = WebKit::WebInputEvent::MouseUp; 123 mouse_event.type = WebKit::WebInputEvent::MouseUp;
124 tab->GetRenderViewHost()->ForwardMouseEvent(mouse_event); 124 tab->GetRenderViewHost()->ForwardMouseEvent(mouse_event);
125 125
126 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); 126 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message();
127 } 127 }
128 128
129 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, WebRequestDeclarative) { 129 IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, WebRequestDeclarative) {
130 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_declarative.html")) << 130 ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_declarative.html")) <<
131 message_; 131 message_;
132 } 132 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/web_request/web_request_api.cc ('k') | chrome/browser/extensions/app_background_page_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698