Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
michael@0 | 1 | /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* vim:set ts=2 sw=2 sts=2 et: */ |
michael@0 | 3 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | |
michael@0 | 8 | // tests that depend on DTD features no one cares about |
michael@0 | 9 | var dtdTests = ["attrdefaultvalue","attrnotspecifiedvalue", "attrremovechild1", |
michael@0 | 10 | "attrreplacechild1", "attrsetvaluenomodificationallowederr", |
michael@0 | 11 | "attrsetvaluenomodificationallowederrEE", "attrspecifiedvalueremove", |
michael@0 | 12 | "characterdataappenddatanomodificationallowederr", "characterdataappenddatanomodificationallowederrEE", |
michael@0 | 13 | "characterdatadeletedatanomodificationallowederr", "characterdatadeletedatanomodificationallowederrEE", |
michael@0 | 14 | "characterdatainsertdatanomodificationallowederr", "characterdatainsertdatanomodificationallowederrEE", |
michael@0 | 15 | "characterdatareplacedatanomodificationallowederr", "characterdatareplacedatanomodificationallowederrEE", |
michael@0 | 16 | "characterdatasetdatanomodificationallowederr", "characterdatasetdatanomodificationallowederrEE", |
michael@0 | 17 | "documentcreateelementdefaultattr", "documentcreateentityreference", "documentcreateentityreferenceknown", |
michael@0 | 18 | "documenttypegetentities", "documenttypegetentitieslength", "documenttypegetentitiestype", |
michael@0 | 19 | "documenttypegetnotations", "documenttypegetnotationstype", "elementremoveattribute", |
michael@0 | 20 | "elementremoveattributenodenomodificationallowederr", "elementremoveattributenodenomodificationallowederrEE", |
michael@0 | 21 | "elementremoveattributenomodificationallowederr", "elementremoveattributenomodificationallowederrEE", |
michael@0 | 22 | "elementremoveattributerestoredefaultvalue", "elementretrieveallattributes", |
michael@0 | 23 | "elementsetattributenodenomodificationallowederr", "elementsetattributenodenomodificationallowederrEE", |
michael@0 | 24 | "elementsetattributenomodificationallowederr", "elementsetattributenomodificationallowederrEE", |
michael@0 | 25 | "entitygetentityname", "entitygetpublicid", "entitygetpublicidnull", "namednodemapremovenameditem", |
michael@0 | 26 | "namednodemapremovenameditemgetvalue", "nodeappendchildnomodificationallowederr", "nodeappendchildnomodificationallowederrEE", |
michael@0 | 27 | "nodeentitynodeattributes", "nodeentitynodename", "nodeentitynodetype", "nodeentitynodevalue", |
michael@0 | 28 | "nodeentityreferencenodeattributes", "nodeentityreferencenodename", "nodeentityreferencenodetype", |
michael@0 | 29 | "nodeentityreferencenodevalue", "nodeentitysetnodevalue", "nodeinsertbeforenomodificationallowederr", |
michael@0 | 30 | "nodeinsertbeforenomodificationallowederrEE", "nodenotationnodeattributes", "nodenotationnodename", |
michael@0 | 31 | "nodenotationnodetype", "nodenotationnodevalue", "noderemovechildnomodificationallowederr", |
michael@0 | 32 | "noderemovechildnomodificationallowederrEE", "nodereplacechildnomodificationallowederr", |
michael@0 | 33 | "nodereplacechildnomodificationallowederrEE", "nodesetnodevaluenomodificationallowederr", |
michael@0 | 34 | "nodesetnodevaluenomodificationallowederrEE", "nodevalue03","nodevalue07", "nodevalue08", |
michael@0 | 35 | "notationgetnotationname", "notationgetpublicid", "notationgetpublicidnull", "notationgetsystemid", |
michael@0 | 36 | "notationgetsystemidnull", "processinginstructionsetdatanomodificationallowederr", |
michael@0 | 37 | "processinginstructionsetdatanomodificationallowederrEE", "textsplittextnomodificationallowederr", |
michael@0 | 38 | "textsplittextnomodificationallowederrEE"]; |
michael@0 | 39 | |
michael@0 | 40 | // we don't pass these, unfortunately |
michael@0 | 41 | var indexErrTests = ["characterdataindexsizeerrdeletedatacountnegative", "characterdataindexsizeerrreplacedatacountnegative", |
michael@0 | 42 | "characterdataindexsizeerrsubstringcountnegative", "hc_characterdataindexsizeerrdeletedatacountnegative", |
michael@0 | 43 | "hc_characterdataindexsizeerrreplacedatacountnegative", "hc_characterdataindexsizeerrsubstringcountnegative"]; |
michael@0 | 44 | |
michael@0 | 45 | var attributeModTests = ["hc_attrappendchild1", "hc_attrappendchild3", "hc_attrappendchild5", |
michael@0 | 46 | "hc_attrappendchild6", "hc_attrchildnodes2", "hc_attrclonenode1", "hc_attrinsertbefore1", |
michael@0 | 47 | "hc_attrinsertbefore2", "hc_attrinsertbefore3", "hc_attrinsertbefore4", "hc_attrinsertbefore6", |
michael@0 | 48 | "hc_attrnormalize", "hc_attrreplacechild1", "hc_attrreplacechild2", |
michael@0 | 49 | "hc_attrsetvalue2", "hc_elementnormalize2", "hc_elementnotfounderr", "hc_elementremoveattribute", "hc_elementnormalize2", |
michael@0 | 50 | "hc_elementnotfounderr", "hc_elementremoveattribute", |
michael@0 | 51 | "hc_attrchildnodes1", "hc_attrfirstchild", |
michael@0 | 52 | "hc_attrhaschildnodes", "hc_attrlastchild", |
michael@0 | 53 | "hc_attrremovechild1", "hc_attrsetvalue1"]; |
michael@0 | 54 | var modTests = ["hc_elementwrongdocumenterr", "hc_namednodemapwrongdocumenterr", "hc_nodeappendchildnewchilddiffdocument", "hc_nodeinsertbeforenewchilddiffdocument", |
michael@0 | 55 | "hc_nodereplacechildnewchilddiffdocument", "hc_elementwrongdocumenterr", "hc_namednodemapwrongdocumenterr", "hc_nodeappendchildnewchilddiffdocument", |
michael@0 | 56 | "hc_nodeinsertbeforenewchilddiffdocument", "hc_nodereplacechildnewchilddiffdocument", "elementwrongdocumenterr", "namednodemapwrongdocumenterr", |
michael@0 | 57 | "nodeappendchildnewchilddiffdocument", "nodeinsertbeforenewchilddiffdocument", "nodereplacechildnewchilddiffdocument"]; |
michael@0 | 58 | // These tests rely on an implementation of document.createEntityReference. |
michael@0 | 59 | var createEntityRef = ["documentinvalidcharacterexceptioncreateentref", |
michael@0 | 60 | "documentinvalidcharacterexceptioncreateentref1", |
michael@0 | 61 | "hc_attrgetvalue2", "hc_nodevalue03"]; |
michael@0 | 62 | var createProcessingInstructionHTML = ["documentinvalidcharacterexceptioncreatepi", |
michael@0 | 63 | "documentinvalidcharacterexceptioncreatepi1"]; |
michael@0 | 64 | // These tests expect Node.attributes to exist. |
michael@0 | 65 | var attributesOnNode = [ |
michael@0 | 66 | "hc_commentgetcomment", |
michael@0 | 67 | "hc_documentgetdoctype", |
michael@0 | 68 | "hc_nodeattributenodeattribute", |
michael@0 | 69 | "hc_nodecommentnodeattributes", |
michael@0 | 70 | "hc_nodecommentnodeattributes", |
michael@0 | 71 | "hc_nodedocumentfragmentnodevalue", |
michael@0 | 72 | "hc_nodedocumentnodeattribute", |
michael@0 | 73 | "hc_nodetextnodeattribute", |
michael@0 | 74 | "nodeattributenodeattribute", |
michael@0 | 75 | "nodecommentnodeattributes", |
michael@0 | 76 | "nodecommentnodeattributes", |
michael@0 | 77 | "nodedocumentfragmentnodevalue", |
michael@0 | 78 | "nodedocumentnodeattribute", |
michael@0 | 79 | "nodeprocessinginstructionnodeattributes", |
michael@0 | 80 | "nodetextnodeattribute", |
michael@0 | 81 | "nodecdatasectionnodeattribute", |
michael@0 | 82 | "nodedocumenttypenodevalue" |
michael@0 | 83 | ] |
michael@0 | 84 | |
michael@0 | 85 | var todoTests = {}; |
michael@0 | 86 | function concat(lst/*...*/) { |
michael@0 | 87 | var f = []; |
michael@0 | 88 | if (arguments !== null) { |
michael@0 | 89 | f = arguments[0]; |
michael@0 | 90 | } |
michael@0 | 91 | for (var i = 1; i < arguments.length; i++) { |
michael@0 | 92 | f = f.concat(arguments[i]); |
michael@0 | 93 | } |
michael@0 | 94 | return f; |
michael@0 | 95 | } |
michael@0 | 96 | var exclusions = concat(dtdTests, indexErrTests, attributeModTests, modTests, createEntityRef, createProcessingInstructionHTML, attributesOnNode); |
michael@0 | 97 | for (var excludedTestName in exclusions) { todoTests[exclusions[excludedTestName]] = true; } |