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

Unified Diff: chrome/test/data/extensions/api_test/webrequest/framework.js

Issue 2449913002: Support WebSocket in WebRequest API. (Closed)
Patch Set: Remove FIXME because the test works. Add TODO for more tests. Created 4 years, 1 month 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
Index: chrome/test/data/extensions/api_test/webrequest/framework.js
diff --git a/chrome/test/data/extensions/api_test/webrequest/framework.js b/chrome/test/data/extensions/api_test/webrequest/framework.js
index 461ee561896b5e2b930c0f9bc90c3a00faea25f4..65fb8426adceaf3c519ccd7f2f1fa0bd9a289ace 100644
--- a/chrome/test/data/extensions/api_test/webrequest/framework.js
+++ b/chrome/test/data/extensions/api_test/webrequest/framework.js
@@ -11,6 +11,7 @@ var expectedEventOrder;
var tabId;
var tabIdMap;
var frameIdMap;
+var testWebSocketPort;
var testServerPort;
var testServer = "www.a.com";
var defaultScheme = "http";
@@ -45,6 +46,7 @@ function runTests(tests) {
chrome.tabs.onUpdated.removeListener(waitForAboutBlank);
chrome.test.getConfig(function(config) {
testServerPort = config.testServer.port;
+ testWebSocketPort = config.testWebSocketPort;
chrome.test.runTests(tests);
});
}
@@ -204,11 +206,15 @@ function isUnexpectedDetachedRequest(name, details) {
function captureEvent(name, details, callback) {
// Ignore system-level requests like safebrowsing updates and favicon fetches
// since they are unpredictable.
- if ((details.type == "other" && !details.url.includes('dont-ignore-me')) ||
+ // TODO(pkalinnikov): Remove the startsWith('ws') check once a new type gets
+ // intoduced for the WebSocket requests.
tyoshino (SeeGerritForStatus) 2016/12/06 08:05:06 introduced
pkalinnikov 2016/12/13 21:15:59 Done.
+ if ((details.type == "other" && !details.url.includes('dont-ignore-me') &&
+ !details.url.startsWith('ws')) ||
isUnexpectedDetachedRequest(name, details) ||
details.url.match(/\/favicon.ico$/) ||
- details.url.match(/https:\/\/dl.google.com/))
+ details.url.match(/https:\/\/dl.google.com/)) {
return;
+ }
// Pull the extra per-event options out of the expected data. These let
// us specify special return values per event.

Powered by Google App Engine
This is Rietveld 408576698