1
Index: firefox-trunk-19.0~a1~hg20121114r113129/toolkit/components/search/tests/xpcshell/head_search.js
2
===================================================================
3
--- firefox-trunk-19.0~a1~hg20121114r113129.orig/toolkit/components/search/tests/xpcshell/head_search.js 2012-11-14 00:37:53.000000000 +0000
4
+++ firefox-trunk-19.0~a1~hg20121114r113129/toolkit/components/search/tests/xpcshell/head_search.js 2012-11-14 14:08:13.854550000 +0000
6
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
7
/* vim:set ts=2 sw=2 sts=2 et: */
9
-Components.utils.import("resource://gre/modules/Services.jsm");
10
-Components.utils.import("resource://gre/modules/NetUtil.jsm");
11
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
12
+const Cu = Components.utils;
13
+const Ci = Components.interfaces;
14
+const Cr = Components.results;
16
+Cu.import("resource://gre/modules/Services.jsm");
17
+Cu.import("resource://gre/modules/NetUtil.jsm");
18
+Cu.import("resource://gre/modules/XPCOMUtils.jsm");
20
const XULAPPINFO_CONTRACTID = "@mozilla.org/xre/app-info;1";
21
const XULAPPINFO_CID = Components.ID("{c763b610-9d49-455a-bbd2-ede71682a1ac}");
23
invalidateCachesOnRestart: function invalidateCachesOnRestart() {},
25
QueryInterface: function QueryInterface(iid) {
26
- if (iid.equals(Components.interfaces.nsIXULAppInfo)
27
- || iid.equals(Components.interfaces.nsIXULRuntime)
28
- || iid.equals(Components.interfaces.nsISupports))
29
+ if (iid.equals(Ci.nsIXULAppInfo)
30
+ || iid.equals(Ci.nsIXULRuntime)
31
+ || iid.equals(Ci.nsISupports))
34
- throw Components.results.NS_ERROR_NO_INTERFACE;
35
+ throw Cr.NS_ERROR_NO_INTERFACE;
39
var XULAppInfoFactory = {
40
createInstance: function (outer, iid) {
42
- throw Components.results.NS_ERROR_NO_AGGREGATION;
43
+ throw Cr.NS_ERROR_NO_AGGREGATION;
44
return gXULAppInfo.QueryInterface(iid);
47
- var registrar = Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar);
48
+ var registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
49
registrar.registerFactory(XULAPPINFO_CID, "XULAppInfo",
50
XULAPPINFO_CONTRACTID, XULAppInfoFactory);
53
// Need to create and register a profile folder.
54
var gProfD = do_get_profile();
57
+ getFile: function() {
58
+ throw Cr.NS_ERROR_FAILURE;
61
+ getFiles: function(prop) {
62
+ if (prop == "XREExtDL") {
64
+ getNext: function() {
65
+ throw Cr.NS_ERROR_FAILURE;
67
+ hasMoreElements: function() {
70
+ QueryInterface: function(iid) {
71
+ if (iid.equals(Ci.nsISimpleEnumerator) ||
72
+ iid.equals(Ci.nsISupports)) {
75
+ throw Cr.NS_ERROR_NO_INTERFACE;
79
+ throw Cr.NS_ERROR_FAILURE;
82
+ QueryInterface: function(iid) {
83
+ if (iid.equals(Ci.nsIDirectoryServiceProvider2) ||
84
+ iid.equals(Ci.nsIDirectoryServiceProvider) ||
85
+ iid.equals(Ci.nsISupports)) {
88
+ throw Cr.NS_ERROR_NO_INTERFACE;
92
+Services.dirsvc.registerProvider(provider);
96
dump("search test: " + text + "\n");
100
function parseJsonFromStream(aInputStream) {
101
- const json = Cc["@mozilla.org/dom/json;1"].createInstance(Components.interfaces.nsIJSON);
102
+ const json = Cc["@mozilla.org/dom/json;1"].createInstance(Ci.nsIJSON);
103
const data = json.decodeFromStream(aInputStream, aInputStream.available());