Mercurial > hg > config
annotate components/tp-cmdline.js @ 201:bffb8b1b0948
bug 651659 (pageloader no longer creating browser windows with chrome) one small change and chrome returns! (take 1) p=anodelman r=jmaher
author | Alice Nodelman <alice@mozilla.com> |
---|---|
date | Thu, 28 Apr 2011 10:32:20 -0700 |
parents | 31249cbe4f19 |
children | 0b38ce037298 |
rev | line source |
---|---|
196
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
1 /* ***** BEGIN LICENSE BLOCK ***** |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
3 * |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
4 * The contents of this file are subject to the Mozilla Public License Version |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
5 * 1.1 (the "License"); you may not use this file except in compliance with |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
6 * the License. You may obtain a copy of the License at |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
7 * http://www.mozilla.org/MPL/ |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
8 * |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
9 * Software distributed under the License is distributed on an "AS IS" basis, |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
11 * for the specific language governing rights and limitations under the |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
12 * License. |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
13 * |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
14 * The Original Code is DOM Inspector. |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
15 * |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
16 * The Initial Developer of the Original Code is |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
17 * Christopher A. Aillon <christopher@aillon.com>. |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
18 * Portions created by the Initial Developer are Copyright (C) 2003 |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
19 * the Initial Developer. All Rights Reserved. |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
20 * |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
21 * Contributor(s): |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
22 * Christopher A. Aillon <christopher@aillon.com> |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
23 * L. David Baron, Mozilla Corporation <dbaron@dbaron.org> (modified for reftest) |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
24 * Vladimir Vukicevic, Mozilla Corporation <dbaron@dbaron.org> (modified for tp) |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
25 * |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
26 * Alternatively, the contents of this file may be used under the terms of |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
27 * either the GNU General Public License Version 2 or later (the "GPL"), or |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
28 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
29 * in which case the provisions of the GPL or the LGPL are applicable instead |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
30 * of those above. If you wish to allow use of your version of this file only |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
31 * under the terms of either the GPL or the LGPL, and not to allow others to |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
32 * use your version of this file under the terms of the MPL, indicate your |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
33 * decision by deleting the provisions above and replace them with the notice |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
34 * and other provisions required by the GPL or the LGPL. If you do not delete |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
35 * the provisions above, a recipient may use your version of this file under |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
36 * the terms of any one of the MPL, the GPL or the LGPL. |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
37 * |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
38 * ***** END LICENSE BLOCK ***** */ |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
39 |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
40 // This only implements nsICommandLineHandler, since it needs |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
41 // to handle multiple arguments. |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
42 |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
43 const TP_CMDLINE_CONTRACTID = "@mozilla.org/commandlinehandler/general-startup;1?type=tp"; |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
44 const TP_CMDLINE_CLSID = Components.ID('{8AF052F5-8EFE-4359-8266-E16498A82E8B}'); |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
45 const CATMAN_CONTRACTID = "@mozilla.org/categorymanager;1"; |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
46 const nsISupports = Components.interfaces.nsISupports; |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
47 |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
48 const nsICategoryManager = Components.interfaces.nsICategoryManager; |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
49 const nsICommandLine = Components.interfaces.nsICommandLine; |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
50 const nsICommandLineHandler = Components.interfaces.nsICommandLineHandler; |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
51 const nsIComponentRegistrar = Components.interfaces.nsIComponentRegistrar; |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
52 const nsISupportsString = Components.interfaces.nsISupportsString; |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
53 const nsIWindowWatcher = Components.interfaces.nsIWindowWatcher; |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
54 |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
55 function PageLoaderCmdLineHandler() {} |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
56 PageLoaderCmdLineHandler.prototype = |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
57 { |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
58 /* nsISupports */ |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
59 QueryInterface : function handler_QI(iid) { |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
60 if (iid.equals(nsISupports)) |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
61 return this; |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
62 |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
63 if (nsICommandLineHandler && iid.equals(nsICommandLineHandler)) |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
64 return this; |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
65 |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
66 throw Components.results.NS_ERROR_NO_INTERFACE; |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
67 }, |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
68 |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
69 /* nsICommandLineHandler */ |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
70 handle : function handler_handle(cmdLine) { |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
71 var args = {}; |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
72 try { |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
73 var uristr = cmdLine.handleFlagWithParam("tp", false); |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
74 if (uristr == null) |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
75 return; |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
76 try { |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
77 args.manifest = cmdLine.resolveURI(uristr).spec; |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
78 } catch (e) { |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
79 return; |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
80 } |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
81 |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
82 args.numCycles = cmdLine.handleFlagWithParam("tpcycles", false); |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
83 args.startIndex = cmdLine.handleFlagWithParam("tpstart", false); |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
84 args.endIndex = cmdLine.handleFlagWithParam("tpend", false); |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
85 args.filter = cmdLine.handleFlagWithParam("tpfilter", false); |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
86 args.format = cmdLine.handleFlagWithParam("tpformat", false); |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
87 args.useBrowserChrome = cmdLine.handleFlag("tpchrome", false); |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
88 args.doRender = cmdLine.handleFlag("tprender", false); |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
89 args.width = cmdLine.handleFlagWithParam("tpwidth", false); |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
90 args.height = cmdLine.handleFlagWithParam("tpheight", false); |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
91 args.offline = cmdLine.handleFlag("tpoffline", false); |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
92 args.noisy = cmdLine.handleFlag("tpnoisy", false); |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
93 args.timeout = cmdLine.handleFlagWithParam("tptimeout", false); |
200
31249cbe4f19
Bug 629691 - pageloader.xpi does not support e10s for Tp chrome testing. r=jmaher
Joel Maher <jmaher@mozilla.com>
parents:
196
diff
changeset
|
94 args.delay = cmdLine.handleFlagWithParam("tpdelay", false); |
196
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
95 args.noForceCC = cmdLine.handleFlag("tpnoforcecc", false); |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
96 } |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
97 catch (e) { |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
98 return; |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
99 } |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
100 |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
101 // get our data through xpconnect |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
102 args.wrappedJSObject = args; |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
103 |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
104 var wwatch = Components.classes["@mozilla.org/embedcomp/window-watcher;1"] |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
105 .getService(nsIWindowWatcher); |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
106 wwatch.openWindow(null, "chrome://pageloader/content/pageloader.xul", "_blank", |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
107 "chrome,dialog=no,all", args); |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
108 cmdLine.preventDefault = true; |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
109 }, |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
110 |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
111 helpInfo : |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
112 " -tp <file> Run pageload perf tests on given manifest\n" + |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
113 " -tpfilter str Only include pages from manifest that contain str (regexp)\n" + |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
114 " -tpcycles n Loop through pages n times\n" + |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
115 " -tpstart n Start at index n in the manifest\n" + |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
116 " -tpend n End with index n in the manifest\n" + |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
117 " -tpformat f1,f2,.. Report format(s) to use\n" + |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
118 " -tpchrome Test with normal browser chrome\n" + |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
119 " -tprender Run render-only benchmark for each page\n" + |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
120 " -tpwidth width Width of window\n" + |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
121 " -tpheight height Height of window\n" + |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
122 " -tpoffline Force offline mode\n" + |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
123 " -tpnoisy Dump the name of the last loaded page to console\n" + |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
124 " -tptimeout Max amount of time given for a page to load, quit if exceeded\n" + |
200
31249cbe4f19
Bug 629691 - pageloader.xpi does not support e10s for Tp chrome testing. r=jmaher
Joel Maher <jmaher@mozilla.com>
parents:
196
diff
changeset
|
125 " -tpdelay Amount of time to wait between each pageload\n" + |
196
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
126 " -tpnoforcecc Don't force cycle collection between each pageload\n" |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
127 |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
128 }; |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
129 |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
130 |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
131 var PageLoaderCmdLineFactory = |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
132 { |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
133 createInstance : function(outer, iid) |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
134 { |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
135 if (outer != null) { |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
136 throw Components.results.NS_ERROR_NO_AGGREGATION; |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
137 } |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
138 |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
139 return new PageLoaderCmdLineHandler().QueryInterface(iid); |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
140 } |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
141 }; |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
142 |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
143 function NSGetFactory(cid) { |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
144 if (!cid.equals(TP_CMDLINE_CLSID)) |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
145 throw Components.results.NS_ERROR_NOT_IMPLEMENTED; |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
146 |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
147 return PageLoaderCmdLineFactory; |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
148 } |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
149 |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
150 var PageLoaderCmdLineModule = |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
151 { |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
152 registerSelf : function(compMgr, fileSpec, location, type) |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
153 { |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
154 compMgr = compMgr.QueryInterface(nsIComponentRegistrar); |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
155 |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
156 compMgr.registerFactoryLocation(TP_CMDLINE_CLSID, |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
157 "PageLoader CommandLine Service", |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
158 TP_CMDLINE_CONTRACTID, |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
159 fileSpec, |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
160 location, |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
161 type); |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
162 |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
163 var catman = Components.classes[CATMAN_CONTRACTID].getService(nsICategoryManager); |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
164 catman.addCategoryEntry("command-line-handler", |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
165 "m-tp", |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
166 TP_CMDLINE_CONTRACTID, true, true); |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
167 }, |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
168 |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
169 unregisterSelf : function(compMgr, fileSpec, location) |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
170 { |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
171 compMgr = compMgr.QueryInterface(nsIComponentRegistrar); |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
172 |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
173 compMgr.unregisterFactoryLocation(TP_CMDLINE_CLSID, fileSpec); |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
174 catman = Components.classes[CATMAN_CONTRACTID].getService(nsICategoryManager); |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
175 catman.deleteCategoryEntry("command-line-handler", |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
176 "m-tp", true); |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
177 }, |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
178 |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
179 getClassObject : function(compMgr, cid, iid) |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
180 { |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
181 return NSGetFactory(cid); |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
182 }, |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
183 |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
184 canUnload : function(compMgr) |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
185 { |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
186 return true; |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
187 } |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
188 }; |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
189 |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
190 |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
191 function NSGetModule(compMgr, fileSpec) { |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
192 return PageLoaderCmdLineModule; |
dd0018bc27de
Copy the pageloader from CVS and into a bundle format (single chrome.manifest).
Benjamin Smedberg <benjamin@smedbergs.us>
parents:
diff
changeset
|
193 } |