Closed
Bug 371052
Opened 17 years ago
Closed 17 years ago
Implement nsIClassInfo on nsCommandLine
Categories
(Toolkit :: Startup and Profile System, defect)
Toolkit
Startup and Profile System
Tracking
()
RESOLVED
FIXED
mozilla1.9alpha3
People
(Reporter: WeirdAl, Assigned: WeirdAl)
Details
Attachments
(1 file, 1 obsolete file)
7.36 KB,
patch
|
WeirdAl
:
first-review+
|
Details | Diff | Splinter Review |
<WeirdAl> bsmedberg: when I open my XULRunner app, I'm passed a nsISupports for window.arguments[0]... what is it, what does it implement? <bsmedberg> WeirdAl: it's the nsICommandLine WeirdAl: I guess we should make that implement classinfo, hrm? I'm not sure how to write an automated test for this, though. We don't yet have a test harness for XR apps.
Comment 1•17 years ago
|
||
mochitest could test this as chrome code: cl = Cc["@mozilla.org/toolkit/command-line;1"].createInstance() if ("length" in cl) { // TEST OK } else { // TEST FAILED } xpcshell currently doesn't use classinfo, so you couldn't do it in there.
Assignee | ||
Comment 2•17 years ago
|
||
hm, actually a xpcshell test does work.
Assignee | ||
Comment 3•17 years ago
|
||
Attachment #255833 -
Flags: first-review?
Assignee | ||
Updated•17 years ago
|
Attachment #255833 -
Flags: first-review? → first-review?(benjamin)
Assignee | ||
Updated•17 years ago
|
Status: NEW → ASSIGNED
Flags: in-testsuite?
Comment 4•17 years ago
|
||
+ var commandLine = clClass.createInstance(Components.interfaces.nsISupports); I wouldn't mention an interface there...
Comment 5•17 years ago
|
||
(In reply to comment #0) > <WeirdAl> bsmedberg: when I open my XULRunner app, I'm passed a > nsISupports for window.arguments[0]... what is it, what does it implement? > <bsmedberg> WeirdAl: it's the nsICommandLine > WeirdAl: I guess we should make that implement classinfo, hrm? Note that if all you want to do is to avoid having to call window.arguments[0].QueryInterface(Components.interfaces.nsICommandLine) then just wrap the nsICommandLineObject in an nsISupportsInterfacePointer with the right IID (see nsJSEnvironment.cpp nsJSContext::AddSupportsPrimitivesTojsvals)
Comment 6•17 years ago
|
||
Comment on attachment 255833 [details] [diff] [review] patch, v1 (includes xpcshell test) >Index: toolkit/components/commandlines/test/Makefile.in >+# >+# Makefile for installing and running xpcshell-based tests. You can use >+# this file as template when creating tests for a new module. Don't >+# forget to change the lines marked below. See >+# http://developer.mozilla.org/en/docs/Writing_xpcshell-based_unit_tests >+# for detailed instructions. >+# Remove this and other comments that were part of the makefile template. >+# Note: Invoke any additional (non-xpcshell) test programs here. >+check:: Remove this empty and unnecessary rule entirely. >Index: toolkit/components/commandlines/test/unit/test_classinfo.js >+ var commandLine = clClass.createInstance(Components.interfaces.nsISupports); As noted, this should just be createInstance(). No need to mention isupports explicitly.
Attachment #255833 -
Flags: first-review?(benjamin) → first-review+
Assignee | ||
Comment 7•17 years ago
|
||
carrying over r+ from bsmedberg.
Attachment #255833 -
Attachment is obsolete: true
Attachment #256928 -
Flags: first-review+
Assignee | ||
Updated•17 years ago
|
Whiteboard: [checkin needed]
Comment 8•17 years ago
|
||
mozilla/toolkit/components/commandlines/Makefile.in 1.3 mozilla/toolkit/components/commandlines/src/nsCommandLine.cpp 1.14 mozilla/toolkit/components/commandlines/test/Makefile.in 1.1 mozilla/toolkit/components/commandlines/test/unit/test_classinfo.js 1.1
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Flags: in-testsuite? → in-testsuite+
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Updated•17 years ago
|
Target Milestone: --- → mozilla1.9alpha3
Component: XRE Startup → Startup and Profile System
QA Contact: xre.startup → startup
You need to log in
before you can comment on or make changes to this bug.
Description
•