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

Unified Diff: chrome/browser/extensions/api/web_request/web_request_apitest.cc

Issue 2238383003: webRequest: Also identify frames for non-RDH-initiated requests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix mek's nits Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/webrequest/framework.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/web_request/web_request_apitest.cc
diff --git a/chrome/browser/extensions/api/web_request/web_request_apitest.cc b/chrome/browser/extensions/api/web_request/web_request_apitest.cc
index 20053730ff73db1fed2290432dcaafa570234e33..3348933f49b49e19fd972e9187a23aff437b9bce 100644
--- a/chrome/browser/extensions/api/web_request/web_request_apitest.cc
+++ b/chrome/browser/extensions/api/web_request/web_request_apitest.cc
@@ -14,11 +14,13 @@
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/tab_helper.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_navigator_params.h"
#include "chrome/browser/ui/login/login_handler.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/extensions/extension_process_policy.h"
+#include "chrome/test/base/search_test_utils.h"
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/notification_service.h"
@@ -159,6 +161,20 @@ IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, WebRequestTypes) {
ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_types.html")) << message_;
}
+// Test that a request to an OpenSearch description document (OSDD) generates
+// an event with the expected details.
+IN_PROC_BROWSER_TEST_F(ExtensionWebRequestApiTest, WebRequestTestOSDD) {
+ // An OSDD request is only generated when a main frame at is loaded at /, so
+ // serve osdd/index.html from the root of the test server:
+ embedded_test_server()->ServeFilesFromDirectory(
+ test_data_dir_.AppendASCII("webrequest/osdd"));
+ ASSERT_TRUE(StartEmbeddedTestServer());
+
+ search_test_utils::WaitForTemplateURLServiceToLoad(
+ TemplateURLServiceFactory::GetForProfile(profile()));
+ ASSERT_TRUE(RunExtensionSubtest("webrequest", "test_osdd.html")) << message_;
+}
+
// Test that the webRequest events are dispatched with the expected details when
// a frame or tab is removed while a response is being received.
// Flaky: https://crbug.com/617865
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/webrequest/framework.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698