mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 772272 - Remove do_load_httpd_js from xpcshell tests, Misc Folders, r=ted
Content, DOM, Image, JS, RDF, and URILoader folders
This commit is contained in:
parent
d35354cd9e
commit
9aedb93f44
@ -2,7 +2,7 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
do_load_httpd_js();
|
||||
Components.utils.import("resource://testing-common/httpd.js");
|
||||
|
||||
var server = null;
|
||||
|
||||
@ -36,7 +36,7 @@ function headerCheckHandler(metadata, response) {
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
var server = new nsHttpServer();
|
||||
var server = new HttpServer();
|
||||
server.registerPathHandler(redirectPath, redirectHandler);
|
||||
server.registerPathHandler(headerCheckPath, headerCheckHandler);
|
||||
server.start(SERVER_PORT);
|
||||
|
@ -1,5 +1,11 @@
|
||||
Components.utils.import('resource://gre/modules/CSPUtils.jsm');
|
||||
do_load_httpd_js();
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
const Cr = Components.results;
|
||||
|
||||
Cu.import('resource://gre/modules/CSPUtils.jsm');
|
||||
Cu.import("resource://testing-common/httpd.js");
|
||||
|
||||
var httpserv = null;
|
||||
|
||||
@ -16,9 +22,9 @@ var TESTS = [];
|
||||
|
||||
// helper to make URIs
|
||||
function mkuri(foo) {
|
||||
return Components.classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService)
|
||||
.newURI(foo, null, null);
|
||||
return Cc["@mozilla.org/network/io-service;1"]
|
||||
.getService(Ci.nsIIOService)
|
||||
.newURI(foo, null, null);
|
||||
}
|
||||
|
||||
// helper to use .equals on stuff
|
||||
@ -87,7 +93,7 @@ listener.prototype = {
|
||||
};
|
||||
|
||||
function run_test() {
|
||||
httpserv = new nsHttpServer();
|
||||
httpserv = new HttpServer();
|
||||
httpserv.registerPathHandler("/document", csp_doc_response);
|
||||
httpserv.registerPathHandler("/policy", csp_policy_response);
|
||||
httpserv.start(POLICY_PORT);
|
||||
|
@ -2,11 +2,16 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
Components.utils.import('resource://gre/modules/CSPUtils.jsm');
|
||||
Components.utils.import('resource://gre/modules/NetUtil.jsm');
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
const Cr = Components.results;
|
||||
|
||||
Cu.import('resource://gre/modules/CSPUtils.jsm');
|
||||
Cu.import('resource://gre/modules/NetUtil.jsm');
|
||||
|
||||
// load the HTTP server
|
||||
do_load_httpd_js();
|
||||
Cu.import("resource://testing-common/httpd.js");
|
||||
|
||||
const REPORT_SERVER_PORT = 9000;
|
||||
const REPORT_SERVER_URI = "http://localhost";
|
||||
@ -87,7 +92,7 @@ function run_test() {
|
||||
":" + REPORT_SERVER_PORT +
|
||||
"/foo/self");
|
||||
|
||||
httpServer = new nsHttpServer();
|
||||
httpServer = new HttpServer();
|
||||
httpServer.start(REPORT_SERVER_PORT);
|
||||
|
||||
// test that inline script violations cause a report.
|
||||
|
@ -2,14 +2,19 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
const Cr = Components.results;
|
||||
|
||||
//load('CSPUtils.jsm');
|
||||
Components.utils.import('resource://gre/modules/CSPUtils.jsm');
|
||||
Components.utils.import('resource://gre/modules/NetUtil.jsm');
|
||||
Cu.import('resource://gre/modules/CSPUtils.jsm');
|
||||
Cu.import('resource://gre/modules/NetUtil.jsm');
|
||||
|
||||
// load the HTTP server
|
||||
do_load_httpd_js();
|
||||
Cu.import("resource://testing-common/httpd.js");
|
||||
|
||||
var httpServer = new nsHttpServer();
|
||||
var httpServer = new HttpServer();
|
||||
|
||||
const POLICY_FROM_URI = "allow 'self'; img-src *";
|
||||
const POLICY_PORT = 9000;
|
||||
@ -18,8 +23,8 @@ const POLICY_URI_RELATIVE = "/policy";
|
||||
|
||||
//converts string to nsIURI
|
||||
function URI(uriString) {
|
||||
var ioService = Components.classes["@mozilla.org/network/io-service;1"]
|
||||
.getService(Components.interfaces.nsIIOService);
|
||||
var ioService = Cc["@mozilla.org/network/io-service;1"]
|
||||
.getService(Ci.nsIIOService);
|
||||
return ioService.newURI(uriString, null, null);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,9 @@
|
||||
do_load_httpd_js();
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
const Cr = Components.results;
|
||||
|
||||
Cu.import("resource://testing-common/httpd.js");
|
||||
|
||||
var httpserver = null;
|
||||
var geolocation = null;
|
||||
@ -11,14 +16,14 @@ function terminate(succ) {
|
||||
}
|
||||
|
||||
function successCallback(pos){ terminate(true); }
|
||||
function errorCallback(pos) { terminate(false); }
|
||||
function errorCallback(pos) { terminate(false); }
|
||||
|
||||
var observer = {
|
||||
QueryInterface: function(iid) {
|
||||
if (iid.equals(Components.interfaces.nsISupports) ||
|
||||
iid.equals(Components.interfaces.nsIObserver))
|
||||
return this;
|
||||
throw Components.results.NS_ERROR_NO_INTERFACE;
|
||||
if (iid.equals(Ci.nsISupports) ||
|
||||
iid.equals(Ci.nsIObserver))
|
||||
return this;
|
||||
throw Cr.NS_ERROR_NO_INTERFACE;
|
||||
},
|
||||
|
||||
observe: function(subject, topic, data) {
|
||||
@ -62,17 +67,17 @@ function run_test()
|
||||
{
|
||||
// only kill this test when shutdown is called on the provider.
|
||||
do_test_pending();
|
||||
|
||||
httpserver = new nsHttpServer();
|
||||
|
||||
httpserver = new HttpServer();
|
||||
httpserver.registerPathHandler("/geo", geoHandler);
|
||||
httpserver.start(4444);
|
||||
|
||||
|
||||
var prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
|
||||
prefs.setCharPref("geo.wifi.uri", "http://localhost:4444/geo");
|
||||
|
||||
var obs = Cc["@mozilla.org/observer-service;1"].getService();
|
||||
obs = obs.QueryInterface(Ci.nsIObserverService);
|
||||
obs.addObserver(observer, "geolocation-device-events", false);
|
||||
obs.addObserver(observer, "geolocation-device-events", false);
|
||||
|
||||
geolocation = Cc["@mozilla.org/geolocation;1"].getService(Ci.nsIDOMGeoGeolocation);
|
||||
watchID = geolocation.watchPosition(successCallback, errorCallback);
|
||||
|
@ -6,9 +6,14 @@
|
||||
* var uri.
|
||||
*/
|
||||
|
||||
do_load_httpd_js();
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
const Cr = Components.results;
|
||||
|
||||
var server = new nsHttpServer();
|
||||
Cu.import("resource://testing-common/httpd.js");
|
||||
|
||||
var server = new HttpServer();
|
||||
server.registerDirectory("/", do_get_file(''));
|
||||
server.registerContentType("sjs", "sjs");
|
||||
server.start(8088);
|
||||
|
@ -1,14 +1,14 @@
|
||||
|
||||
do_load_httpd_js();
|
||||
var cu = Components.utils;
|
||||
cu.import("resource://testing-common/httpd.js");
|
||||
|
||||
var httpserver = new nsHttpServer();
|
||||
var httpserver = new HttpServer();
|
||||
var testpath = "/simple";
|
||||
var httpbody = "<?xml version='1.0' ?><root>0123456789</root>";
|
||||
|
||||
var cu = Components.utils;
|
||||
var sb = cu.Sandbox(["http://www.example.com",
|
||||
"http://localhost:4444/simple"],
|
||||
{wantXHRConstructor: true});
|
||||
var sb = cu.Sandbox(["http://www.example.com",
|
||||
"http://localhost:4444/simple"],
|
||||
{wantXHRConstructor: true});
|
||||
|
||||
function createXHR(async)
|
||||
{
|
||||
@ -16,7 +16,7 @@ function createXHR(async)
|
||||
xhr.open("GET", "http://localhost:4444/simple", async);
|
||||
return xhr;
|
||||
}
|
||||
|
||||
|
||||
function checkResults(xhr)
|
||||
{
|
||||
if (xhr.readyState != 4)
|
||||
|
@ -1,9 +1,14 @@
|
||||
do_load_httpd_js();
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
const Cr = Components.results;
|
||||
|
||||
Cu.import("resource://testing-common/httpd.js");
|
||||
|
||||
function getRDFService()
|
||||
{
|
||||
return Components.classes["@mozilla.org/rdf/rdf-service;1"].
|
||||
getService(Components.interfaces.nsIRDFService);
|
||||
return Cc["@mozilla.org/rdf/rdf-service;1"].
|
||||
getService(Ci.nsIRDFService);
|
||||
}
|
||||
|
||||
var server1, server2;
|
||||
@ -11,14 +16,14 @@ var server1, server2;
|
||||
function run_test()
|
||||
{
|
||||
var samplefile = do_get_file('sample.rdf');
|
||||
|
||||
server1 = new nsHttpServer();
|
||||
|
||||
server1 = new HttpServer();
|
||||
server1.registerPathHandler("/sample-xs.rdf", xsRedirect);
|
||||
server1.registerPathHandler("/sample-local.rdf", localRedirect);
|
||||
server1.registerFile('/sample.rdf', samplefile);
|
||||
server1.start(4444);
|
||||
|
||||
server2 = new nsHttpServer();
|
||||
server2 = new HttpServer();
|
||||
server2.registerFile('/sample.rdf', samplefile);
|
||||
server2.start(4445);
|
||||
|
||||
@ -36,12 +41,12 @@ function rdfLoadObserver(uri, shouldPass)
|
||||
{
|
||||
this.shouldPass = shouldPass;
|
||||
this.uri = uri;
|
||||
|
||||
|
||||
++gPending;
|
||||
|
||||
|
||||
var rdfService = getRDFService();
|
||||
this.ds = rdfService.GetDataSource(uri).
|
||||
QueryInterface(Components.interfaces.nsIRDFXMLSink);
|
||||
QueryInterface(Ci.nsIRDFXMLSink);
|
||||
this.ds.addXMLSinkObserver(this);
|
||||
}
|
||||
|
||||
@ -52,22 +57,22 @@ rdfLoadObserver.prototype =
|
||||
onResume : function() { },
|
||||
onEndLoad : function() {
|
||||
print("Testing results of loading " + this.uri);
|
||||
|
||||
|
||||
var rdfs = getRDFService();
|
||||
var res = rdfs.GetResource("urn:mozilla:sample-data");
|
||||
var arc = rdfs.GetResource("http://purl.org/dc/elements/1.1/title");
|
||||
var answer = this.ds.GetTarget(res, arc, true);
|
||||
if (answer !== null) {
|
||||
do_check_true(this.shouldPass);
|
||||
do_check_true(answer instanceof Components.interfaces.nsIRDFLiteral);
|
||||
do_check_true(answer instanceof Ci.nsIRDFLiteral);
|
||||
do_check_eq(answer.Value, "Sample");
|
||||
}
|
||||
else {
|
||||
do_check_false(this.shouldPass);
|
||||
}
|
||||
|
||||
|
||||
gPending -= 1;
|
||||
|
||||
|
||||
this.ds.removeXMLSinkObserver(this);
|
||||
|
||||
if (gPending == 0) {
|
||||
|
@ -1,10 +1,15 @@
|
||||
|
||||
do_get_profile();
|
||||
do_load_httpd_js();
|
||||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
const Cu = Components.utils;
|
||||
const Cr = Components.results;
|
||||
|
||||
Cu.import("resource://testing-common/httpd.js");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
do_get_profile();
|
||||
|
||||
// Dynamically generates a classID for our component, registers it to mask
|
||||
// the existing component, and stored the masked components classID to be
|
||||
// restored later, when we unregister.
|
||||
@ -268,7 +273,7 @@ let tests = [
|
||||
|
||||
function run_test() {
|
||||
// do_load_child_test_harness();
|
||||
httpserver = new nsHttpServer();
|
||||
httpserver = new HttpServer();
|
||||
httpserver.start(4444);
|
||||
do_test_pending();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user