Back out instrumentation for bug 536603 and re-disable test

This commit is contained in:
Zack Weinberg 2010-01-18 14:54:56 -08:00
parent f2ada08b52
commit b7cf0bd89e
6 changed files with 8 additions and 121 deletions

View File

@ -1942,9 +1942,6 @@ CSSLoaderImpl::LoadChildSheet(nsICSSStyleSheet* aParentSheet,
// Houston, we have a loop, blow off this child and pretend this never
// happened
LOG_ERROR((" @import cycle detected, dropping load"));
#ifdef NS_BUILD_REFCNT_LOGGING
printf("@import cycle detected, dropping load");
#endif
return NS_OK;
}
data = data->mParentData;
@ -2250,11 +2247,6 @@ CSSLoaderImpl::Stop()
#endif
}
mPostedEvents.Clear();
#ifdef NS_BUILD_REFCNT_LOGGING
if (arr.Length() != 0) {
printf("nsCSSLoader::Stop: stopping %d loads\n", int(arr.Length()));
}
#endif
mDatasToNotifyOn += arr.Length();
for (i = 0; i < arr.Length(); ++i) {
@ -2338,11 +2330,6 @@ CSSLoaderImpl::StopLoadingSheet(nsIURI* aURL)
}
mPostedEvents.Clear();
#ifdef NS_BUILD_REFCNT_LOGGING
if (arr.Length() != 0) {
printf("nsCSSLoader::StopLoadingSheet: stopping %d loads\n", int(arr.Length()));
}
#endif
mDatasToNotifyOn += arr.Length();
for (i = 0; i < arr.Length(); ++i) {
--mDatasToNotifyOn;

View File

@ -3,8 +3,6 @@ const DEBUG_all_stub = false;
function handleRequest(request, response)
{
dump("ccd.sjs: handling request with query " + request.queryString + "\n");
// Decode the query string to know what test we're doing.
// character 1: 'I' = text/css response, 'J' = text/html response

View File

@ -1,6 +1,5 @@
function handleRequest(request, response)
{
dump("redirect.sjs: handling request with query " + request.queryString + "\n");
response.setStatusLine(request.httpVersion, 301, "Moved Permanently");
response.setHeader("Location", request.queryString, false);
}

View File

@ -36,8 +36,6 @@
<hr/>
<iframe src="/server/debug?2" style="width: 100%; height: 30px"></iframe>
<div class="column">
<h2>&nbsp;</h2>
<ol><li>text/css<ol><li>same origin<ol><li>valid</li>
@ -82,46 +80,6 @@
/** Test for Bug 524223 **/
function check_iframe(ifr) {
var doc = ifr.contentDocument;
// To debug bug 536603, check the imported style rules in the iframe.
netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserWrite');
var parentSheet = doc.getElementsByTagName("style")[1].sheet;
for (var idx = 0; idx < parentSheet.cssRules.length; ++idx) {
var rule = parentSheet.cssRules[idx];
var ch = rule.href.indexOf("ccd.sjs?");
var id = rule.href.substring(ch + 8).substring(0,4);
if (rule.styleSheet) {
var rl = rule.styleSheet.cssRules;
if (rl.length > 0) {
var lastRule = rl[rl.length - 1];
is(lastRule.selectorText, "#" + id,
"selector text for rule @import-ed at " + rule.href + " that specifies color " + lastRule.style.backgroundColor);
} else {
ok(true, "@import rule importing " + rule.href + " has no rules");
}
} else {
ok(true, "@import rule importing " + rule.href + " has no sheet");
}
}
var links = doc.getElementsByTagName("link");
for (idx = 0; idx < links.length; ++idx) {
var link = links[idx];
var ch = link.href.indexOf("ccd.sjs?");
var id = link.href.substring(ch + 8).substring(0,4);
if (link.sheet) {
var rl = link.sheet.cssRules;
if (rl.length > 0) {
var lastRule = rl[rl.length - 1];
is(lastRule.selectorText, "#" + id,
"selector text for rule <link>ed at " + link.href + " that specifies color " + lastRule.style.backgroundColor);
} else {
ok(true, "<link>ed rule at " + link.href + " has no rules");
}
} else {
ok(true, "<link>ed rule at " + link.href + " has no sheet");
}
}
var cases = doc.getElementsByTagName("p");
for (var i = 0; i < cases.length; i++) {
var color = doc.defaultView.getComputedStyle(cases[i], "")
@ -133,18 +91,13 @@ function check_iframe(ifr) {
SimpleTest.waitForExplicitFinish();
window.onload = function() {
check_iframe(document.getElementById("quirks"));
check_iframe(document.getElementById("standards"));
setTimeout(function() {
// The quirks-mode tests are inexplicably failing intermittently
// on Mac (bug 536603), so disable them for now.
if (navigator.platform.substring(0,3) != "Mac")
check_iframe(document.getElementById("quirks"));
check_iframe(document.getElementById("standards"));
document.getElementById("debugOff").
setAttribute("src", "/server/debug?0");
SimpleTest.finish();
}, 5000);
check_iframe(document.getElementById("standards"));
SimpleTest.finish();
};
</script>
<iframe id="debugOff" style="width: 100%; height: 30px"></iframe>
</body>
</html>

View File

@ -57,9 +57,6 @@ const PR_UINT32_MAX = Math.pow(2, 32) - 1;
/** True if debugging output is enabled, false otherwise. */
var DEBUG = false; // non-const *only* so tweakable in server tests
/** True if debugging output should be timestamped. */
var DEBUG_TIMESTAMP = false; // non-const so tweakable in server tests
var gGlobalObject = this;
/**
@ -78,7 +75,7 @@ function NS_ASSERT(cond, msg)
var stack = new Error().stack.split(/\n/);
dumpn(stack.map(function(val) { return "###!!! " + val; }).join("\n"));
throw Cr.NS_ERROR_ABORT;
}
}
@ -169,26 +166,10 @@ const SJS_TYPE = "sjs";
/** dump(str) with a trailing "\n" -- only outputs if DEBUG */
var first_stamp = null;
function dumpn(str)
{
if (DEBUG) {
var prefix = "|HTTPD|";
if (DEBUG_TIMESTAMP) {
if (first_stamp === null) {
first_stamp = new Date();
}
var elapsed = (new Date() - first_stamp)/1000; // in decimal seconds
var min = Math.floor(elapsed/60);
var sec = elapsed - 60*min;
if (sec < 10)
prefix += min + ":0" + sec.toFixed(3) + " ";
else
prefix += min + ":" + sec.toFixed(3) + " ";
}
dump(prefix + str + "\n");
}
if (DEBUG)
dump(str + "\n");
}
/** Dumps the current JS stack if DEBUG. */

View File

@ -198,7 +198,6 @@ function createMochitestServer(serverBasePath)
server.registerDirectory("/", serverBasePath);
server.registerPathHandler("/server/shutdown", serverShutdown);
server.registerPathHandler("/server/debug", serverDebug);
server.registerContentType("sjs", "sjs"); // .sjs == CGI-like functionality
server.registerContentType("jar", "application/x-jar");
server.registerContentType("ogg", "application/ogg");
@ -298,36 +297,6 @@ function serverShutdown(metadata, response)
server.stop(serverStopped);
}
// /server/debug?[012]
function serverDebug(metadata, response)
{
var mode;
if (metadata.queryString.length != 1) {
throw HTTP_400;
} else if (metadata.queryString[0] == '0') {
// do this now so it gets logged with the old mode
dumpn("Server debug logs disabled.");
DEBUG = false;
DEBUG_TIMESTAMP = false;
mode = "disabled";
} else if (metadata.queryString[0] == '1') {
DEBUG = true;
DEBUG_TIMESTAMP = false;
mode = "enabled";
} else if (metadata.queryString[0] == '2') {
DEBUG = true;
DEBUG_TIMESTAMP = true;
mode = "enabled, with timestamps";
} else {
throw HTTP_400;
}
response.setStatusLine("1.1", 200, "OK");
response.setHeader("Content-type", "text/plain", false);
var body = "Server debug logs " + mode + ".";
response.bodyOutputStream.write(body, body.length);
dumpn(body);
}
//
// DIRECTORY LISTINGS
//