mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1277590 - Changed setting docShell to private to opening a private window. r=ehsan
MozReview-Commit-ID: 2NSkp2n0mWy
This commit is contained in:
parent
806298cd92
commit
1c9bd9748d
@ -33,18 +33,13 @@ function* test_download_state_complete(aTab, aDownload, aPrivate, aCanceled) {
|
||||
}
|
||||
|
||||
function* test_createDownload_common(aPrivate, aType) {
|
||||
let tab = gBrowser.addTab(getRootDirectory(gTestPath) + "testFile.html");
|
||||
yield promiseBrowserLoaded(tab.linkedBrowser);
|
||||
|
||||
if (aPrivate) {
|
||||
tab.linkedBrowser.docShell.QueryInterface(Ci.nsILoadContext)
|
||||
.usePrivateBrowsing = true;
|
||||
}
|
||||
let win = yield BrowserTestUtils.openNewBrowserWindow({ private : aPrivate});
|
||||
|
||||
let tab = yield BrowserTestUtils.openNewForegroundTab(win.gBrowser, getRootDirectory(gTestPath) + "testFile.html");
|
||||
let download = yield Downloads.createDownload({
|
||||
source: tab.linkedBrowser.contentWindow,
|
||||
target: { path: getTempFile(TEST_TARGET_FILE_NAME_PDF).path },
|
||||
saver: { type: aType },
|
||||
saver: { type: aType }
|
||||
});
|
||||
|
||||
yield test_download_windowRef(tab, download);
|
||||
@ -59,7 +54,8 @@ function* test_createDownload_common(aPrivate, aType) {
|
||||
ok((yield OS.File.exists(download.target.path)), "File exists");
|
||||
}
|
||||
|
||||
gBrowser.removeTab(tab);
|
||||
win.gBrowser.removeTab(tab);
|
||||
win.close()
|
||||
}
|
||||
|
||||
add_task(function* test_createDownload_pdf_private() {
|
||||
|
Loading…
Reference in New Issue
Block a user