From 1059664ff4a3c92b2c6a4720f695e158aed215e4 Mon Sep 17 00:00:00 2001 From: Einar Egilsson Date: Tue, 20 Oct 2009 13:04:15 +0000 Subject: Changed to use actual interfaces! Seems to work, tiny bug left in unit tests. git-svn-id: http://einaregilsson.googlecode.com/svn/mozilla/redirector/trunk@285 119bf307-c92d-0410-89bd-8f53e6181181 --- chrome/content/unittest/testcases.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'chrome/content/unittest/testcases.js') diff --git a/chrome/content/unittest/testcases.js b/chrome/content/unittest/testcases.js index 0ce071e..afefff7 100644 --- a/chrome/content/unittest/testcases.js +++ b/chrome/content/unittest/testcases.js @@ -95,7 +95,8 @@ var tests = { var ioService = Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService); args.contentLocation = ioService.newURI(args.contentLocation, null, null); - var result = redirector.shouldLoad(args.contentType, args.contentLocation, args.requestOrigin, args.aContext, args.mimeTypeGuess, args.extra); + var contentPolicy = redirector.QueryInterface(nsIContentPolicy); + var result = contentPolicy.shouldLoad(args.contentType, args.contentLocation, args.requestOrigin, args.aContext, args.mimeTypeGuess, args.extra); return { passed: result == nsIContentPolicy.ACCEPT, message : "Expected nsIContentPolicy.ACCEPT, actual was " + result }; } @@ -116,6 +117,8 @@ var tests = { try { redirector.enabled = false; return doFunc(); + redirector.enabled = true; + } catch(e) { redirector.enabled = true; throw e; -- cgit v1.2.3-70-g09d2