Closed
Bug 545266
Opened 15 years ago
Closed 15 years ago
Setup toolkit component scaffolding and xpcshell test harness
Categories
(DevTools :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: ddahl, Assigned: ddahl)
References
Details
Attachments
(1 file, 14 obsolete files)
37.12 KB,
patch
|
Details | Diff | Splinter Review |
Testing should be the first priority when constructing a tool for developers to use.
I would like to work on this code in a TDD fashion.
![]() |
Assignee | |
Comment 1•15 years ago
|
||
Trying to set this toolkit stuff up like other toolkit/mozapps components, getting a build error around the idl file:
nsIHUDService.idl
usage: /home/ddahl/code/moz/mozilla-central/obj-i686-pc-linux-gnu-debug/config/nsinstall [-C cwd] [-L linkprefix] [-m mode] [-o owner] [-g group]
[-DdltR] file [file ...] directory
make[6]: *** [libs] Error 2
make[5]: *** [libs] Error 2
make[4]: *** [hudservice_libs] Error 2
make[3]: *** [libs_tier_toolkit] Error 2
make[2]: *** [tier_toolkit] Error 2
make[1]: *** [default] Error 2
make: *** [build] Error 2
![]() |
Assignee | |
Comment 2•15 years ago
|
||
Patch with build errors
![]() |
Assignee | |
Updated•15 years ago
|
Summary: Setup xpcshell test harness for console work → Setup toolkit component scaffolding and xpcshell test harness
Comment 3•15 years ago
|
||
I think the error is from the empty DIRS definition in toolkit/components/hudservice/tests/Makefile.in. Just remove the DIRS definition until you need to add anything.
Also, HUD service? Really?
![]() |
Assignee | |
Comment 4•15 years ago
|
||
Ok, it builds now, but the idl must not be registered correctly:
js> Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyServiceGetter(this, "hud",
"@mozilla.org/hud-service;1",
"nsIHUDService");
[object BackstagePass @ 0x8b7e240 (native @ 0x8b52a7c)]
js>
js> hud
file:///home/ddahl/code/moz/mozilla-central/obj-i686-pc-linux-gnu-debug/dist/bin/modules/XPCOMUtils.jsm:272: TypeError: Cc[aContract] is undefined
Attachment #426786 -
Attachment is obsolete: true
Comment 5•15 years ago
|
||
Your problem is that the component itself isn't getting built, in the makefile you need:
EXTRA_PP_COMPONENTS = hudservice.js
![]() |
Assignee | |
Comment 6•15 years ago
|
||
Ok, so no wit is being built, but is null. I looked up the exception being thrown:
js> Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyServiceGetter(this, "hud",
"@mozilla.org/hud-service;1",
"nsIHUDService");
[object BackstagePass @ 0x8344308 (native @ 0x84262dc)]
js> js> js> hud
uncaught exception: [Exception... "Component returned failure code: 0x80570016 (NS_ERROR_XPC_GS_RETURNED_FAILURE) [nsIJSCID.getService]" nsresult: "0x80570016 (NS_ERROR_XPC_GS_RETURNED_FAILURE)" location: "JS frame :: file:///home/ddahl/code/moz/mozilla-central/obj-i686-pc-linux-gnu-debug/dist/bin/modules/XPCOMUtils.jsm :: XPCU_serviceLambda :: line 272" data: no]
js>
This appears to be the real error message:
"service manager returned success, but service is null!"
from: http://mxr.mozilla.org/mozilla-central/source/js/src/xpconnect/src/xpcjsid.cpp#897
![]() |
Assignee | |
Comment 7•15 years ago
|
||
Attachment #426835 -
Attachment is obsolete: true
Comment 8•15 years ago
|
||
Your generateQI doesn't include any interfaces, you need to include at least
nsIHUDService or you won't be able to QI to that.
![]() |
Assignee | |
Comment 9•15 years ago
|
||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIHUDService]),
getInterfaces: function(countRef) {
var interfaces = [Ci.nsIHUDService];
countRef.value = interfaces.length;
return interfaces;
},
not like this, i assume?? ^^
since that throws the same error
Comment 10•15 years ago
|
||
Just like that but you haven't declared Cc and Ci at the top of your js file.
![]() |
Assignee | |
Comment 11•15 years ago
|
||
Actually I added the Cc, Ci, Cu constants. weird.
![]() |
Assignee | |
Comment 12•15 years ago
|
||
ah ok, when building I get failure:
this madness started up above make[10000]:
make[12]: *** [export] Error 2
make[11]: *** [export] Error 2
make[10]: *** [export] Error 2
make[9]: *** [export] Error 2
make[8]: *** [export] Error 2
make[7]: *** [export] Error 2
make[6]: *** [export] Error 2
make[5]: *** [export] Error 2
make[4]: *** [hudservice_export] Error 2
make[3]: *** [export_tier_toolkit] Error 2
make[2]: *** [tier_toolkit] Error 2
make[1]: *** [default] Error 2
make: *** [build] Error 2
![]() |
Assignee | |
Comment 13•15 years ago
|
||
whatever I am doing is spawning hundreds of make processes like this:
2370 pts/2 S+ 0:00 make -C ../hudservice export
2373 pts/2 S+ 0:00 make -C ../hudservice export
2376 pts/2 S+ 0:00 make -C ../hudservice export
its doing this about 20,000 times:
make: Entering directory `/home/ddahl/code/moz/mozilla-central/obj-i686-pc-linux-gnu-debug/toolkit/components/hudservice'
make export
make[1]: Entering directory `/home/ddahl/code/moz/mozilla-central/obj-i686-pc-linux-gnu-debug/toolkit/components/hudservice'
/home/ddahl/code/moz/mozilla-central/obj-i686-pc-linux-gnu-debug/config/nsinstall -D ../../../dist/idl
/home/ddahl/code/moz/mozilla-central/obj-i686-pc-linux-gnu-debug/config/nsinstall -D ../../../dist/idl
![]() |
Assignee | |
Comment 14•15 years ago
|
||
ok, figureed it out. I had a DIRS declaration in the makefile that was errant:
DIRS = ../hudservice \
$(NULL)
i removed it. now I have a real service running. on to some tests.
![]() |
Assignee | |
Comment 15•15 years ago
|
||
just saving it in a working state before I move it up into toolkit/console as per mossop's advice.
Attachment #427170 -
Attachment is obsolete: true
![]() |
Assignee | |
Comment 16•15 years ago
|
||
Moved into toolkit/console, builds, tests run.
Attachment #427228 -
Attachment is obsolete: true
![]() |
Assignee | |
Updated•15 years ago
|
Summary: Setup toolkit component scaffolding and xpcshell test harness → Setup toolkit component scaffolding and xpcshell and chrome browser test harness
![]() |
Assignee | |
Updated•15 years ago
|
Summary: Setup toolkit component scaffolding and xpcshell and chrome browser test harness → Setup toolkit component scaffolding and xpcshell test harness
![]() |
Assignee | |
Comment 17•15 years ago
|
||
Attachment #427236 -
Attachment is obsolete: true
![]() |
||
Comment 18•15 years ago
|
||
exciting!
![]() |
Assignee | |
Updated•15 years ago
|
Assignee: nobody → ddahl
![]() |
Assignee | |
Comment 19•15 years ago
|
||
Attachment #427509 -
Attachment is obsolete: true
![]() |
Assignee | |
Comment 20•15 years ago
|
||
Attachment #429655 -
Attachment is obsolete: true
![]() |
Assignee | |
Comment 21•15 years ago
|
||
Attachment #429660 -
Attachment is obsolete: true
![]() |
Assignee | |
Comment 22•15 years ago
|
||
so far so good. the service needs a battery of tests now:)
Attachment #429903 -
Attachment is obsolete: true
![]() |
Assignee | |
Comment 23•15 years ago
|
||
I need to re-create about:hud for the logging documents. I attempted to just use "about:blank" to no avail.
Attachment #430781 -
Attachment is obsolete: true
![]() |
Assignee | |
Comment 24•15 years ago
|
||
Whoops - previous patch was browser not toolkit
Attachment #431793 -
Attachment is obsolete: true
![]() |
Assignee | |
Comment 25•15 years ago
|
||
Still have invisible nodes being appended. May have some kind of .cloneNode() bug.
Attachment #431794 -
Attachment is obsolete: true
![]() |
Assignee | |
Updated•15 years ago
|
Attachment #432055 -
Attachment is patch: true
Attachment #432055 -
Attachment mime type: application/octet-stream → text/plain
![]() |
Assignee | |
Comment 26•15 years ago
|
||
Attachment #432055 -
Attachment is obsolete: true
![]() |
Assignee | |
Comment 27•15 years ago
|
||
Attachment #432093 -
Attachment is obsolete: true
Comment 28•15 years ago
|
||
This code has some critical Firefox-tabbrowser dependencies, especially for a toolkit service. What's the go-forward plan to work around this? Should we be looking at making a simple, app-side (not in toolkit) JS XPCOM component to act as a bridge?
![]() |
Assignee | |
Comment 29•15 years ago
|
||
(In reply to comment #28)
> This code has some critical Firefox-tabbrowser dependencies, especially for a
> toolkit service. What's the go-forward plan to work around this? Should we be
> looking at making a simple, app-side (not in toolkit) JS XPCOM component to act
> as a bridge?
It does, and I have been thinking about it all weekend. I think instead of passing in a aTab object to the constructor, you pass in the parent DOM node you want the HUD to attach to as well as the node you insertBefore. Any other dependencies like this should be removed with more agnostic approaches, as I would like the HeadsUpDisplay .jsm to reside in toolkit and be consumed into the service as a factory.
Mark: thanks for taking a peek at this.
![]() |
Assignee | |
Comment 30•15 years ago
|
||
Closing this bug, moving beginning implementation and new patches to bug 534398
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•