"use strict"; window.onload = function () { setup({ explicit_timeout: true }); /** Number of milliseconds to delay when the server injects pauses into the response. This should be large enough that we can distinguish it from noise with high confidence, but small enough that tests complete quickly. */ var serverStepDelay = 250; var mimeHtml = "text/html"; var mimeText = "text/plain"; var mimePng = "image/png"; var mimeScript = "application/javascript"; var mimeCss = "text/css"; /** Hex encoding of a a 150x50px green PNG. */ var greenPng = "0x89504E470D0A1A0A0000000D494844520000006400000032010300000090FBECFD00000003504C544500FF00345EC0A80000000F49444154281563601805A36068020002BC00011BDDE3900000000049454E44AE426082"; /** Array containing test cases to run. Initially, it contains the one-off 'about:blank" test, but additional cases are pushed below by expanding templates. */ var testCases = [ { description: "No timeline entry for about:blank", test: function (test) { // Insert an empty IFrame. var frame = document.createElement("iframe"); // Wait for the IFrame to load and ensure there is no resource entry for it on the timeline. // // We use the 'createOnloadCallbackFn()' helper which is normally invoked by 'initiateFetch()' // to avoid setting the IFrame's src. It registers a test step for us, finds our entry on the // resource timeline, and wraps our callback function to automatically vet invariants. frame.onload = createOnloadCallbackFn(test, frame, "about:blank", function (initiator, entry) { assert_equals(entry, undefined, "Inserting an IFrame with a src of 'about:blank' must not add an entry to the timeline."); assertInvariants( test, function () { test.done(); }); }); document.body.appendChild(frame); // Paranoid check that the new IFrame has loaded about:blank. assert_equals( frame.contentWindow.location.href, "about:blank", "'Src' of new