25 Components.utils.import(
"resource://gre/modules/XPCOMUtils.jsm");
29 const prop =
"http://songbirdnest.com/data/1.0#imageLabelLink";
32 Cc[
"@songbirdnest.com/Songbird/Properties/Builder/ImageLabelLink;1"]
33 .createInstance(
Ci.sbIImageLabelLinkPropertyBuilder)
34 .QueryInterface(
Ci.sbIClickablePropertyBuilder);
36 builder.propertyID = prop;
37 builder.displayName =
"Display";
40 "dummy": {
label:
"Dummy",
41 image:
"http://0/dummy.png" },
42 "two": {
label:
"\u01d5\u0144\u0131\u00e7\u00f8\u0111\u0115",
43 image:
"http://0/two.png" },
44 "": {
label:
"Default",
45 image:
"http://0/default.png" }
47 for (let
key in K_DATA) {
54 function onclick(aPropertyInfo, aItem, aEvent, aContext) {
67 builder.addClickHandler(onclick);
71 "image label link property info should be a sbITreeViewPropertyInfo!");
73 "image label link property info should be a sbIClickablePropertyInfo!");
79 for (let
key in K_DATA) {
81 "Expecting to display [" + K_DATA[
key].label +
82 "] for property value [" +
key +
"]");
84 "Expecting to get image [" + K_DATA[
key].image +
85 "] for property value [" +
key +
"]");
88 "Expecting to use default label [" + K_DATA[
""].label +
89 "] for missing key [missing]");
90 assertEqual(pi.getImageSrc(
"missing"), K_DATA[
""].image,
91 "Expecting to use default image [" + K_DATA[
""].image +
92 "] for missing key [missing]");
98 var
event = #2= { wrappedJSObject: #2# };
99 var context = #3= { wrappedJSObject: #3# };
100 pi.onClick(item,
event, context);
sbOSDControlService prototype QueryInterface
function assertTrue(aTest, aMessage)
function assertEqual(aExpected, aActual, aMessage)
this _contentSandbox label
function runTest()
Advanced DataRemote unit tests.