<commit_before>function runTest()
{
    FBTest.sysout("issue4905.START");

    FBTest.openNewTab(basePath + "net/4905/issue4905.html", function(win)
    {
        FBTest.openFirebug();

        // Enable browser cache
        var browserCache = FW.Firebug.NetMonitor.BrowserCache;
        var browserCacheEnabled = browserCache.isEnabled();
        browserCache.toggle(true);
        
        FBTest.selectPanel("net");
        FBTest.enableNetPanel();

        var options =
        {
            tagName: "tr",
            classes: "netRow category-undefined hasHeaders loaded",
            counter: 2
        };

        var callbackFunction = function(row)
        {
            var panelNode = FBTest.selectPanel("net").panelNode;

            FBTest.click(row);
            FBTest.expandElements(panelNode, "netInfoPostTab");

            var cachedResponseHeadersTitle = FW.FBL.getElementByClass(panelNode,
                "netInfoCachedResponseHeadersTitle");
            if (FBTest.ok(cachedResponseHeadersTitle, "Cached response headers must exist"))
            {
                var cachedResponseHeaders = cachedResponseHeadersTitle.nextSibling;
                var cachedResponseHeadersBody = cachedResponseHeaders.
                    getElementsByClassName("netInfoCachedResponseHeadersBody").item(0);
                FBTest.ok(cachedResponseHeadersBody.children.length > 0,
                    "There must be some cached response headers");
                FBTest.compare(/Cache-Control/,
                    cachedResponseHeaders.textContent,
                    "Cached response headers must include 'Cache-Control' header");
            }

            // Disable browser cache again if it was disabled before
            if (!browserCacheEnabled)
                browserCache.toggle(false);

            FBTest.testDone("issue4905.DONE");
        };

        FBTest.waitForDisplayedElement("net", options, callbackFunction);

        FBTest.reload();
    });
}<commit_msg>FBTest: more tracing info for test net/4905 (this test fails randomly)<commit_after>function runTest()
{
    FBTest.sysout("issue4905.START");

    FBTest.openNewTab(basePath + "net/4905/issue4905.html", function(win)
    {
        FBTest.openFirebug();

        var diskCache = FW.Firebug.getPref("browser.cache", "disk.enable");
        var memoryCache = FW.Firebug.getPref("browser.cache", "memory.enable");
        FBTest.progress("disk: " + diskCache + ", memory: " + memoryCache);

        // Enable browser cache
        var browserCache = FW.Firebug.NetMonitor.BrowserCache;
        var browserCacheEnabled = browserCache.isEnabled();
        browserCache.toggle(true);

        FBTest.selectPanel("net");
        FBTest.enableNetPanel();

        var options =
        {
            tagName: "tr",
            classes: "netRow category-undefined hasHeaders loaded fromCache",
            counter: 2
        };

        FBTest.waitForDisplayedElement("net", options, function()
        {
            var panelNode = FBTest.getPanel("net").panelNode;
            var rows = panelNode.querySelectorAll(
                ".netRow.category-undefined.hasHeaders.loaded.fromCache");

            FBTest.compare(2, rows.length, "There must be two requests coming from the cache: " +
                rows.length);

            for (var i=0; i<rows.length; i++)
            {
                var row = rows[i];

                FBTest.progress("row " + i);

                FBTest.click(row);
                FBTest.expandElements(panelNode, "netInfoPostTab");

                var title = FW.FBL.getElementByClass(panelNode, "netInfoCachedResponseHeadersTitle");
                if (FBTest.ok(title, "Cached response headers must exist"))
                {
                    var headers = title.nextSibling;
                    var body = headers.getElementsByClassName(
                        "netInfoCachedResponseHeadersBody").item(0);

                    FBTest.ok(body.children.length > 0, "There must be some cached response headers");
                    FBTest.compare(/Cache-Control/, headers.textContent,
                        "Cached response headers must include 'Cache-Control' header");
                }
            }

            // Disable browser cache again if it was disabled before
            if (!browserCacheEnabled)
                browserCache.toggle(false);

            FBTest.testDone("issue4905.DONE");
        });

        FBTest.reload();
    });
}
{'fraction_non_alphanumeric': 0.10163055617601072, 'fraction_numerical': 0.009828009828009828, 'mean_word_length': 1.9893190921228305, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3293765', 'n_tokens_mistral': 1217, 'n_tokens_neox': 1108, 'n_words': 230}