37 for (var
i = 0;
i < this.indexes.length;
i++)
39 if (this.indexes[
i] == index)
42 this.indexes.push(index);
43 this.indexes.sort(
function numberorder(a, b) {
return a - b; });
58 var view = library.createView();
59 var cfs = view.cascadeFilterSet;
62 cfs.addListener(listener,
false);
64 cfs.appendSearch([
"*"], 1);
66 cfs.appendFilter(
"http://songbirdnest.com/data/1.0#artistName",
false);
68 cfs.appendFilter(
"http://songbirdnest.com/data/1.0#albumName",
false);
80 cfs.set(0, [
"AC/DC"], 1);
85 assertEqual(arrayEquals(listener.indexes, [1, 2]),
true);
94 assertEqual(arrayEquals(listener.indexes, [1, 2]),
true);
98 cfs.set(1, [
"a-ha"], 1);
103 assertEqual(arrayEquals(listener.indexes, [2]),
true);
107 cfs.set(1, [
"a-ha",
"AC/DC"], 2);
112 assertEqual(arrayEquals(listener.indexes, [2]),
true);
116 cfs.set(2, [
"Back In Black"], 1);
121 assertEqual(arrayEquals(listener.indexes, []),
true);
125 cfs.set(0, [
"dfkjhdfds"], 1);
130 assertEqual(arrayEquals(listener.indexes, [1, 2]),
true);
139 assertEqual(arrayEquals(listener.indexes, [0, 1]),
true);
144 cfs.appendFilter(
"http://songbirdnest.com/data/1.0#genre",
false);
146 cfs.changeFilter(0,
"http://songbirdnest.com/data/1.0#artistName");
148 cfs.changeFilter(0,
"http://songbirdnest.com/data/1.0#genre");
151 cfs.removeListener(listener);
154 function arrayEquals(array1, array2) {
156 if (array1.length != array2.length) {
160 for(var
i = 0;
i < array1.length;
i++) {
161 if (array1[
i] != array2[
i]) {
function CascadeListener()
Test file.
function assertEqual(aExpected, aActual, aMessage)
function createLibrary(databaseGuid, databaseLocation)
_getSelectedPageStyle s i