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

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

Issue 10052035: Implemented port filter for URLMatcher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comment Created 8 years, 8 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 | « chrome/common/extensions/docs/experimental.webRequest.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/webrequest/test_declarative.js
diff --git a/chrome/test/data/extensions/api_test/webrequest/test_declarative.js b/chrome/test/data/extensions/api_test/webrequest/test_declarative.js
index dfcd9e8b8a61f4357c9bb68792f5f4592292587d..07ea5c42f5e025b55e4fc7af96d356673e652059 100644
--- a/chrome/test/data/extensions/api_test/webrequest/test_declarative.js
+++ b/chrome/test/data/extensions/api_test/webrequest/test_declarative.js
@@ -7,6 +7,15 @@ var RequestMatcher = chrome.experimental.webRequest.RequestMatcher;
var CancelRequest = chrome.experimental.webRequest.CancelRequest;
var RedirectRequest = chrome.experimental.webRequest.RedirectRequest;
+function getURLHttpSimple() {
+ return getServerURL("files/extensions/api_test/webrequest/simpleLoad/a.html");
+}
+
+function getURLHttpComplex() {
+ return getServerURL(
+ "files/extensions/api_test/webrequest/complexLoad/a.html");
+}
+
runTests([
function testCancelRequest() {
ignoreUnexpected = true;
@@ -15,22 +24,22 @@ runTests([
{ label: "onErrorOccurred",
event: "onErrorOccurred",
details: {
- url: getURL("simpleLoad/a.html"),
+ url: getURLHttpSimple(),
fromCache: false,
error: "net::ERR_BLOCKED_BY_CLIENT"
}
},
],
[ ["onCompleted"] ]);
-
onRequest.addRules(
[ {'conditions': [
new RequestMatcher({'path_suffix': ".html",
'resourceType': ["main_frame"],
- 'schemes': ["chrome-extension"]})],
+ 'schemes': ["http"],
+ 'ports': [testServerPort, [1000, 2000]]})],
'actions': [new CancelRequest()]}
],
- function() {navigateAndWait(getURL("simpleLoad/a.html"));}
+ function() {navigateAndWait(getURLHttpSimple());}
);
},
@@ -42,15 +51,15 @@ runTests([
event: "onBeforeRequest",
details: {
type: "main_frame",
- url: getURL("complexLoad/a.html"),
- frameUrl: getURL("complexLoad/a.html")
+ url: getURLHttpComplex(),
+ frameUrl: getURLHttpComplex()
},
},
{ label: "onBeforeRedirect",
event: "onBeforeRedirect",
details: {
- url: getURL("complexLoad/a.html"),
- redirectUrl: getURL("simpleLoad/a.html"),
+ url: getURLHttpComplex(),
+ redirectUrl: getURLHttpSimple(),
statusLine: "",
statusCode: -1,
fromCache: false,
@@ -60,17 +69,18 @@ runTests([
event: "onBeforeRequest",
details: {
type: "main_frame",
- url: getURL("simpleLoad/a.html"),
- frameUrl: getURL("simpleLoad/a.html"),
+ url: getURLHttpSimple(),
+ frameUrl: getURLHttpSimple(),
},
},
{ label: "onCompleted",
event: "onCompleted",
details: {
- url: getURL("simpleLoad/a.html"),
+ ip: "127.0.0.1",
+ url: getURLHttpSimple(),
fromCache: false,
statusCode: 200,
- statusLine: "HTTP/1.1 200 OK",
+ statusLine: "HTTP/1.0 200 OK",
}
},
],
@@ -80,9 +90,9 @@ runTests([
onRequest.addRules(
[ {'conditions': [new RequestMatcher({'path_suffix': ".html"})],
'actions': [
- new RedirectRequest({'redirectUrl': getURL("simpleLoad/a.html")})]}
+ new RedirectRequest({'redirectUrl': getURLHttpSimple()})]}
],
- function() {navigateAndWait(getURL("complexLoad/a.html"));}
+ function() {navigateAndWait(getURLHttpComplex());}
);
},
]);
« no previous file with comments | « chrome/common/extensions/docs/experimental.webRequest.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698