Bug 1146059 - Remove Response.finalURL. r=ehsan

--HG--
extra : rebase_source : 6b22c835c2599d20d625b7b0706c625b06080b23
This commit is contained in:
Nikhil Marathe 2015-03-21 17:49:29 -07:00
parent f174c824a1
commit 5e45307f84
4 changed files with 0 additions and 44 deletions

View File

@ -228,18 +228,5 @@ Response::Headers_()
return mHeaders;
}
void
Response::SetFinalURL(bool aFinalURL, ErrorResult& aRv)
{
nsCString url;
mInternalResponse->GetUrl(url);
if (url.IsEmpty()) {
aRv.ThrowTypeError(MSG_RESPONSE_URL_IS_NULL);
return;
}
mInternalResponse->SetFinalURL(aFinalURL);
}
} // namespace dom
} // namespace mozilla

View File

@ -56,15 +56,6 @@ public:
aUrl.AsAString() = NS_ConvertUTF8toUTF16(url);
}
bool
GetFinalURL(ErrorResult& aRv) const
{
return mInternalResponse->FinalURL();
}
void
SetFinalURL(bool aFinalURL, ErrorResult& aRv);
uint16_t
Status() const
{

View File

@ -121,25 +121,6 @@ function testOk() {
ok(!r4.ok, "Response with status 302 should have ok false");
}
// It is not possible to test setting finalURL until we have ServiceWorker
// interception. This is because synthetic Responses do not have a url, the url
// is set based on the request, so a SW could initiate a fetch() on behalf of
// a client and set the resulting Response's finalURL before returning it to
// the client, in which case the "set response's url to request's url" from the
// client's point of view would not happen. A test for this will be added by
// Bug 1134352.
function testFinalURL() {
var r1 = new Response();
ok(!r1.finalURL, "Response.finalURL is false by default.");
try {
r1.finalURL = true;
ok(false, "Setting Response.finalURL of Response with null url should fail.");
} catch(e) {
ok(true, "Setting Response.finalURL of Response with null url should fail.");
}
}
function testBodyUsed() {
var res = new Response("Sample body");
ok(!res.bodyUsed, "bodyUsed is initially false.");
@ -226,7 +207,6 @@ function runTest() {
testError();
testRedirect();
testOk();
testFinalURL();
return Promise.resolve()
.then(testBodyCreation)

View File

@ -17,8 +17,6 @@ interface Response {
readonly attribute ResponseType type;
readonly attribute USVString url;
[Throws]
attribute boolean finalURL;
readonly attribute unsigned short status;
readonly attribute boolean ok;
readonly attribute ByteString statusText;