Backed out changesets b228f986968b and b5721ae2c2cd (bug 1092055) for browser_webconsole_certificate_messages.js failures.

This commit is contained in:
Ryan VanderMeulen 2015-02-10 12:11:39 -05:00
Родитель 499f78ff2f
Коммит 8a45f1880d
6 изменённых файлов: 0 добавлений и 87 удалений

Просмотреть файл

@ -126,9 +126,6 @@ support-files =
test_bug_1010953_cspro.html
test_bug1045902_console_csp_ignore_reflected_xss_message.html^headers^
test_bug1045902_console_csp_ignore_reflected_xss_message.html
test_bug1092055_shouldwarn.js^headers^
test_bug1092055_shouldwarn.js
test_bug1092055_shouldwarn.html
[browser_bug1045902_console_csp_ignore_reflected_xss_message.js]
[browser_bug664688_sandbox_update_after_navigation.js]
@ -304,8 +301,6 @@ skip-if = e10s # Bug 1042253 - webconsole e10s tests (Linux debug intermittent)
[browser_webconsole_bug_1010953_cspro.js]
[browser_webconsole_certificate_messages.js]
skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s
[browser_webconsole_show_subresource_security_errors.js]
skip-if = e10s # Bug 1042253 - webconsole tests disabled with e10s
[browser_webconsole_cached_autocomplete.js]
[browser_webconsole_change_font_size.js]
[browser_webconsole_chrome.js]

Просмотреть файл

@ -1,30 +0,0 @@
/* vim:set ts=2 sw=2 sts=2 et: */
/*
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
// Ensure non-toplevel security errors are displayed
const TEST_URI = "data:text/html;charset=utf8,Web Console subresource STS warning test";
const TEST_DOC = "https://example.com/browser/browser/devtools/webconsole/test/test_bug1092055_shouldwarn.html";
const SAMPLE_MSG = 'invalid Strict-Transport-Security header'
let test = asyncTest(function* () {
let { browser } = yield loadTab(TEST_URI);
let hud = yield openConsole();
hud.jsterm.clearOutput();
let loaded = loadBrowser(browser);
content.location = TEST_DOC;
yield loaded;
yield waitForSuccess({
name: "Subresource STS warning displayed successfully",
validator: function() {
return hud.outputNode.textContent.indexOf(SAMPLE_MSG) > -1;
}
});
});

Просмотреть файл

@ -1,15 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8">
<title>Bug 1092055 - Log console messages for non-top-level security errors</title>
<script src="test_bug1092055_shouldwarn.js"></script>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
</head>
<body>
Bug 1092055 - Log console messages for non-top-level security errors
</body>
</html>

Просмотреть файл

@ -1,2 +0,0 @@
// It doesn't matter what this script does, but the broken HSTS header sent
// with it should result in warnings in the webconsole

Просмотреть файл

@ -1 +0,0 @@
Strict-Transport-Security: some complete nonsense

Просмотреть файл

@ -16,7 +16,6 @@
#include "nsICachingChannel.h"
#include "nsIPrincipal.h"
#include "nsIScriptError.h"
#include "nsISeekableStream.h"
#include "nsITimedChannel.h"
#include "nsIEncodedChannel.h"
@ -1673,39 +1672,6 @@ HttpBaseChannel::AddSecurityMessage(const nsAString &aMessageTag,
message->SetTag(aMessageTag);
message->SetCategory(aMessageCategory);
mSecurityConsoleMessages.AppendElement(message);
nsCOMPtr<nsIConsoleService> console(do_GetService(NS_CONSOLESERVICE_CONTRACTID));
if (!console) {
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsILoadInfo> loadInfo;
GetLoadInfo(getter_AddRefs(loadInfo));
if (!loadInfo) {
return NS_ERROR_FAILURE;
}
uint32_t innerWindowID = loadInfo->GetInnerWindowID();
nsXPIDLString errorText;
rv = nsContentUtils::GetLocalizedString(
nsContentUtils::eSECURITY_PROPERTIES,
NS_ConvertUTF16toUTF8(aMessageTag).get(),
errorText);
NS_ENSURE_SUCCESS(rv, rv);
nsAutoCString spec;
if (mURI) {
mURI->GetSpec(spec);
}
nsCOMPtr<nsIScriptError> error(do_CreateInstance(NS_SCRIPTERROR_CONTRACTID));
error->InitWithWindowID(errorText, NS_ConvertUTF8toUTF16(spec),
EmptyString(), 0, 0, nsIScriptError::warningFlag,
NS_ConvertUTF16toUTF8(aMessageCategory),
innerWindowID);
console->LogMessage(error);
return NS_OK;
}