Bug 749872 - remove unused/not-run test_handlerApps.xhtml, r=mtigley

Differential Revision: https://phabricator.services.mozilla.com/D139706
This commit is contained in:
Gijs Kruitbosch 2022-02-25 22:18:19 +00:00
parent 384bfcf2b6
commit 63f7179055
4 changed files with 0 additions and 165 deletions

View File

@ -1,28 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Pseudo Web Handler App</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body onload="onLoad()">
Pseudo Web Handler App
<script class="testbody" type="text/javascript">
<![CDATA[
function onLoad() {
// if we have a window.opener, this must be the windowContext
// instance of this test. check that we got the URI right and clean up.
if (window.opener) {
window.opener.is(location.search,
"?uri=" + encodeURIComponent(window.opener.testURI),
"uri passed to web-handler app");
window.opener.SimpleTest.finish();
}
window.close();
}
]]>
</script>
</body>
</html>

View File

@ -1,118 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
// handlerApp.xhtml grabs this for verification purposes via window.opener
var testURI = "webcal://127.0.0.1/rheeeeet.html";
const Cc = SpecialPowers.Cc;
function test() {
// set up the web handler object
var webHandler = Cc[
"@mozilla.org/uriloader/web-handler-app;1"
].createInstance(SpecialPowers.Ci.nsIWebHandlerApp);
webHandler.name = "Test Web Handler App";
webHandler.uriTemplate =
"https://example.com/tests/uriloader/exthandler/tests/mochitest/" +
"handlerApp.xhtml?uri=%s";
// set up the uri to test with
/* eslint-disable mozilla/use-services */
var ioService = Cc["@mozilla.org/network/io-service;1"].getService(
SpecialPowers.Ci.nsIIOService
);
var uri = ioService.newURI(testURI);
// create a window, and launch the handler in it
var newWindow = window.open("", "handlerWindow", "height=300,width=300");
var windowContext = SpecialPowers.wrap(newWindow).docShell;
webHandler.launchWithURI(uri, windowContext);
// if we get this far without an exception, we've at least partly passed
// (remaining check in handlerApp.xhtml)
ok(true, "webHandler launchWithURI (existing window/tab) started");
// make the web browser launch in its own window/tab
webHandler.launchWithURI(uri);
// if we get this far without an exception, we've passed
ok(true, "webHandler launchWithURI (new window/tab) test started");
// set up the local handler object
var localHandler = Cc[
"@mozilla.org/uriloader/local-handler-app;1"
].createInstance(SpecialPowers.Ci.nsILocalHandlerApp);
localHandler.name = "Test Local Handler App";
// get a local app that we know will be there and do something sane
/* eslint-disable mozilla/use-services */
var osString = Cc["@mozilla.org/xre/app-info;1"].getService(
SpecialPowers.Ci.nsIXULRuntime
).OS;
var dirSvc = Cc["@mozilla.org/file/directory_service;1"].getService(
SpecialPowers.Ci.nsIDirectoryServiceProvider
);
if (osString == "WINNT") {
var windowsDir = dirSvc.getFile("WinD", {});
var exe = windowsDir.clone().QueryInterface(SpecialPowers.Ci.nsIFile);
exe.appendRelativePath("SYSTEM32\\HOSTNAME.EXE");
} else if (osString == "Darwin") {
var localAppsDir = dirSvc.getFile("LocApp", {});
exe = localAppsDir.clone();
exe.append("iCal.app"); // lingers after the tests finish, but this seems
// seems better than explicitly killing it, since
// developers who run the tests locally may well
// information in their running copy of iCal
if (navigator.userAgent.match(/ SeaMonkey\//)) {
// SeaMonkey tinderboxes don't like to have iCal lingering (and focused)
// on next test suite run(s).
todo(false, "On SeaMonkey, testing OS X as generic Unix. (Bug 749872)");
// assume a generic UNIX variant
exe = Cc["@mozilla.org/file/local;1"].createInstance(
SpecialPowers.Ci.nsIFile
);
exe.initWithPath("/bin/echo");
}
} else {
// assume a generic UNIX variant
exe = Cc["@mozilla.org/file/local;1"].createInstance(
SpecialPowers.Ci.nsIFile
);
exe.initWithPath("/bin/echo");
}
localHandler.executable = exe;
localHandler.launchWithURI(ioService.newURI(testURI));
// if we get this far without an exception, we've passed
ok(true, "localHandler launchWithURI test");
// if we ever decide that killing iCal is the right thing to do, change
// the if statement below from "NOTDarwin" to "Darwin"
if (osString == "NOTDarwin") {
var killall = Cc["@mozilla.org/file/local;1"].createInstance(
SpecialPowers.Ci.nsIFile
);
killall.initWithPath("/usr/bin/killall");
var process = Cc["@mozilla.org/process/util;1"].createInstance(
SpecialPowers.Ci.nsIProcess
);
process.init(killall);
var args = ["iCal"];
process.run(false, args, args.length);
}
SimpleTest.waitForExplicitFinish();
}
test();

View File

@ -1,11 +1,3 @@
[DEFAULT]
support-files =
handlerApp.xhtml
handlerApps.js
[test_handlerApps.xhtml]
skip-if = (toolkit == 'android' || os == 'mac') || e10s # OS X: bug 786938
scheme = https
[test_invalidCharFileExtension.xhtml]
skip-if = toolkit == 'android' && !is_fennec # Bug 1525959
support-files =

View File

@ -1,11 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test for Handler Apps </title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="handlerApps.js"/>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<p id="display"></p>
</body>
</html>