mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Bug 945366 - [Download API] Accessing error attribute at download start fires NS_ERROR_UNEXPECTED. Relanding because of bad merge. r=gwagner
This commit is contained in:
parent
535a7cd23f
commit
f9d0889611
@ -206,9 +206,9 @@ function DOMDownloadImpl() {
|
||||
this.path = null;
|
||||
this.state = "stopped";
|
||||
this.contentType = null;
|
||||
this.error = null;
|
||||
|
||||
/* fields that require getters/setters */
|
||||
this._error = null;
|
||||
this._startTime = new Date();
|
||||
|
||||
/* private fields */
|
||||
@ -247,6 +247,14 @@ DOMDownloadImpl.prototype = {
|
||||
return this.__DOM_IMPL__.getEventHandler("onstatechange");
|
||||
},
|
||||
|
||||
get error() {
|
||||
return this._error;
|
||||
},
|
||||
|
||||
set error(aError) {
|
||||
this._error = aError;
|
||||
},
|
||||
|
||||
get startTime() {
|
||||
return this._startTime;
|
||||
},
|
||||
|
@ -51,14 +51,10 @@ function checkConsistentDownloadAttributes(download) {
|
||||
todo(download.path === expectedDownloadPath,
|
||||
"Download path = " + expectedDownloadPath);
|
||||
|
||||
// bug 948287: Accessing startTime attribute at download start fires
|
||||
// NS_ERROR_UNEXPECTED in emulator
|
||||
//ok(download.startTime >= todayDate,
|
||||
// "Download start time should be greater than or equal to today");
|
||||
ok(download.startTime >= todayDate,
|
||||
"Download start time should be greater than or equal to today");
|
||||
|
||||
// bug 945366: Accessing error attribute at download start fires
|
||||
// NS_ERROR_UNEXPECTED in emulator
|
||||
//is(download.error, null, "Download does not have an error");
|
||||
is(download.error, null, "Download does not have an error");
|
||||
|
||||
is(download.url, expectedServeURL,
|
||||
"Download URL = " + expectedServeURL);
|
||||
|
@ -59,7 +59,7 @@ interface DOMDownload : EventTarget {
|
||||
|
||||
// A DOM error object, that will be not null when a download is stopped
|
||||
// because something failed.
|
||||
readonly attribute DOMError error;
|
||||
readonly attribute DOMError? error;
|
||||
|
||||
// Pauses the download.
|
||||
Promise pause();
|
||||
|
Loading…
Reference in New Issue
Block a user