diff options
author | Matt A. Tobin <email@mattatobin.com> | 2020-02-25 15:07:00 -0500 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-14 12:55:19 +0200 |
commit | eb70e6e3d0bff11c25f14b1196025791bf2308fb (patch) | |
tree | 5ef4ce17db83c74d7b05ec12c8f59e095a6dd5bd /toolkit/components/aboutmemory/tests/test_aboutmemory6.xul | |
parent | 32ead795290b3399d56b4708fc75b77d296f6a1a (diff) | |
download | UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar.gz UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar.lz UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.tar.xz UXP-eb70e6e3d0bff11c25f14b1196025791bf2308fb.zip |
Issue #439 - Remove tests from toolkit/
Diffstat (limited to 'toolkit/components/aboutmemory/tests/test_aboutmemory6.xul')
-rw-r--r-- | toolkit/components/aboutmemory/tests/test_aboutmemory6.xul | 88 |
1 files changed, 0 insertions, 88 deletions
diff --git a/toolkit/components/aboutmemory/tests/test_aboutmemory6.xul b/toolkit/components/aboutmemory/tests/test_aboutmemory6.xul deleted file mode 100644 index 365f99091..000000000 --- a/toolkit/components/aboutmemory/tests/test_aboutmemory6.xul +++ /dev/null @@ -1,88 +0,0 @@ -<?xml version="1.0"?> -<?xml-stylesheet type="text/css" href="chrome://global/skin"?> -<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?> -<window title="about:memory" - xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> - <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/> - <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script> - - <!-- This file tests the saving of GC and CC logs in both concise and - verbose formats. --> - - <!-- test results are displayed in the html:body --> - <body xmlns="http://www.w3.org/1999/xhtml"></body> - - <iframe id="amFrame" height="400" src="about:memory"></iframe> - - <script type="application/javascript"> - <![CDATA[ - "use strict"; - - const Cc = Components.classes; - const Ci = Components.interfaces; - - function onFocus() { - let frame = document.getElementById("amFrame"); - frame.focus(); - - // Checks that a file exists on the local file system and removes it if it - // is present. - function checkForFileAndRemove(aFilename) { - let localFile = Cc["@mozilla.org/file/local;1"] - .createInstance(Ci.nsILocalFile); - localFile.initWithPath(aFilename); - - let exists = localFile.exists(); - if (exists) { - localFile.remove(/* recursive = */ false); - } - - return exists; - } - - // Given a save log button, triggers the action and checks if both CC & GC - // logs were written to disk. - function saveLogs(aLogButton, aCCLogType) - { - // trigger the log saving - aLogButton.click(); - - // mainDiv - // |-> section - // | -> div gc log path - // | -> div cc log path - let mainDiv = frame.contentWindow.document.getElementById("mainDiv"); - let logNodes = mainDiv.childNodes[0]; - - // we expect 2 logs listed - let numOfLogs = logNodes.childNodes.length; - ok(numOfLogs == 2, "two log entries generated") - - // grab the path portion of the text - let gcLogPath = logNodes.childNodes[0].textContent - .replace("Saved GC log to ", ""); - let ccLogPath = logNodes.childNodes[1].textContent - .replace("Saved " + aCCLogType + " CC log to ", ""); - - // check that the files actually exist - ok(checkForFileAndRemove(gcLogPath), "GC log file exists"); - ok(checkForFileAndRemove(ccLogPath), "CC log file exists"); - } - - // get the log buttons to test - let saveConcise = frame.contentWindow.document - .getElementById("saveLogsConcise"); - let saveVerbose = frame.contentWindow.document - .getElementById("saveLogsVerbose"); - - saveLogs(saveConcise, "concise"); - saveLogs(saveVerbose, "verbose"); - - SimpleTest.finish(); - } - - SimpleTest.waitForFocus(onFocus); - SimpleTest.waitForExplicitFinish(); - ]]> - </script> -</window> |