44 function test_checkedAndDisabledAtStart(aWin)
46 let
doc = aWin.document;
47 let downloads = doc.getElementById(
"downloads-checkbox");
48 let
history = doc.getElementById(
"history-checkbox");
50 ok(history.checked,
"history checkbox is checked");
51 ok(downloads.disabled,
"downloads checkbox is disabled");
52 ok(downloads.checked,
"downloads checkbox is checked");
55 function test_checkedAndDisabledOnHistoryToggle(aWin)
57 let
doc = aWin.document;
58 let downloads = doc.getElementById(
"downloads-checkbox");
59 let
history = doc.getElementById(
"history-checkbox");
61 EventUtils.synthesizeMouse(history, 0, 0, {}, aWin);
62 ok(!history.checked,
"history checkbox is not checked");
63 ok(downloads.disabled,
"downloads checkbox is disabled");
64 ok(downloads.checked,
"downloads checkbox is checked");
67 function test_checkedAfterAddingDownload(aWin)
69 let
doc = aWin.document;
70 let downloads = doc.getElementById(
"downloads-checkbox");
71 let
history = doc.getElementById(
"history-checkbox");
74 let
ios =
Cc[
"@mozilla.org/network/io-service;1"].
76 let
file =
Cc[
"@mozilla.org/file/directory_service;1"].
78 file.append(
"satitize-dm-test.file");
79 file.createUnique(
Ci.nsIFile.NORMAL_FILE_TYPE, 0666);
80 let testPath = ios.newFileURI(file).spec;
83 source:
"https://bugzilla.mozilla.org/attachment.cgi?id=266520",
85 startTime: 1180493839859230,
86 endTime: 1180493839859239,
87 state:
Ci.nsIDownloadManager.DOWNLOAD_FINISHED,
88 currBytes: 0, maxBytes: -1, preferredAction: 0, autoResume: 0
90 let db =
Cc[
"@mozilla.org/download-manager;1"].
92 let rawStmt = db.createStatement(
93 "INSERT INTO moz_downloads (name, source, target, startTime, endTime, " +
94 "state, currBytes, maxBytes, preferredAction, autoResume) " +
95 "VALUES (:name, :source, :target, :startTime, :endTime, :state, " +
96 ":currBytes, :maxBytes, :preferredAction, :autoResume)");
97 let stmt =
Cc[
"@mozilla.org/storage/statement-wrapper;1"].
99 stmt.initialize(rawStmt);
101 for (let prop in data)
102 stmt.params[prop] = data[prop];
106 stmt.statement.finalize();
110 EventUtils.synthesizeMouse(history, 0, 0, {}, aWin);
111 EventUtils.synthesizeMouse(history, 0, 0, {}, aWin);
113 ok(!history.checked,
"history checkbox is not checked");
114 ok(!downloads.disabled,
"downloads checkbox is not disabled");
115 ok(downloads.checked,
"downloads checkbox is checked");
118 function test_checkedAndDisabledWithHistoryChecked(aWin)
120 let
doc = aWin.document;
121 let downloads = doc.getElementById(
"downloads-checkbox");
122 let
history = doc.getElementById(
"history-checkbox");
124 EventUtils.synthesizeMouse(history, 0, 0, {}, aWin);
125 ok(history.checked,
"history checkbox is checked");
126 ok(downloads.disabled,
"downloads checkbox is disabled");
127 ok(downloads.checked,
"downloads checkbox is checked");
131 test_checkedAndDisabledAtStart,
132 test_checkedAndDisabledOnHistoryToggle,
133 test_checkedAfterAddingDownload,
134 test_checkedAndDisabledWithHistoryChecked,
140 let
dm =
Cc[
"@mozilla.org/download-manager;1"].
142 let db = dm.DBConnection;
145 db.executeSimpleSQL(
"DELETE FROM moz_downloads");
148 let
ww =
Cc[
"@mozilla.org/embedcomp/window-watcher;1"].
150 let
win = ww.getWindowByName(
"Sanatize",
null);
151 if (win && (win instanceof
Ci.nsIDOMWindowInternal)) win.close();
154 ww.registerNotification({
156 ww.unregisterNotification(
this);
157 aSubject.QueryInterface(
Ci.nsIDOMEventTarget).
164 let win = ww.getWindowByName(
"Sanitize",
null)
165 .QueryInterface(
Ci.nsIDOMWindowInternal);
167 for (let
i = 0;
i < tests.length;
i++)
176 "chrome://browser/content/sanitize.xul",
178 "chrome,titlebar,centerscreen",
function doc() browser.contentDocument
handlersMenuPopup addEventListener("command", this, false)
getService(Ci.sbIFaceplateManager)
aWindow setTimeout(function(){_this.restoreHistory(aWindow, aTabs, aTabData, aIdMap);}, 0)
_getSelectedPageStyle s i
_updateTextAndScrollDataForFrame aData
sbDeviceFirmwareAutoCheckForUpdate prototype observe